1 --- rpm-4.3/build/rpmfc.c.orig Wed May 19 11:30:29 2004
2 +++ rpm-4.3/build/rpmfc.c Wed May 19 17:03:01 2004
6 #include <signal.h> /* getOutputFrom() */
12 #define _RPMDS_INTERNAL
24 +static regex_t * rpmfcExpandRegexps(const char * str,int *count){
27 + ARGV_t patterns=NULL;
28 + regex_t *compiled=NULL;
30 + s=rpmExpand(str,NULL);
32 + poptParseArgvString(s,count,(const char ***)&patterns);
35 + if (patterns==NULL){
44 + compiled=malloc(sizeof(regex_t)*(*count));
46 + for(i=0;i<*count;i++){
47 + r=regcomp(&compiled[j],patterns[i],REG_NOSUB);
50 + rpmMessage(RPMMESS_NORMAL,
51 + _("Compilation of regular expresion '%s'"
52 + " (expanded from '%s') failed. Skipping it.\n"),
56 + patterns=_free(patterns);
58 + compiled=_free(compiled);
66 +static int rpmfcMatchRegexps(regex_t *regexps, int count, const char *str, char deptype)
69 + for(j = 0; j < count; j++) {
70 + rpmMessage(RPMMESS_DEBUG,
71 + _("Checking %c: '%s' against _noauto expr. #%i\n"), deptype, str, j);
72 + if (!regexec(®exps[j], str, 0, NULL, 0)) {
73 + rpmMessage(RPMMESS_NORMAL,
74 + _("Skipping %c: '%s' as it matches _noauto expr. #%i\n"), deptype, str, j);
81 +static regex_t * rpmfcFreeRegexps(regex_t *regexps,int count){
85 + for(i=0;i<count;i++)
86 + regfree(®exps[i]);
87 + return _free(regexps);
91 * Run per-interpreter dependency helper.
92 * @param fc file classifier
93 * @param deptype 'P' == Provides:, 'R' == Requires:, helper
94 * @param nsdep class name for interpreter (e.g. "perl")
95 + * @param noauto _noauto* regexps
96 + * @param noauto_c # of _noauto* regexps
97 * @return 0 on success
99 -static int rpmfcHelper(rpmfc fc, unsigned char deptype, const char * nsdep)
100 +static int rpmfcHelper(rpmfc fc, unsigned char deptype, const char * nsdep,
101 + regex_t * noauto, int noauto_c)
102 /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
103 /*@modifies fc, rpmGlobalMacroContext, fileSystem, internalState @*/
109 + if(rpmfcMatchRegexps(noauto, noauto_c, N, deptype))
112 /* Add tracking dependency for versioned Provides: */
113 if (!fc->tracked && deptype == 'P' && *EVR != '\0') {
116 * Extract script dependencies.
117 * @param fc file classifier
118 + * @param findprov 1 to enable provides
119 + * @param findreq 1 to enable requires
120 + * @param noautoprov _noautoprov regexps
121 + * @param noautoprov_c # of _noautoprov regexps
122 + * @param noautoreq _noautoreq regexps
123 + * @param noautoreq_c # of _noautoreq regexps
124 * @return 0 on success
126 -static int rpmfcSCRIPT(rpmfc fc)
127 +static int rpmfcSCRIPT(rpmfc fc, int findprov, int findreq,
128 + regex_t *noautoprov, int noautoprov_c, regex_t *noautoreq, int noautoreq_c)
129 /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
130 /*@modifies fc, rpmGlobalMacroContext, fileSystem, internalState @*/
136 - if (is_executable) {
137 + if (is_executable && findreq && !rpmfcMatchRegexps(noautoreq, noautoreq_c, s, 'R')) {
138 /* Add to package requires. */
139 ds = rpmdsSingle(RPMTAG_REQUIRENAME, s, "", RPMSENSE_FIND_REQUIRES);
140 xx = rpmdsMerge(&fc->requires, ds);
141 @@ -718,21 +799,22 @@
144 if (fc->fcolor->vals[fc->ix] & RPMFC_PERL) {
145 - if (fc->fcolor->vals[fc->ix] & RPMFC_MODULE)
146 - xx = rpmfcHelper(fc, 'P', "perl");
147 - if (is_executable || (fc->fcolor->vals[fc->ix] & RPMFC_MODULE))
148 - xx = rpmfcHelper(fc, 'R', "perl");
149 + if (findprov && fc->fcolor->vals[fc->ix] & RPMFC_MODULE)
150 + xx = rpmfcHelper(fc, 'P', "perl", noautoprov, noautoprov_c);
151 + if (findreq && (is_executable || (fc->fcolor->vals[fc->ix] & RPMFC_MODULE)))
152 + xx = rpmfcHelper(fc, 'R', "perl", noautoreq, noautoreq_c);
154 if (fc->fcolor->vals[fc->ix] & RPMFC_PYTHON) {
155 - xx = rpmfcHelper(fc, 'P', "python");
159 - xx = rpmfcHelper(fc, 'R', "python");
161 + xx = rpmfcHelper(fc, 'P', "python", noautoprov, noautoprov_c);
162 + if (findreq && is_executable)
163 + xx = rpmfcHelper(fc, 'R', "python", noautoreq, noautoreq_c);
165 if (fc->fcolor->vals[fc->ix] & RPMFC_PHP) {
166 - xx = rpmfcHelper(fc, 'P', "php");
167 - xx = rpmfcHelper(fc, 'R', "php");
169 + xx = rpmfcHelper(fc, 'P', "php", noautoprov, noautoprov_c);
171 + xx = rpmfcHelper(fc, 'R', "php", noautoreq, noautoreq_c);
177 * Extract Elf dependencies.
178 * @param fc file classifier
179 + * @param findprov 1 to enable provides
180 + * @param findreq 1 to enable requires
181 + * @param noautoprov _noautoprov regexps
182 + * @param noautoprov_c # of _noautoprov regexps
183 + * @param noautoreq _noautoreq regexps
184 + * @param noautoreq_c # of _noautoreq regexps
185 * @return 0 on success
187 -static int rpmfcELF(rpmfc fc)
188 +static int rpmfcELF(rpmfc fc, int findprov, int findreq,
189 + regex_t *noautoprov, int noautoprov_c, regex_t *noautoreq, int noautoreq_c)
190 /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
191 /*@modifies fc, rpmGlobalMacroContext, fileSystem, internalState @*/
193 @@ -844,26 +935,31 @@
194 && !(filter_GLIBC_PRIVATE != 0
195 && !strcmp(s, "GLIBC_PRIVATE")))
201 t = stpcpy( stpcpy( stpcpy( stpcpy(t, soname), "("), s), ")");
203 + doauto = findprov && !rpmfcMatchRegexps(noautoprov, noautoprov_c, buf, 'P');
204 #if !defined(__alpha__)
206 t = stpcpy(t, "(64bit)");
211 + /* Add to package provides. */
212 + ds = rpmdsSingle(RPMTAG_PROVIDES,
213 + buf, "", RPMSENSE_FIND_PROVIDES);
214 + xx = rpmdsMerge(&fc->provides, ds);
216 + /* Add to file dependencies. */
217 + xx = rpmfcSaveArg(&fc->ddict,
218 + rpmfcFileDep(t, fc->ix, ds));
220 - /* Add to package provides. */
221 - ds = rpmdsSingle(RPMTAG_PROVIDES,
222 - buf, "", RPMSENSE_FIND_PROVIDES);
223 - xx = rpmdsMerge(&fc->provides, ds);
225 - /* Add to file dependencies. */
226 - xx = rpmfcSaveArg(&fc->ddict,
227 - rpmfcFileDep(t, fc->ix, ds));
229 - ds = rpmdsFree(ds);
230 + ds = rpmdsFree(ds);
233 auxoffset += aux->vda_next;
235 @@ -904,25 +1000,30 @@
236 && !(filter_GLIBC_PRIVATE != 0
237 && !strcmp(s, "GLIBC_PRIVATE")))
243 t = stpcpy( stpcpy( stpcpy( stpcpy(t, soname), "("), s), ")");
245 + doauto = findreq && !rpmfcMatchRegexps(noautoreq, noautoreq_c, buf, 'R');
246 #if !defined(__alpha__)
248 t = stpcpy(t, "(64bit)");
252 - /* Add to package dependencies. */
253 - ds = rpmdsSingle(RPMTAG_REQUIRENAME,
254 - buf, "", RPMSENSE_FIND_REQUIRES);
255 - xx = rpmdsMerge(&fc->requires, ds);
257 - /* Add to file dependencies. */
258 - xx = rpmfcSaveArg(&fc->ddict,
259 - rpmfcFileDep(t, fc->ix, ds));
260 - ds = rpmdsFree(ds);
262 + /* Add to package dependencies. */
263 + ds = rpmdsSingle(RPMTAG_REQUIRENAME,
264 + buf, "", RPMSENSE_FIND_REQUIRES);
265 + xx = rpmdsMerge(&fc->requires, ds);
267 + /* Add to file dependencies. */
268 + xx = rpmfcSaveArg(&fc->ddict,
269 + rpmfcFileDep(t, fc->ix, ds));
270 + ds = rpmdsFree(ds);
273 auxoffset += aux->vna_next;
275 @@ -947,23 +1048,30 @@
276 /* Files with executable bit set only. */
277 if (fc->skipReq || !(st->st_mode & (S_IXUSR|S_IXGRP|S_IXOTH)))
278 /*@innercontinue@*/ continue;
281 /* Add to package requires. */
282 depsp = &fc->requires;
283 tagN = RPMTAG_REQUIRENAME;
284 dsContext = RPMSENSE_FIND_REQUIRES;
285 s = elf_strptr(elf, shdr->sh_link, dyn->d_un.d_val);
287 + if(rpmfcMatchRegexps(noautoreq, noautoreq_c, s, 'R'))
289 /*@switchbreak@*/ break;
292 /* Add to package provides. */
294 /*@innercontinue@*/ continue;
295 + if (!findprov) continue;
296 depsp = &fc->provides;
297 tagN = RPMTAG_PROVIDENAME;
298 dsContext = RPMSENSE_FIND_PROVIDES;
299 s = elf_strptr(elf, shdr->sh_link, dyn->d_un.d_val);
301 + if(rpmfcMatchRegexps(noautoprov, noautoprov_c, s, 'P'))
303 /*@switchbreak@*/ break;
307 /*@=branchstate =uniondef @*/
309 /* For DSO's, provide the basename of the file if DT_SONAME not found. */
310 - if (!fc->skipProv && isDSO && !gotDEBUG && !gotSONAME) {
311 + if (findprov && !fc->skipProv && isDSO && !gotDEBUG && !gotSONAME) {
312 depsp = &fc->provides;
313 tagN = RPMTAG_PROVIDENAME;
314 dsContext = RPMSENSE_FIND_PROVIDES;
315 @@ -1015,6 +1123,8 @@
319 + if(!rpmfcMatchRegexps(noautoprov, noautoprov_c, buf, 'P')) {
321 #if !defined(__alpha__)
323 t = stpcpy(t, "()(64bit)");
324 @@ -1032,6 +1142,7 @@
332 @@ -1045,7 +1156,8 @@
335 typedef struct rpmfcApplyTbl_s {
336 - int (*func) (rpmfc fc);
337 + int (*func) (rpmfc fc, int findprov, int findreq,
338 + regex_t *noautoprov, int noautoprov_c, regex_t *noautoreq, int noautoreq_c);
342 @@ -1058,6 +1170,109 @@
346 +static int rpmfcFindRequiredPackages(rpmfc fc)
355 + unsigned char deptype;
363 + const char * hname;
364 + rpmdbMatchIterator it;
366 + regex_t *noautoreqdep;
367 + int noautoreqdep_c;
369 + noautoreqdep=rpmfcExpandRegexps("%{__noautoreqdep}", &noautoreqdep_c);
371 + ts = rpmtsCreate(); /* XXX ts created in main() should be used */
373 + rpmMessage(RPMMESS_NORMAL, _("Searching for required packages....\n"));
375 + nddict = argvCount(fc->ddict);
377 + for (i = 0; i < nddict; i++) {
380 + /* Parse out (file#,deptype,N,EVR,Flags) */
381 + ix = strtol(s, &se, 10);
382 + assert(se != NULL);
386 + while (*se && *se != ' ')
390 + while (*se && *se != ' ')
393 + Flags = strtol(se, NULL, 16);
395 + if (deptype!='R') continue;
397 + rpmMessage(RPMMESS_DEBUG, _("#%i requires: %s,%s,%i\n"),ix,N,EVR,Flags);
398 + if (EVR && EVR[0]) {
399 + rpmMessage(RPMMESS_DEBUG, _("skipping #%i require\n"));
402 + for(j=0;j<noautoreqdep_c;j++)
403 + if (!regexec(&noautoreqdep[j],N,0,NULL,0)) {
404 + rpmMessage(RPMMESS_NORMAL,
405 + _("skipping %s requirement processing"
406 + " (matches noautoreqdep pattern #%i)\n"),N,j);
409 + if (j<noautoreqdep_c) continue;
411 + rpmMessage(RPMMESS_DEBUG, _("skipping #%i require (is file requirement)\n"));
414 + it=rpmtsInitIterator(ts, RPMTAG_PROVIDENAME, N, 0);
416 + rpmMessage(RPMMESS_DEBUG, _("%s -> not found\n"),N);
419 + rpmMessage(RPMMESS_DEBUG, _("Iterator: %p\n"),it);
420 + if (rpmdbGetIteratorCount(it)>1) {
421 + rpmMessage(RPMMESS_DEBUG, _("%s -> multiple (skipping)\n"),N);
422 + rpmdbFreeIterator(it);
425 + hdr=rpmdbNextIterator(it);
427 + r=rpmHeaderGetEntry(hdr,RPMTAG_NAME,NULL,(void **)&hname, NULL);
429 + if (!strcmp(hname,N)) {
430 + rpmMessage(RPMMESS_DEBUG, _("%s -> %s (skipping)\n"),N,hname);
431 + rpmdbFreeIterator(it);
435 + rpmMessage(RPMMESS_DEBUG, "%s -> %s\n",N,hname);
437 + ds = rpmdsSingle(RPMTAG_REQUIRENAME, hname, "", RPMSENSE_FIND_REQUIRES);
438 + xx = rpmdsMerge(&fc->requires, ds);
439 + ds = rpmdsFree(ds);
441 + rpmdbFreeIterator(it);
444 + noautoreqdep=rpmfcFreeRegexps(noautoreqdep,noautoreqdep_c);
445 + ts = rpmtsFree(ts);
449 int rpmfcApply(rpmfc fc)
452 @@ -1075,6 +1290,29 @@
459 + regex_t *noautoprovfiles = NULL;
460 + int noautoprovfiles_c;
461 + regex_t *noautoreqfiles = NULL;
462 + int noautoreqfiles_c;
463 + regex_t *noautoprov = NULL;
465 + regex_t *noautoreq = NULL;
467 + const char *buildroot;
470 + buildroot = rpmExpand("%{buildroot}",NULL);
471 + buildroot_l = strlen(buildroot);
473 + noautoprovfiles = rpmfcExpandRegexps("%{__noautoprovfiles}", &noautoprovfiles_c);
474 + noautoreqfiles = rpmfcExpandRegexps("%{__noautoreqfiles}", &noautoreqfiles_c);
475 + noautoprov = rpmfcExpandRegexps("%{__noautoprov}", &noautoprov_c);
476 + noautoreq = rpmfcExpandRegexps("%{__noautoreq}", &noautoreq_c);
477 + rpmMessage(RPMMESS_DEBUG, _("%i _noautoprov patterns.\n"), noautoprov_c);
478 + rpmMessage(RPMMESS_DEBUG, _("%i _noautoreq patterns.\n"), noautoreq_c);
480 /* Generate package and per-file dependencies. */
481 for (fc->ix = 0; fc->fn[fc->ix] != NULL; fc->ix++) {
482 @@ -1082,10 +1320,44 @@
483 for (fcat = rpmfcApplyTable; fcat->func != NULL; fcat++) {
484 if (!(fc->fcolor->vals[fc->ix] & fcat->colormask))
485 /*@innercontinue@*/ continue;
486 - xx = (*fcat->func) (fc);
489 + if (strncmp(fc->fn[fc->ix],buildroot,buildroot_l)==0) {/* sanity check */
490 + for(j = 0; j < noautoprovfiles_c; j++) {
491 + if (!regexec(&noautoprovfiles[j],
492 + fc->fn[fc->ix] + buildroot_l, 0, NULL, 0)) {
493 + rpmMessage(RPMMESS_NORMAL,
494 + _("skipping %s provides detection"
495 + " (matches noautoprovfiles pattern #%i)\n"),
496 + fc->fn[fc->ix], j);
501 + for(j = 0; j < noautoreqfiles_c; j++) {
502 + if (!regexec(&noautoreqfiles[j],
503 + fc->fn[fc->ix] + buildroot_l, 0, NULL, 0)) {
504 + rpmMessage(RPMMESS_NORMAL,
505 + _("skipping %s requires detection"
506 + " (matches noautoreqfiles pattern #%i)\n"),
507 + fc->fn[fc->ix], j);
513 + xx = (*fcat->func) (fc, findprov, findreq,
514 + noautoprov, noautoprov_c, noautoreq, noautoreq_c);
518 + noautoprovfiles = rpmfcFreeRegexps(noautoprovfiles, noautoprovfiles_c);
519 + noautoreqfiles = rpmfcFreeRegexps(noautoreqfiles, noautoreqfiles_c);
520 + noautoprov = rpmfcFreeRegexps(noautoprov, noautoprov_c);
521 + noautoreq = rpmfcFreeRegexps(noautoreq, noautoreq_c);
522 +#ifdef AUTODEP_PKGNAMES /* define to use package names in R */
523 + rpmfcFindRequiredPackages(fc);
526 /* Generate per-file indices into package dependencies. */
527 nddict = argvCount(fc->ddict);
528 --- rpm-4.3/po/POTFILES.in.orig 2004-01-04 03:13:02.000000000 +0100
529 +++ rpm-4.3/po/POTFILES.in 2004-02-01 21:05:50.567248776 +0100
538 --- rpm-4.3/po/pl.po.orig 2004-02-01 20:53:10.000000000 +0100
539 +++ rpm-4.3/po/pl.po 2004-02-01 21:20:36.532561576 +0100
540 @@ -1295,6 +1295,127 @@
541 msgid "lookup i18N strings in specfile catalog"
542 msgstr "wyszukaj wpisy I18N w katalogu pliku spec"
546 +msgid "\texecv(%s) pid %d\n"
547 +msgstr "\texecv(%s) pid %d\n"
549 +#. XXX this error message is probably not seen.
550 +#: build/rpmfc.c:100
552 +msgid "Couldn't exec %s: %s\n"
553 +msgstr "Nie mo¿na uruchomiæ %s: %s\n"
555 +#: build/rpmfc.c:105
557 +msgid "Couldn't fork %s: %s\n"
558 +msgstr "Nie mo¿na wykonaæ fork %s: %s\n"
560 +#: build/rpmfc.c:190
562 +msgid "\twaitpid(%d) rc %d status %x\n"
563 +msgstr "\twaitpid(%d) rc %d status %x\n"
565 +#: build/rpmfc.c:194
568 +msgstr "%s nie powiod³o siê\n"
570 +#: build/rpmfc.c:198
572 +msgid "failed to write all data to %s\n"
573 +msgstr "Nie uda³o siê zapisaæ wszystkich danych do %s\n"
575 +#: build/rpmfc.c:334
577 +msgid "Compilation of regular expresion '%s' (expanded from '%s') failed. Skipping it.\n"
578 +msgstr "Kompilacja wyra¿enia regularnego '%s' (powsta³ego z '%s') nie powiod³a siê; pominiêto.\n"
580 +#: build/rpmfc.c:395
582 +msgid "%i _noautoprov patterns.\n"
583 +msgstr "%i wzorców _noautoprov.\n"
585 +#: build/rpmfc.c:405
587 +msgid "%i _noautoreq patterns.\n"
588 +msgstr "%i wzorców _noautoreq.\n"
590 +#: build/rpmfc.c:459
592 +msgid "Checking %c: '%s' against _noauto expr. #%i\n"
593 +msgstr "Sprawdzanie %c: '%s' z wyra¿eniem _noauto #%i\n"
595 +#: build/rpmfc.c:462
597 +msgid "Skipping %c: '%s' as it matches _noauto expr. #%i\n"
598 +msgstr "Pominiêto %c: '%s' pasuj±ce do wyra¿enia _noauto #%i\n"
600 +#. XXX ts created in main() should be used
601 +#: build/rpmfc.c:1173
602 +msgid "Searching for required packages....\n"
603 +msgstr "Poszukiwanie wymaganych pakietów...\n"
605 +#: build/rpmfc.c:1197
607 +msgid "#%i requires: %s,%s,%i\n"
608 +msgstr "#%i wymaga: %s,%s,%i\n"
610 +#: build/rpmfc.c:1199
612 +msgid "skipping #%i require\n"
613 +msgstr "pominiêto zale¿no¶æ #%i\n"
615 +#: build/rpmfc.c:1205
617 +msgid "skipping %s requirement processing (matches noautoreqdep pattern #%i)\n"
618 +msgstr "pominiêto przetwarzanie zale¿no¶ci %s (pasuje do wzorca noautoreqdep #%i)\n"
620 +#: build/rpmfc.c:1211
622 +msgid "skipping #%i require (is file requirement)\n"
623 +msgstr "pominiêto zale¿no¶æ #%i (zale¿no¶æ od pliku)\n"
625 +#: build/rpmfc.c:1216
627 +msgid "%s -> not found\n"
628 +msgstr "%s -> nie znaleziono\n"
630 +#: build/rpmfc.c:1219
632 +msgid "Iterator: %p\n"
633 +msgstr "Iterator: %p\n"
635 +#: build/rpmfc.c:1221
637 +msgid "%s -> multiple (skipping)\n"
638 +msgstr "%s -> wiele (pominiêto)\n"
640 +#: build/rpmfc.c:1230
642 +msgid "%s -> %s (skipping)\n"
643 +msgstr "%s -> %s (pominiêto)\n"
645 +#: build/rpmfc.c:1295
647 +msgid "skipping %s provides detection (matches noautoprovfiles pattern #%i)\n"
648 +msgstr "pominiêto wykrywanie w³asno¶ci %s (pasuje do wzorca noautoprovfiles #%i)\n"
650 +#: build/rpmfc.c:1306
652 +msgid "skipping %s requires detection (matches noautoreqfiles pattern #%i)\n"
653 +msgstr "pominiêto wykrywanie w³asno¶ci %s (pasuje do wzorca noautoreqfiles #%i)\n"
655 +#: build/rpmfc.c:1642
657 +msgid "Finding %s: %s\n"
658 +msgstr "Poszukiwanie %s: %s\n"
660 +#: build/rpmfc.c:1648 build/rpmfc.c:1657
662 +msgid "Failed to find %s:\n"
663 +msgstr "Nie uda³o siê odnale¼æ %s:\n"
667 msgid "line %d: Bad number: %s\n"
668 --- rpm/configure.ac.orig 2004-08-22 13:02:30.000000000 +0200
669 +++ rpm/configure.ac 2004-08-22 13:25:37.000000000 +0200
671 AC_SUBST(__CHGRP_RHF)
674 +dnl enable generating autorequires containing packages names
676 +AC_ARG_ENABLE([adding-packages-names-in-autogenerated-dependancies],
677 + [ --enable-adding-packages-names-in-autogenerated-dependancies Add packages names for autogenerated dependancies to requires],
679 + AC_MSG_RESULT([Using packages names in autogerated requires is enabled])
680 + AC_DEFINE(AUTODEP_PKGNAMES, 1, "Generating autorequires containing packages names.")
686 dnl figure out what root's primary group is
688 AC_MSG_CHECKING(root's primary group)