]> git.pld-linux.org Git - packages/rpm.git/blob - rpm-5.4.10-dont-try-generate-rpmfc-dependencies-from-doc-files.patch
gcc6 fix
[packages/rpm.git] / rpm-5.4.10-dont-try-generate-rpmfc-dependencies-from-doc-files.patch
1 --- rpm-5.4.10/lib/rpmfc.c.skip_doc~    2012-07-28 17:19:43.136069278 +0200
2 +++ rpm-5.4.10/lib/rpmfc.c      2012-07-28 17:25:16.778898168 +0200
3 @@ -818,7 +818,17 @@ static int rpmfcSCRIPT(rpmfc fc)
4      int i;
5      int is_executable;
6      int xx;
7 -    const char * defaultdocdir = NULL;
8 +
9 +    /* Don't generate dependencies from files shipped as documentation */
10 +    if (!rpmExpandNumeric("%{_generate_dependencies_from_docdir}")) {
11 +       const char * defaultdocdir = rpmExpand("%{?_defaultdocdir}", NULL);
12 +       if (defaultdocdir == NULL || *defaultdocdir == '\0')
13 +           defaultdocdir = strdup("/usr/share/doc");
14 +       xx = !strncmp(fn+fc->brlen, defaultdocdir, strlen(defaultdocdir));
15 +       defaultdocdir = _free(defaultdocdir) ;
16 +       if (xx)
17 +           return 0;
18 +    }
19  
20      /* Extract dependencies only from files with executable bit set. */
21      {  struct stat sb, * st = &sb;
22 @@ -904,20 +914,10 @@ static int rpmfcSCRIPT(rpmfc fc)
23      (void) fclose(fp);
24  
25      if (fc->fcolor->vals[fc->ix] & RPMFC_PERL) {
26 -       defaultdocdir = rpmExpand("%{?_defaultdocdir}", NULL);
27 -       /* XXX coverity #1035723 */
28 -       /* XXX coverity #1035883 */
29 -       if (defaultdocdir == NULL || *defaultdocdir == '\0')  {
30 -            defaultdocdir = _free(defaultdocdir);
31 -            defaultdocdir = xstrdup("/usr/share/doc");
32 -       }
33 -
34 -       if (strncmp(fn, defaultdocdir, strlen(defaultdocdir))) {
35 -           if (fc->fcolor->vals[fc->ix] & RPMFC_MODULE)
36 -               xx = rpmfcHelper(fc, 'P', "perl");
37 -           if (is_executable || (fc->fcolor->vals[fc->ix] & RPMFC_MODULE))
38 -               xx = rpmfcHelper(fc, 'R', "perl");
39 -       }
40 +       if (fc->fcolor->vals[fc->ix] & RPMFC_MODULE)
41 +           xx = rpmfcHelper(fc, 'P', "perl");
42 +       if (is_executable || (fc->fcolor->vals[fc->ix] & RPMFC_MODULE))
43 +           xx = rpmfcHelper(fc, 'R', "perl");
44      } else
45      if (fc->fcolor->vals[fc->ix] & RPMFC_PYTHON) {
46         xx = rpmfcHelper(fc, 'P', "python");
47 @@ -1009,8 +1013,6 @@ static int rpmfcSCRIPT(rpmfc fc)
48  #endif
49      }
50  
51 -/*@-observertrans@*/
52 -    defaultdocdir = _free(defaultdocdir) ;
53  /*@=observertrans@*/
54      return 0;
55  }
This page took 0.028776 seconds and 3 git commands to generate.