]>
Commit | Line | Data |
---|---|---|
70f8787d JR |
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,16 +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 | - if (defaultdocdir == NULL || *defaultdocdir == '\0') | |
28 | - defaultdocdir = strdup("/usr/share/doc"); | |
29 | - | |
30 | - if (strncmp(fn, defaultdocdir, strlen(defaultdocdir))) { | |
31 | - if (fc->fcolor->vals[fc->ix] & RPMFC_MODULE) | |
32 | - xx = rpmfcHelper(fc, 'P', "perl"); | |
33 | - if (is_executable || (fc->fcolor->vals[fc->ix] & RPMFC_MODULE)) | |
34 | - xx = rpmfcHelper(fc, 'R', "perl"); | |
35 | - } | |
36 | + if (fc->fcolor->vals[fc->ix] & RPMFC_MODULE) | |
37 | + xx = rpmfcHelper(fc, 'P', "perl"); | |
38 | + if (is_executable || (fc->fcolor->vals[fc->ix] & RPMFC_MODULE)) | |
39 | + xx = rpmfcHelper(fc, 'R', "perl"); | |
40 | } else | |
41 | if (fc->fcolor->vals[fc->ix] & RPMFC_PYTHON) { | |
42 | xx = rpmfcHelper(fc, 'P', "python"); | |
43 | @@ -1009,8 +1013,6 @@ static int rpmfcSCRIPT(rpmfc fc) | |
44 | #endif | |
45 | } | |
46 | ||
47 | -/*@-observertrans@*/ | |
48 | - defaultdocdir = _free(defaultdocdir) ; | |
49 | /*@=observertrans@*/ | |
50 | return 0; | |
51 | } |