1 --- rpm-4.4.8/lib/rpmfc.h.orig 2005-11-18 23:08:14.231293000 +0100
2 +++ rpm-4.4.8/lib/rpmfc.h 2005-11-18 23:55:16.694214392 +0100
12 StringBuf sb_python;/*!< concatenated list of python colored files. */
13 StringBuf sb_php; /*!< concatenated list of php colored files. */
15 + int findprov, findreq;
16 + regex_t *noautoprov;
23 --- rpm-4.5/lib/rpmfc.c~ 2008-06-10 14:06:23.000000000 +0300
24 +++ rpm-4.5/lib/rpmfc.c 2008-06-10 14:21:53.097663262 +0300
26 #define _RPMDS_INTERNAL
38 +static regex_t * rpmfcExpandRegexps(const char * str,int *count){
41 + ARGV_t patterns=NULL;
42 + regex_t *compiled=NULL;
44 + s=rpmExpand(str,NULL);
46 + poptParseArgvString(s,count,(const char ***)&patterns);
49 + if (patterns==NULL){
58 + compiled=malloc(sizeof(regex_t)*(*count));
60 + for(i=0;i<*count;i++){
61 + r=regcomp(&compiled[j],patterns[i],REG_NOSUB);
64 + rpmMessage(RPMMESS_NORMAL,
65 + _("Compilation of regular expresion '%s'"
66 + " (expanded from '%s') failed. Skipping it.\n"),
70 + patterns=_free(patterns);
72 + compiled=_free(compiled);
80 +static int rpmfcMatchRegexps(regex_t *regexps, int count, const char *str, char deptype)
83 + for(j = 0; j < count; j++) {
84 + rpmMessage(RPMMESS_DEBUG,
85 + _("Checking %c: '%s' against _noauto expr. #%i\n"), deptype, str, j);
86 + if (!regexec(®exps[j], str, 0, NULL, 0)) {
87 + rpmMessage(RPMMESS_NORMAL,
88 + _("Skipping %c: '%s' as it matches _noauto expr. #%i\n"), deptype, str, j);
95 +static regex_t * rpmfcFreeRegexps(regex_t *regexps,int count){
99 + for(i=0;i<count;i++)
100 + regfree(®exps[i]);
101 + return _free(regexps);
105 * Run per-interpreter dependency helper.
106 * @param fc file classifier
107 * @param deptype 'P' == Provides:, 'R' == Requires:, helper
108 * @param nsdep class name for interpreter (e.g. "perl")
109 + * @param noauto _noauto* regexps
110 + * @param noauto_c # of _noauto* regexps
111 * @return 0 on success
113 -static int rpmfcHelper(rpmfc fc, unsigned char deptype, const char * nsdep)
114 +static int rpmfcHelper(rpmfc fc, unsigned char deptype, const char * nsdep,
115 + regex_t * noauto, int noauto_c)
116 /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
117 /*@modifies fc, rpmGlobalMacroContext, fileSystem, internalState @*/
123 + if(rpmfcMatchRegexps(noauto, noauto_c, N, deptype))
126 /* Add tracking dependency for versioned Provides: */
127 if (!fc->tracked && deptype == 'P' && *EVR != '\0') {
132 - if (is_executable) {
133 + if (is_executable && fc->findreq && !rpmfcMatchRegexps(fc->noautoreq, fc->noautoreq_c, s, 'R')) {
134 /* Add to package requires. */
135 ds = rpmdsSingle(RPMTAG_REQUIRENAME, s, "", RPMSENSE_FIND_REQUIRES);
136 xx = rpmdsMerge(&fc->requires, ds);
137 @@ -808,20 +889,26 @@
140 case RPMTAG_PROVIDENAME:
141 + if (fc->findprov && !rpmfcMatchRegexps(fc->noautoprov, fc->noautoprov_c, ds->N[0], 'P')) {
142 /* Add to package provides. */
143 rc = rpmdsMerge(&fc->provides, ds);
145 /* Add to file dependencies. */
147 rc = rpmfcSaveArg(&fc->ddict, rpmfcFileDep(buf, fc->ix, ds));
151 case RPMTAG_REQUIRENAME:
152 + if (fc->findreq && !rpmfcMatchRegexps(fc->noautoreq, fc->noautoreq_c, ds->N[0], 'R')) {
153 /* Add to package requires. */
154 rc = rpmdsMerge(&fc->requires, ds);
156 /* Add to file dependencies. */
158 rc = rpmfcSaveArg(&fc->ddict, rpmfcFileDep(buf, fc->ix, ds));
164 @@ -862,6 +949,109 @@
168 +static int rpmfcFindRequiredPackages(rpmfc fc)
177 + unsigned char deptype;
185 + const char * hname;
186 + rpmdbMatchIterator it;
188 + regex_t *noautoreqdep;
189 + int noautoreqdep_c;
191 + noautoreqdep=rpmfcExpandRegexps("%{__noautoreqdep}", &noautoreqdep_c);
193 + ts = rpmtsCreate(); /* XXX ts created in main() should be used */
195 + rpmMessage(RPMMESS_NORMAL, _("Searching for required packages....\n"));
197 + nddict = argvCount(fc->ddict);
199 + for (i = 0; i < nddict; i++) {
202 + /* Parse out (file#,deptype,N,EVR,Flags) */
203 + ix = strtol(s, &se, 10);
204 + assert(se != NULL);
208 + while (*se && *se != ' ')
212 + while (*se && *se != ' ')
215 + Flags = strtol(se, NULL, 16);
217 + if (deptype!='R') continue;
219 + rpmMessage(RPMMESS_DEBUG, _("#%i requires: %s,%s,%i\n"),ix,N,EVR,Flags);
220 + if (EVR && EVR[0]) {
221 + rpmMessage(RPMMESS_DEBUG, _("skipping #%i require\n"));
224 + for(j=0;j<noautoreqdep_c;j++)
225 + if (!regexec(&noautoreqdep[j],N,0,NULL,0)) {
226 + rpmMessage(RPMMESS_NORMAL,
227 + _("skipping %s requirement processing"
228 + " (matches noautoreqdep pattern #%i)\n"),N,j);
231 + if (j<noautoreqdep_c) continue;
233 + rpmMessage(RPMMESS_DEBUG, _("skipping #%i require (is file requirement)\n"));
236 + it=rpmtsInitIterator(ts, RPMTAG_PROVIDENAME, N, 0);
238 + rpmMessage(RPMMESS_DEBUG, _("%s -> not found\n"),N);
241 + rpmMessage(RPMMESS_DEBUG, _("Iterator: %p\n"),it);
242 + if (rpmdbGetIteratorCount(it)>1) {
243 + rpmMessage(RPMMESS_DEBUG, _("%s -> multiple (skipping)\n"),N);
244 + rpmdbFreeIterator(it);
247 + hdr=rpmdbNextIterator(it);
249 + r=headerGetEntry(hdr,RPMTAG_NAME,NULL,(void **)&hname, NULL);
251 + if (!strcmp(hname,N)) {
252 + rpmMessage(RPMMESS_DEBUG, _("%s -> %s (skipping)\n"),N,hname);
253 + rpmdbFreeIterator(it);
257 + rpmMessage(RPMMESS_DEBUG, "%s -> %s\n",N,hname);
259 + ds = rpmdsSingle(RPMTAG_REQUIRENAME, hname, "", RPMSENSE_FIND_REQUIRES);
260 + xx = rpmdsMerge(&fc->requires, ds);
261 + ds = rpmdsFree(ds);
263 + rpmdbFreeIterator(it);
266 + noautoreqdep = rpmfcFreeRegexps(noautoreqdep, noautoreqdep_c);
267 + ts = rpmtsFree(ts);
271 int rpmfcApply(rpmfc fc)
274 @@ -880,6 +1070,26 @@
279 + regex_t *noautoprovfiles = NULL;
280 + int noautoprovfiles_c;
281 + regex_t *noautoreqfiles = NULL;
282 + int noautoreqfiles_c;
283 + const char *buildroot;
286 + fc->noautoprov = NULL;
287 + fc->noautoreq = NULL;
289 + buildroot = rpmExpand("%{buildroot}",NULL);
290 + buildroot_l = strlen(buildroot);
292 + noautoprovfiles = rpmfcExpandRegexps("%{__noautoprovfiles}", &noautoprovfiles_c);
293 + noautoreqfiles = rpmfcExpandRegexps("%{__noautoreqfiles}", &noautoreqfiles_c);
294 + fc->noautoprov = rpmfcExpandRegexps("%{__noautoprov}", &fc->noautoprov_c);
295 + fc->noautoreq = rpmfcExpandRegexps("%{__noautoreq}", &fc->noautoreq_c);
296 + rpmMessage(RPMMESS_DEBUG, _("%i _noautoprov patterns.\n"), fc->noautoprov_c);
297 + rpmMessage(RPMMESS_DEBUG, _("%i _noautoreq patterns.\n"), fc->noautoreq_c);
299 /* Generate package and per-file dependencies. */
300 for (fc->ix = 0; fc->fn[fc->ix] != NULL; fc->ix++) {
301 @@ -900,9 +1110,43 @@
302 for (fcat = rpmfcApplyTable; fcat->func != NULL; fcat++) {
303 if (!(fc->fcolor->vals[fc->ix] & fcat->colormask))
304 /*@innercontinue@*/ continue;
307 + if (strncmp(fc->fn[fc->ix],buildroot,buildroot_l)==0) {/* sanity check */
308 + for(j = 0; j < noautoprovfiles_c; j++) {
309 + if (!regexec(&noautoprovfiles[j],
310 + fc->fn[fc->ix] + buildroot_l, 0, NULL, 0)) {
311 + rpmMessage(RPMMESS_NORMAL,
312 + _("skipping %s provides detection"
313 + " (matches noautoprovfiles pattern #%i)\n"),
314 + fc->fn[fc->ix], j);
319 + for(j = 0; j < noautoreqfiles_c; j++) {
320 + if (!regexec(&noautoreqfiles[j],
321 + fc->fn[fc->ix] + buildroot_l, 0, NULL, 0)) {
322 + rpmMessage(RPMMESS_NORMAL,
323 + _("skipping %s requires detection"
324 + " (matches noautoreqfiles pattern #%i)\n"),
325 + fc->fn[fc->ix], j);
332 xx = (*fcat->func) (fc);
335 + noautoprovfiles = rpmfcFreeRegexps(noautoprovfiles, noautoprovfiles_c);
336 + noautoreqfiles = rpmfcFreeRegexps(noautoreqfiles, noautoreqfiles_c);
337 + fc->noautoprov = rpmfcFreeRegexps(fc->noautoprov, fc->noautoprov_c);
338 + fc->noautoreq = rpmfcFreeRegexps(fc->noautoreq, fc->noautoreq_c);
339 +#ifdef AUTODEP_PKGNAMES /* define to use package names in R */
340 + rpmfcFindRequiredPackages(fc);
344 /* Generate per-file indices into package dependencies. */
345 #--- rpm-4.4.9/po/pl.po.orig 2007-05-22 08:11:40.947724921 +0200
346 #+++ rpm-4.4.9/po/pl.po 2007-05-22 08:24:24.091213990 +0200
347 #@@ -2937,6 +2937,86 @@
348 # msgid "Failed to find %s:\n"
349 # msgstr "Nie uda³o siê odnale¼æ %s:\n"
353 #+msgid "Compilation of regular expresion '%s' (expanded from '%s') failed. Skipping it.\n"
354 #+msgstr "Kompilacja wyra¿enia regularnego '%s' (powsta³ego z '%s') nie powiod³a siê; pominiêto.\n"
358 #+msgid "%i _noautoprov patterns.\n"
359 #+msgstr "%i wzorców _noautoprov.\n"
363 #+msgid "%i _noautoreq patterns.\n"
364 #+msgstr "%i wzorców _noautoreq.\n"
368 #+msgid "Checking %c: '%s' against _noauto expr. #%i\n"
369 #+msgstr "Sprawdzanie %c: '%s' z wyra¿eniem _noauto #%i\n"
373 #+msgid "Skipping %c: '%s' as it matches _noauto expr. #%i\n"
374 #+msgstr "Pominiêto %c: '%s' pasuj±ce do wyra¿enia _noauto #%i\n"
376 #+#. XXX ts created in main() should be used
377 #+#: lib/rpmfc.c:1173
378 #+msgid "Searching for required packages....\n"
379 #+msgstr "Poszukiwanie wymaganych pakietów...\n"
381 #+#: lib/rpmfc.c:1197
383 #+msgid "#%i requires: %s,%s,%i\n"
384 #+msgstr "#%i wymaga: %s,%s,%i\n"
386 #+#: lib/rpmfc.c:1199
388 #+msgid "skipping #%i require\n"
389 #+msgstr "pominiêto zale¿no¶æ #%i\n"
391 #+#: lib/rpmfc.c:1205
393 #+msgid "skipping %s requirement processing (matches noautoreqdep pattern #%i)\n"
394 #+msgstr "pominiêto przetwarzanie zale¿no¶ci %s (pasuje do wzorca noautoreqdep #%i)\n"
396 #+#: lib/rpmfc.c:1211
398 #+msgid "skipping #%i require (is file requirement)\n"
399 #+msgstr "pominiêto zale¿no¶æ #%i (zale¿no¶æ od pliku)\n"
401 #+#: lib/rpmfc.c:1216
403 #+msgid "%s -> not found\n"
404 #+msgstr "%s -> nie znaleziono\n"
406 #+#: lib/rpmfc.c:1219
408 #+msgid "Iterator: %p\n"
409 #+msgstr "Iterator: %p\n"
411 #+#: lib/rpmfc.c:1221
413 #+msgid "%s -> multiple (skipping)\n"
414 #+msgstr "%s -> wiele (pominiêto)\n"
416 #+#: lib/rpmfc.c:1230
418 #+msgid "%s -> %s (skipping)\n"
419 #+msgstr "%s -> %s (pominiêto)\n"
421 #+#: lib/rpmfc.c:1295
423 #+msgid "skipping %s provides detection (matches noautoprovfiles pattern #%i)\n"
424 #+msgstr "pominiêto wykrywanie w³asno¶ci %s (pasuje do wzorca noautoprovfiles #%i)\n"
426 #+#: lib/rpmfc.c:1306
428 #+msgid "skipping %s requires detection (matches noautoreqfiles pattern #%i)\n"
429 #+msgstr "pominiêto wykrywanie w³asno¶ci %s (pasuje do wzorca noautoreqfiles #%i)\n"
433 --- rpm/configure.ac.orig 2004-08-22 13:02:30.000000000 +0200
434 +++ rpm/configure.ac 2004-08-22 13:25:37.000000000 +0200
436 AC_SUBST(__CHGRP_RHF)
439 +dnl enable generating autorequires containing packages names
441 +AC_ARG_ENABLE([adding-packages-names-in-autogenerated-dependancies],
442 + [ --enable-adding-packages-names-in-autogenerated-dependancies Add packages names for autogenerated dependancies to requires],
444 + AC_MSG_RESULT([Using packages names in autogerated requires is enabled])
445 + AC_DEFINE(AUTODEP_PKGNAMES, 1, "Generating autorequires containing packages names.")
451 dnl figure out what root's primary group is
453 AC_MSG_CHECKING(root's primary group)
454 --- rpm-4.5/lib/rpmfc.c~ 2008-06-11 01:02:40.000000000 +0300
455 +++ rpm-4.5/lib/rpmfc.c 2008-06-11 01:04:54.048916180 +0300
457 * @param fc file classifier
458 * @param deptype 'P' == Provides:, 'R' == Requires:, helper
459 * @param nsdep class name for interpreter (e.g. "perl")
460 - * @param noauto _noauto* regexps
461 - * @param noauto_c # of _noauto* regexps
462 * @return 0 on success
464 -static int rpmfcHelper(rpmfc fc, unsigned char deptype, const char * nsdep,
465 - regex_t * noauto, int noauto_c)
466 +static int rpmfcHelper(rpmfc fc, unsigned char deptype, const char * nsdep)
467 /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
468 /*@modifies fc, rpmGlobalMacroContext, fileSystem, internalState @*/
474 + regex_t * noauto = fc->noauto;
475 + int noauto_c = fc->noauto_c;
479 --- rpm-4.5/lib/rpmfc.c~ 2008-06-11 01:04:54.000000000 +0300
480 +++ rpm-4.5/lib/rpmfc.c 2008-06-11 01:10:06.222936657 +0300
483 /*@notreached@*/ break;
486 + if (fc->skipProv || !fc->findprov)
488 xx = snprintf(buf, sizeof(buf), "%%{?__%s_provides}", nsdep);
489 depsp = &fc->provides;
491 tagN = RPMTAG_PROVIDENAME;
495 + if (fc->skipReq || !fc->findreq)
497 xx = snprintf(buf, sizeof(buf), "%%{?__%s_requires}", nsdep);
498 depsp = &fc->requires;
499 --- rpm-4.5/lib/rpmfc.c~ 2008-06-11 01:11:33.000000000 +0300
500 +++ rpm-4.5/lib/rpmfc.c 2008-06-11 01:16:17.084344647 +0300
505 - regex_t * noauto = fc->noauto;
506 - int noauto_c = fc->noauto_c;
507 + regex_t * noauto = NULL;
514 if (fc->skipProv || !fc->findprov)
516 + noauto = fc->noautoprov;
517 + noauto_c = fc->noautoprov_c;
518 xx = snprintf(buf, sizeof(buf), "%%{?__%s_provides}", nsdep);
519 depsp = &fc->provides;
520 dsContext = RPMSENSE_FIND_PROVIDES;
523 if (fc->skipReq || !fc->findreq)
525 + noauto = fc->noautoreq;
526 + noauto_c = fc->noautoreq_c;
527 xx = snprintf(buf, sizeof(buf), "%%{?__%s_requires}", nsdep);
528 depsp = &fc->requires;
529 dsContext = RPMSENSE_FIND_REQUIRES;
530 #--- rpm-4.5/lib/rpmfc.c~ 2008-06-11 00:28:21.000000000 +0300
531 #+++ rpm-4.5/lib/rpmfc.c 2008-06-11 00:37:51.675282123 +0300
535 # if (fc->fcolor->vals[fc->ix] & RPMFC_PYTHON) {
536 #- xx = rpmfcHelper(fc, 'P', "python");
538 # xx = rpmfcHelper(fc, 'P', "python", fc->noautoprov, fc->noautoprov_c);
540 #--- rpm-4.5/lib/rpmfc.c~ 2008-06-11 00:37:51.000000000 +0300
541 #+++ rpm-4.5/lib/rpmfc.c 2008-06-11 00:39:12.427942547 +0300
543 # xx = rpmfcHelper(fc, 'R', "java", fc->noautoreq, fc->noautoreq_c);
545 # if (fc->fcolor->vals[fc->ix] & RPMFC_DESKTOP_FILE) {
546 #- xx = rpmfcHelper(fc, 'P', "mimetype");
548 #+ xx = rpmfcHelper(fc, 'P', "mimetype", fc->noautoprov, fc->noautoprov_c);
552 --- rpm-4.4.8/lib/rpmfc.c.orig 2007-02-14 07:31:50.000000000 +0100
553 +++ rpm-4.4.8/lib/rpmfc.c 2007-04-08 16:48:00.273560592 +0200
556 if (fc->fcolor->vals[fc->ix] & RPMFC_PHP) {
557 xx = rpmfcHelper(fc, 'P', "php");
559 + /* not only executable, files run by httpd usually are not */
560 xx = rpmfcHelper(fc, 'R', "php");