rpm/rpm-5.4.7-dont-try-generate-rpmfc-dependencies-from-doc-files.patch
2012-08-01 14:59:23 +04:00

49 lines
1.8 KiB
Diff

--- rpm-5.4.7/lib/rpmfc.c.skip_doc~ 2012-03-10 22:02:07.587592446 +0100
+++ rpm-5.4.7/lib/rpmfc.c 2012-03-10 22:08:33.799856086 +0100
@@ -813,7 +813,15 @@ static int rpmfcSCRIPT(rpmfc fc)
int i;
int is_executable;
int xx;
- const char * defaultdocdir = NULL;
+
+ { const char * defaultdocdir = rpmExpand("%{?_defaultdocdir}", NULL);
+ xx = (defaultdocdir == NULL || *defaultdocdir == '\0');
+ defaultdocdir = strdup("/usr/share/doc");
+ xx = !strncmp(fn, xx ? "/usr/share/doc" : defaultdocdir, xx ? sizeof("/usr/share/doc")-1 : strlen(defaultdocdir));
+ defaultdocdir = _free(defaultdocdir) ;
+ if (xx)
+ return 0;
+ }
/* Extract dependencies only from files with executable bit set. */
{ struct stat sb, * st = &sb;
@@ -899,16 +907,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");
@@ -997,8 +999,6 @@ static int rpmfcSCRIPT(rpmfc fc)
#endif
}
-/*@-observertrans@*/
- defaultdocdir = _free(defaultdocdir) ;
/*@=observertrans@*/
return 0;
}