teknoraver / rpms / rpm

Forked from rpms/rpm 4 months ago
Clone

Blame rpm-4.6.0-rc1-noarch-subpkg.patch

Panu Matilainen b94c24
commit a4825e488d44e01803c377ebc4fc054adcf42b3a
Panu Matilainen b94c24
Author: Panu Matilainen <pmatilai@redhat.com>
Panu Matilainen b94c24
Date:   Thu Oct 23 07:47:25 2008 +0300
Panu Matilainen b94c24
Panu Matilainen b94c24
    Make noarch subpackages actually work
Panu Matilainen b94c24
    - noarch subpackages get their arch tag from parsePreamble() already,
Panu Matilainen b94c24
      don't stomp over it later in parseSpec()
Panu Matilainen b94c24
Panu Matilainen b94c24
diff --git a/build/parseSpec.c b/build/parseSpec.c
Panu Matilainen b94c24
index 098bd2b..11e0622 100644
Panu Matilainen b94c24
--- a/build/parseSpec.c
Panu Matilainen b94c24
+++ b/build/parseSpec.c
Panu Matilainen b94c24
@@ -592,7 +592,10 @@ int parseSpec(rpmts ts, const char *specFile, const char *rootDir,
Panu Matilainen b94c24
 	}
Panu Matilainen b94c24
 
Panu Matilainen b94c24
 	headerPutString(pkg->header, RPMTAG_OS, os);
Panu Matilainen b94c24
-	headerPutString(pkg->header, RPMTAG_ARCH, arch);
Panu Matilainen b94c24
+	/* noarch subpackages already have arch set here, leave it alone */
Panu Matilainen b94c24
+	if (!headerIsEntry(pkg->header, RPMTAG_ARCH)) {
Panu Matilainen b94c24
+	    headerPutString(pkg->header, RPMTAG_ARCH, arch);
Panu Matilainen b94c24
+	}
Panu Matilainen b94c24
 	headerPutString(pkg->header, RPMTAG_PLATFORM, platform);
Panu Matilainen b94c24
 
Panu Matilainen b94c24
 	pkg->ds = rpmdsThis(pkg->header, RPMTAG_REQUIRENAME, RPMSENSE_EQUAL);