summaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorAles Kozumplik <akozumpl@redhat.com>2012-01-03 16:04:18 +0100
committerAles Kozumplik <akozumpl@redhat.com>2012-03-30 13:55:03 +0200
commitb714dcea37af2e23026a52be76e7317592ecb52e (patch)
treeecb50bc2f9209bbd67f2aa934d4a3cf8faa4e754 /build
parent7c39c65da4b1b012061ffbac179a650643d00ba9 (diff)
downloadlibrpm-tizen-b714dcea37af2e23026a52be76e7317592ecb52e.tar.gz
librpm-tizen-b714dcea37af2e23026a52be76e7317592ecb52e.tar.bz2
librpm-tizen-b714dcea37af2e23026a52be76e7317592ecb52e.zip
rpmbuild: warn if header color differs from color of the package architecture.
- For example, warn when building an x86_64 package that only contains 32 bit binaries. - This should indicate to the maintainers that they might have gotten the architecture wrong. - Introduces 'archcolor' in rpmrc so we can map architectures to colors. - Related: RhBug:713323
Diffstat (limited to 'build')
-rw-r--r--build/files.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/build/files.c b/build/files.c
index d4dc974f1..7778d2275 100644
--- a/build/files.c
+++ b/build/files.c
@@ -2109,6 +2109,8 @@ rpmRC processBinaryFiles(rpmSpec spec, rpmBuildPkgFlags pkgFlags,
for (pkg = spec->packages; pkg != NULL; pkg = pkg->next) {
char *nvr;
const char *a;
+ int header_color;
+ int arch_color;
if (pkg->fileList == NULL)
continue;
@@ -2124,7 +2126,15 @@ rpmRC processBinaryFiles(rpmSpec spec, rpmBuildPkgFlags pkgFlags,
goto exit;
a = headerGetString(pkg->header, RPMTAG_ARCH);
- if (rstreq(a, "noarch") && headerGetNumber(pkg->header, RPMTAG_HEADERCOLOR) != 0) {
+ header_color = headerGetNumber(pkg->header, RPMTAG_HEADERCOLOR);
+ if (!rstreq(a, "noarch")) {
+ arch_color = rpmGetArchColor(a);
+ if (arch_color > 0 && !(arch_color & header_color)) {
+ rpmlog(RPMLOG_WARNING,
+ _("Binaries arch (%d) not matching the package arch (%d).\n"),
+ header_color, arch_color);
+ }
+ } else if (header_color != 0) {
int terminate = rpmExpandNumeric("%{?_binaries_in_noarch_packages_terminate_build}");
rpmlog(terminate ? RPMLOG_ERR : RPMLOG_WARNING,
_("Arch dependent binaries in noarch package\n"));