summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Schroeder <mls@suse.de>2011-08-02 12:20:35 +0300
committerPanu Matilainen <pmatilai@redhat.com>2011-08-02 12:50:50 +0300
commit53135a99bfd53abb7a37e23c064f4412cae91471 (patch)
tree92825d87f5aa93c9502e6fa4af6df41b360355ab
parent27c56c58209ee7c890f34429e030bfdb39105084 (diff)
downloadrpm-53135a99bfd53abb7a37e23c064f4412cae91471.tar.gz
Restore %defattr() behavior on special %doc
- With the change in the defattr handling (commit 09efbe96), you also need to save the current defattr setting when processing %doc. Otherwise doc files will just get the value from the latest defattr line. (cherry picked from commit fa660524026ecef686bb317cdc937008ae729de4)
-rw-r--r--build/files.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/build/files.c b/build/files.c
index edba92a26..2d3767698 100644
--- a/build/files.c
+++ b/build/files.c
@@ -1720,11 +1720,13 @@ static rpmRC processPackageFiles(rpmSpec spec, rpmBuildPkgFlags pkgFlags,
struct FileList_s fl;
const char *fileName;
char buf[BUFSIZ];
- struct AttrRec_s arbuf;
+ struct AttrRec_s arbuf, def_arbuf;
AttrRec specialDocAttrRec = &arbuf;
+ AttrRec def_specialDocAttrRec = &def_arbuf;
char *specialDoc = NULL;
nullAttrRec(specialDocAttrRec);
+ nullAttrRec(def_specialDocAttrRec);
pkg->cpioList = NULL;
if (pkg->fileFile) {
@@ -1862,6 +1864,7 @@ static rpmRC processPackageFiles(rpmSpec spec, rpmBuildPkgFlags pkgFlags,
specialDoc = _free(specialDoc);
specialDoc = xstrdup(fileName);
dupAttrRec(&fl.cur_ar, specialDocAttrRec);
+ dupAttrRec(&fl.def_ar, def_specialDocAttrRec);
} else if (fl.currentFlags & RPMFILE_PUBKEY) {
(void) processMetadataFile(pkg, &fl, fileName, RPMTAG_PUBKEYS);
} else {
@@ -1902,7 +1905,9 @@ static rpmRC processPackageFiles(rpmSpec spec, rpmBuildPkgFlags pkgFlags,
fl.nLangs = 0;
dupAttrRec(specialDocAttrRec, &fl.cur_ar);
+ dupAttrRec(def_specialDocAttrRec, &fl.def_ar);
freeAttrRec(specialDocAttrRec);
+ freeAttrRec(def_specialDocAttrRec);
(void) processBinaryFile(pkg, &fl, specialDoc);