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,19 +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");
157 - xx = rpmfcHelper(fc, 'R', "python");
159 + xx = rpmfcHelper(fc, 'P', "python", noautoprov, noautoprov_c);
160 + if (findreq && is_executable)
161 + xx = rpmfcHelper(fc, 'R', "python", noautoreq, noautoreq_c);
163 if (fc->fcolor->vals[fc->ix] & RPMFC_PHP) {
164 - xx = rpmfcHelper(fc, 'P', "php");
165 - xx = rpmfcHelper(fc, 'R', "php");
167 + xx = rpmfcHelper(fc, 'P', "php", noautoprov, noautoprov_c);
169 + xx = rpmfcHelper(fc, 'R', "php", noautoreq, noautoreq_c);
175 * Extract Elf dependencies.
176 * @param fc file classifier
177 + * @param findprov 1 to enable provides
178 + * @param findreq 1 to enable requires
179 + * @param noautoprov _noautoprov regexps
180 + * @param noautoprov_c # of _noautoprov regexps
181 + * @param noautoreq _noautoreq regexps
182 + * @param noautoreq_c # of _noautoreq regexps
183 * @return 0 on success
185 -static int rpmfcELF(rpmfc fc)
186 +static int rpmfcELF(rpmfc fc, int findprov, int findreq,
187 + regex_t *noautoprov, int noautoprov_c, regex_t *noautoreq, int noautoreq_c)
188 /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
189 /*@modifies fc, rpmGlobalMacroContext, fileSystem, internalState @*/
191 @@ -844,26 +935,31 @@
192 && !(filter_GLIBC_PRIVATE != 0
193 && !strcmp(s, "GLIBC_PRIVATE")))
199 t = stpcpy( stpcpy( stpcpy( stpcpy(t, soname), "("), s), ")");
201 + doauto = findprov && !rpmfcMatchRegexps(noautoprov, noautoprov_c, buf, 'P');
202 #if !defined(__alpha__)
204 t = stpcpy(t, "(64bit)");
209 + /* Add to package provides. */
210 + ds = rpmdsSingle(RPMTAG_PROVIDES,
211 + buf, "", RPMSENSE_FIND_PROVIDES);
212 + xx = rpmdsMerge(&fc->provides, ds);
214 + /* Add to file dependencies. */
215 + xx = rpmfcSaveArg(&fc->ddict,
216 + rpmfcFileDep(t, fc->ix, ds));
218 - /* Add to package provides. */
219 - ds = rpmdsSingle(RPMTAG_PROVIDES,
220 - buf, "", RPMSENSE_FIND_PROVIDES);
221 - xx = rpmdsMerge(&fc->provides, ds);
223 - /* Add to file dependencies. */
224 - xx = rpmfcSaveArg(&fc->ddict,
225 - rpmfcFileDep(t, fc->ix, ds));
227 - ds = rpmdsFree(ds);
228 + ds = rpmdsFree(ds);
231 auxoffset += aux->vda_next;
233 @@ -904,25 +1000,30 @@
234 && !(filter_GLIBC_PRIVATE != 0
235 && !strcmp(s, "GLIBC_PRIVATE")))
241 t = stpcpy( stpcpy( stpcpy( stpcpy(t, soname), "("), s), ")");
243 + doauto = findreq && !rpmfcMatchRegexps(noautoreq, noautoreq_c, buf, 'R');
244 #if !defined(__alpha__)
246 t = stpcpy(t, "(64bit)");
250 - /* Add to package dependencies. */
251 - ds = rpmdsSingle(RPMTAG_REQUIRENAME,
252 - buf, "", RPMSENSE_FIND_REQUIRES);
253 - xx = rpmdsMerge(&fc->requires, ds);
255 - /* Add to file dependencies. */
256 - xx = rpmfcSaveArg(&fc->ddict,
257 - rpmfcFileDep(t, fc->ix, ds));
258 - ds = rpmdsFree(ds);
260 + /* Add to package dependencies. */
261 + ds = rpmdsSingle(RPMTAG_REQUIRENAME,
262 + buf, "", RPMSENSE_FIND_REQUIRES);
263 + xx = rpmdsMerge(&fc->requires, ds);
265 + /* Add to file dependencies. */
266 + xx = rpmfcSaveArg(&fc->ddict,
267 + rpmfcFileDep(t, fc->ix, ds));
268 + ds = rpmdsFree(ds);
271 auxoffset += aux->vna_next;
273 @@ -947,23 +1048,30 @@
274 /* Files with executable bit set only. */
275 if (fc->skipReq || !(st->st_mode & (S_IXUSR|S_IXGRP|S_IXOTH)))
276 /*@innercontinue@*/ continue;
279 /* Add to package requires. */
280 depsp = &fc->requires;
281 tagN = RPMTAG_REQUIRENAME;
282 dsContext = RPMSENSE_FIND_REQUIRES;
283 s = elf_strptr(elf, shdr->sh_link, dyn->d_un.d_val);
285 + if(rpmfcMatchRegexps(noautoreq, noautoreq_c, s, 'R'))
287 /*@switchbreak@*/ break;
290 /* Add to package provides. */
292 /*@innercontinue@*/ continue;
293 + if (!findprov) continue;
294 depsp = &fc->provides;
295 tagN = RPMTAG_PROVIDENAME;
296 dsContext = RPMSENSE_FIND_PROVIDES;
297 s = elf_strptr(elf, shdr->sh_link, dyn->d_un.d_val);
299 + if(rpmfcMatchRegexps(noautoprov, noautoprov_c, s, 'P'))
301 /*@switchbreak@*/ break;
305 /*@=branchstate =uniondef @*/
307 /* For DSO's, provide the basename of the file if DT_SONAME not found. */
308 - if (!fc->skipProv && isDSO && !gotDEBUG && !gotSONAME) {
309 + if (findprov && !fc->skipProv && isDSO && !gotDEBUG && !gotSONAME) {
310 depsp = &fc->provides;
311 tagN = RPMTAG_PROVIDENAME;
312 dsContext = RPMSENSE_FIND_PROVIDES;
313 @@ -1015,6 +1123,8 @@
317 + if(!rpmfcMatchRegexps(noautoprov, noautoprov_c, buf, 'P')) {
319 #if !defined(__alpha__)
321 t = stpcpy(t, "()(64bit)");
322 @@ -1032,6 +1142,7 @@
330 @@ -1045,7 +1156,8 @@
333 typedef struct rpmfcApplyTbl_s {
334 - int (*func) (rpmfc fc);
335 + int (*func) (rpmfc fc, int findprov, int findreq,
336 + regex_t *noautoprov, int noautoprov_c, regex_t *noautoreq, int noautoreq_c);
340 @@ -1058,6 +1170,109 @@
344 +static int rpmfcFindRequiredPackages(rpmfc fc)
353 + unsigned char deptype;
361 + const char * hname;
362 + rpmdbMatchIterator it;
364 + regex_t *noautoreqdep;
365 + int noautoreqdep_c;
367 + noautoreqdep=rpmfcExpandRegexps("%{__noautoreqdep}", &noautoreqdep_c);
369 + ts = rpmtsCreate(); /* XXX ts created in main() should be used */
371 + rpmMessage(RPMMESS_NORMAL, _("Searching for required packages....\n"));
373 + nddict = argvCount(fc->ddict);
375 + for (i = 0; i < nddict; i++) {
378 + /* Parse out (file#,deptype,N,EVR,Flags) */
379 + ix = strtol(s, &se, 10);
380 + assert(se != NULL);
384 + while (*se && *se != ' ')
388 + while (*se && *se != ' ')
391 + Flags = strtol(se, NULL, 16);
393 + if (deptype!='R') continue;
395 + rpmMessage(RPMMESS_DEBUG, _("#%i requires: %s,%s,%i\n"),ix,N,EVR,Flags);
396 + if (EVR && EVR[0]) {
397 + rpmMessage(RPMMESS_DEBUG, _("skipping #%i require\n"));
400 + for(j=0;j<noautoreqdep_c;j++)
401 + if (!regexec(&noautoreqdep[j],N,0,NULL,0)) {
402 + rpmMessage(RPMMESS_NORMAL,
403 + _("skipping %s requirement processing"
404 + " (matches noautoreqdep pattern #%i)\n"),N,j);
407 + if (j<noautoreqdep_c) continue;
409 + rpmMessage(RPMMESS_DEBUG, _("skipping #%i require (is file requirement)\n"));
412 + it=rpmtsInitIterator(ts, RPMTAG_PROVIDENAME, N, 0);
414 + rpmMessage(RPMMESS_DEBUG, _("%s -> not found\n"),N);
417 + rpmMessage(RPMMESS_DEBUG, _("Iterator: %p\n"),it);
418 + if (rpmdbGetIteratorCount(it)>1) {
419 + rpmMessage(RPMMESS_DEBUG, _("%s -> multiple (skipping)\n"),N);
420 + rpmdbFreeIterator(it);
423 + hdr=rpmdbNextIterator(it);
425 + r=rpmHeaderGetEntry(hdr,RPMTAG_NAME,NULL,(void **)&hname, NULL);
427 + if (!strcmp(hname,N)) {
428 + rpmMessage(RPMMESS_DEBUG, _("%s -> %s (skipping)\n"),N,hname);
429 + rpmdbFreeIterator(it);
433 + rpmMessage(RPMMESS_DEBUG, "%s -> %s\n",N,hname);
435 + ds = rpmdsSingle(RPMTAG_REQUIRENAME, hname, "", RPMSENSE_FIND_REQUIRES);
436 + xx = rpmdsMerge(&fc->requires, ds);
437 + ds = rpmdsFree(ds);
439 + rpmdbFreeIterator(it);
442 + noautoreqdep=rpmfcFreeRegexps(noautoreqdep,noautoreqdep_c);
443 + ts = rpmtsFree(ts);
447 int rpmfcApply(rpmfc fc)
450 @@ -1075,6 +1290,29 @@
457 + regex_t *noautoprovfiles = NULL;
458 + int noautoprovfiles_c;
459 + regex_t *noautoreqfiles = NULL;
460 + int noautoreqfiles_c;
461 + regex_t *noautoprov = NULL;
463 + regex_t *noautoreq = NULL;
465 + const char *buildroot;
468 + buildroot = rpmExpand("%{buildroot}",NULL);
469 + buildroot_l = strlen(buildroot);
471 + noautoprovfiles = rpmfcExpandRegexps("%{__noautoprovfiles}", &noautoprovfiles_c);
472 + noautoreqfiles = rpmfcExpandRegexps("%{__noautoreqfiles}", &noautoreqfiles_c);
473 + noautoprov = rpmfcExpandRegexps("%{__noautoprov}", &noautoprov_c);
474 + noautoreq = rpmfcExpandRegexps("%{__noautoreq}", &noautoreq_c);
475 + rpmMessage(RPMMESS_DEBUG, _("%i _noautoprov patterns.\n"), noautoprov_c);
476 + rpmMessage(RPMMESS_DEBUG, _("%i _noautoreq patterns.\n"), noautoreq_c);
478 /* Generate package and per-file dependencies. */
479 for (fc->ix = 0; fc->fn[fc->ix] != NULL; fc->ix++) {
480 @@ -1082,10 +1320,44 @@
481 for (fcat = rpmfcApplyTable; fcat->func != NULL; fcat++) {
482 if (!(fc->fcolor->vals[fc->ix] & fcat->colormask))
483 /*@innercontinue@*/ continue;
484 - xx = (*fcat->func) (fc);
487 + if (strncmp(fc->fn[fc->ix],buildroot,buildroot_l)==0) {/* sanity check */
488 + for(j = 0; j < noautoprovfiles_c; j++) {
489 + if (!regexec(&noautoprovfiles[j],
490 + fc->fn[fc->ix] + buildroot_l, 0, NULL, 0)) {
491 + rpmMessage(RPMMESS_NORMAL,
492 + _("skipping %s provides detection"
493 + " (matches noautoprovfiles pattern #%i)\n"),
494 + fc->fn[fc->ix], j);
499 + for(j = 0; j < noautoreqfiles_c; j++) {
500 + if (!regexec(&noautoreqfiles[j],
501 + fc->fn[fc->ix] + buildroot_l, 0, NULL, 0)) {
502 + rpmMessage(RPMMESS_NORMAL,
503 + _("skipping %s requires detection"
504 + " (matches noautoreqfiles pattern #%i)\n"),
505 + fc->fn[fc->ix], j);
511 + xx = (*fcat->func) (fc, findprov, findreq,
512 + noautoprov, noautoprov_c, noautoreq, noautoreq_c);
516 + noautoprovfiles = rpmfcFreeRegexps(noautoprovfiles, noautoprovfiles_c);
517 + noautoreqfiles = rpmfcFreeRegexps(noautoreqfiles, noautoreqfiles_c);
518 + noautoprov = rpmfcFreeRegexps(noautoprov, noautoprov_c);
519 + noautoreq = rpmfcFreeRegexps(noautoreq, noautoreq_c);
520 +#ifdef AUTODEP_PKGNAMES /* define to use package names in R */
521 + rpmfcFindRequiredPackages(fc);
524 /* Generate per-file indices into package dependencies. */
525 nddict = argvCount(fc->ddict);
526 --- rpm-4.3/po/POTFILES.in.orig 2004-01-04 03:13:02.000000000 +0100
527 +++ rpm-4.3/po/POTFILES.in 2004-02-01 21:05:50.567248776 +0100
536 --- rpm-4.3/po/pl.po.orig 2004-02-01 20:53:10.000000000 +0100
537 +++ rpm-4.3/po/pl.po 2004-02-01 21:20:36.532561576 +0100
538 @@ -1295,6 +1295,127 @@
539 msgid "lookup i18N strings in specfile catalog"
540 msgstr "wyszukaj wpisy I18N w katalogu pliku spec"
544 +msgid "\texecv(%s) pid %d\n"
545 +msgstr "\texecv(%s) pid %d\n"
547 +#. XXX this error message is probably not seen.
548 +#: build/rpmfc.c:100
550 +msgid "Couldn't exec %s: %s\n"
551 +msgstr "Nie mo¿na uruchomiæ %s: %s\n"
553 +#: build/rpmfc.c:105
555 +msgid "Couldn't fork %s: %s\n"
556 +msgstr "Nie mo¿na wykonaæ fork %s: %s\n"
558 +#: build/rpmfc.c:190
560 +msgid "\twaitpid(%d) rc %d status %x\n"
561 +msgstr "\twaitpid(%d) rc %d status %x\n"
563 +#: build/rpmfc.c:194
566 +msgstr "%s nie powiod³o siê\n"
568 +#: build/rpmfc.c:198
570 +msgid "failed to write all data to %s\n"
571 +msgstr "Nie uda³o siê zapisaæ wszystkich danych do %s\n"
573 +#: build/rpmfc.c:334
575 +msgid "Compilation of regular expresion '%s' (expanded from '%s') failed. Skipping it.\n"
576 +msgstr "Kompilacja wyra¿enia regularnego '%s' (powsta³ego z '%s') nie powiod³a siê; pominiêto.\n"
578 +#: build/rpmfc.c:395
580 +msgid "%i _noautoprov patterns.\n"
581 +msgstr "%i wzorców _noautoprov.\n"
583 +#: build/rpmfc.c:405
585 +msgid "%i _noautoreq patterns.\n"
586 +msgstr "%i wzorców _noautoreq.\n"
588 +#: build/rpmfc.c:459
590 +msgid "Checking %c: '%s' against _noauto expr. #%i\n"
591 +msgstr "Sprawdzanie %c: '%s' z wyra¿eniem _noauto #%i\n"
593 +#: build/rpmfc.c:462
595 +msgid "Skipping %c: '%s' as it matches _noauto expr. #%i\n"
596 +msgstr "Pominiêto %c: '%s' pasuj±ce do wyra¿enia _noauto #%i\n"
598 +#. XXX ts created in main() should be used
599 +#: build/rpmfc.c:1173
600 +msgid "Searching for required packages....\n"
601 +msgstr "Poszukiwanie wymaganych pakietów...\n"
603 +#: build/rpmfc.c:1197
605 +msgid "#%i requires: %s,%s,%i\n"
606 +msgstr "#%i wymaga: %s,%s,%i\n"
608 +#: build/rpmfc.c:1199
610 +msgid "skipping #%i require\n"
611 +msgstr "pominiêto zale¿no¶æ #%i\n"
613 +#: build/rpmfc.c:1205
615 +msgid "skipping %s requirement processing (matches noautoreqdep pattern #%i)\n"
616 +msgstr "pominiêto przetwarzanie zale¿no¶ci %s (pasuje do wzorca noautoreqdep #%i)\n"
618 +#: build/rpmfc.c:1211
620 +msgid "skipping #%i require (is file requirement)\n"
621 +msgstr "pominiêto zale¿no¶æ #%i (zale¿no¶æ od pliku)\n"
623 +#: build/rpmfc.c:1216
625 +msgid "%s -> not found\n"
626 +msgstr "%s -> nie znaleziono\n"
628 +#: build/rpmfc.c:1219
630 +msgid "Iterator: %p\n"
631 +msgstr "Iterator: %p\n"
633 +#: build/rpmfc.c:1221
635 +msgid "%s -> multiple (skipping)\n"
636 +msgstr "%s -> wiele (pominiêto)\n"
638 +#: build/rpmfc.c:1230
640 +msgid "%s -> %s (skipping)\n"
641 +msgstr "%s -> %s (pominiêto)\n"
643 +#: build/rpmfc.c:1295
645 +msgid "skipping %s provides detection (matches noautoprovfiles pattern #%i)\n"
646 +msgstr "pominiêto wykrywanie w³asno¶ci %s (pasuje do wzorca noautoprovfiles #%i)\n"
648 +#: build/rpmfc.c:1306
650 +msgid "skipping %s requires detection (matches noautoreqfiles pattern #%i)\n"
651 +msgstr "pominiêto wykrywanie w³asno¶ci %s (pasuje do wzorca noautoreqfiles #%i)\n"
653 +#: build/rpmfc.c:1642
655 +msgid "Finding %s: %s\n"
656 +msgstr "Poszukiwanie %s: %s\n"
658 +#: build/rpmfc.c:1648 build/rpmfc.c:1657
660 +msgid "Failed to find %s:\n"
661 +msgstr "Nie uda³o siê odnale¼æ %s:\n"
665 msgid "line %d: Bad number: %s\n"
666 --- rpm/configure.ac.orig 2004-08-22 13:02:30.000000000 +0200
667 +++ rpm/configure.ac 2004-08-22 13:25:37.000000000 +0200
669 AC_SUBST(__CHGRP_RHF)
672 +dnl enable generating autorequires containing packages names
674 +AC_ARG_ENABLE([adding-packages-names-in-autogenerated-dependancies],
675 + [ --enable-adding-packages-names-in-autogenerated-dependancies Add packages names for autogenerated dependancies to requires],
677 + AC_MSG_RESULT([Using packages names in autogerated requires is enabled])
678 + AC_DEFINE(AUTODEP_PKGNAMES, 1, "Generating autorequires containing packages names.")
684 dnl figure out what root's primary group is
686 AC_MSG_CHECKING(root's primary group)