rpm/rpm-5.4.10-dont-try-generate-rpmfc-dependencies-from-doc-files.patch
2013-03-27 12:51:15 +04:00

51 lines
1.9 KiB
Diff

--- rpm-5.4.10/lib/rpmfc.c.skip_doc~ 2012-07-28 17:19:43.136069278 +0200
+++ rpm-5.4.10/lib/rpmfc.c 2012-07-28 17:25:16.778898168 +0200
@@ -818,7 +818,17 @@ static int rpmfcSCRIPT(rpmfc fc)
int i;
int is_executable;
int xx;
- const char * defaultdocdir = NULL;
+
+ /* Don't generate dependencies from files shipped as documentation */
+ if (!rpmExpandNumeric("%{_generate_dependencies_from_docdir}")) {
+ const char * defaultdocdir = rpmExpand("%{?_defaultdocdir}", NULL);
+ if (defaultdocdir == NULL || *defaultdocdir == '\0')
+ defaultdocdir = strdup("/usr/share/doc");
+ xx = !strncmp(fn+fc->brlen, defaultdocdir, strlen(defaultdocdir));
+ defaultdocdir = _free(defaultdocdir) ;
+ if (xx)
+ return 0;
+ }
/* Extract dependencies only from files with executable bit set. */
{ struct stat sb, * st = &sb;
@@ -904,16 +914,10 @@ static int rpmfcSCRIPT(rpmfc fc)
(void) fclose(fp);
if (fc->fcolor->vals[fc->ix] & RPMFC_PERL) {
- defaultdocdir = rpmExpand("%{?_defaultdocdir}", NULL);
- if (defaultdocdir == NULL || *defaultdocdir == '\0')
- defaultdocdir = strdup("/usr/share/doc");
-
- if (strncmp(fn, defaultdocdir, strlen(defaultdocdir))) {
- if (fc->fcolor->vals[fc->ix] & RPMFC_MODULE)
- xx = rpmfcHelper(fc, 'P', "perl");
- if (is_executable || (fc->fcolor->vals[fc->ix] & RPMFC_MODULE))
- xx = rpmfcHelper(fc, 'R', "perl");
- }
+ if (fc->fcolor->vals[fc->ix] & RPMFC_MODULE)
+ xx = rpmfcHelper(fc, 'P', "perl");
+ if (is_executable || (fc->fcolor->vals[fc->ix] & RPMFC_MODULE))
+ xx = rpmfcHelper(fc, 'R', "perl");
} else
if (fc->fcolor->vals[fc->ix] & RPMFC_PYTHON) {
xx = rpmfcHelper(fc, 'P', "python");
@@ -1009,8 +1013,6 @@ static int rpmfcSCRIPT(rpmfc fc)
#endif
}
-/*@-observertrans@*/
- defaultdocdir = _free(defaultdocdir) ;
/*@=observertrans@*/
return 0;
}