]> git.pld-linux.org Git - packages/rpm.git/blob - rpm-python-sitescriptdir.patch
- make sure that the output buffer gets truncated after use, otherwise
[packages/rpm.git] / rpm-python-sitescriptdir.patch
1 --- rpm-5.4.10/lib/rpmfc.c~     2012-12-01 21:13:39.985319735 +0100
2 +++ rpm-5.4.10/lib/rpmfc.c      2013-01-24 12:21:26.379891972 +0100
3 @@ -1142,7 +1142,7 @@
4      /* Generate package and per-file dependencies. */
5      for (fc->ix = 0; fc->fn[fc->ix] != NULL; fc->ix++) {
6  
7 -       /* XXX Insure that /usr/lib{,64}/python files are marked RPMFC_PYTHON */
8 +       /* XXX Insure that /usr/{share,lib{,64}}/python files are marked RPMFC_PYTHON */
9         /* XXX HACK: classification by path is intrinsically stupid. */
10         {   fn = strstr(fc->fn[fc->ix], "/usr/lib");
11             if (fn) {
12 @@ -1166,6 +1166,22 @@
13                         fc->fcolor->vals[fc->ix] & RPMFC_LIBRARY)
14                     fc->fcolor->vals[fc->ix] |= (RPMFC_MODULE|RPMFC_SCRIPT);
15             }
16 +           fn = strstr(fc->fn[fc->ix], "/usr/share");
17 +           if (fn) {
18 +               fn += sizeof("/usr/share")-1;
19 +               if (!strncmp(fn, "/python", sizeof("/python")-1))
20 +                   fc->fcolor->vals[fc->ix] |= RPMFC_PYTHON;
21 +               else if (!strncmp(fn, "/ruby", sizeof("/ruby")-1)) {
22 +                   fc->fcolor->vals[fc->ix] |= RPMFC_RUBY;
23 +                   if ((strstr(fn, ".gemspec") || strstr(fn, "rbconfig.rb"))) {
24 +                       miRE mire = mireNew(RPMMIRE_REGEX, RPMTAG_FILEPATHS);
25 +                       if (!mireRegcomp(mire, ".*/(specifications/.*\\.gemspec|rbconfig\\.rb)$"))
26 +                           if (mireRegexec(mire, fc->fn[fc->ix], (size_t) 0) >= 0)
27 +                               fc->fcolor->vals[fc->ix] |= RPMFC_MODULE;
28 +                       mire = mireFree(mire);
29 +                   }
30 +               }
31 +           }
32         }
33  
34         /* XXX ugly quick & dirty integration of haskell() dependencies */
This page took 0.025009 seconds and 3 git commands to generate.