rpm/rpm-5.4.10-support-ignore-arch-and-os-again.patch

46 lines
1.7 KiB
Diff
Raw Normal View History

--- rpm-5.4.10/lib/depends.c.ignore_arch~ 2012-07-27 21:11:47.463139875 +0200
+++ rpm-5.4.10/lib/depends.c 2012-07-27 21:29:21.811958701 +0200
@@ -587,11 +587,24 @@ int rpmtsAddInstallElement(rpmts ts, Hea
if (nplatpat > 1) {
const char * platform = NULL;
- he->tag = RPMTAG_PLATFORM;
- xx = headerGet(h, he, 0);
- platform = he->p.str;
- if (!xx || platform == NULL)
- platform = rpmExpand(arch, "-unknown-", os, NULL);
+ /*
+ * If ignore arch, we just set the arch in package platform string to
+ * same as on system so that we're sure that it'll match, same goes for
+ * os as well.
+ */
+ if (rpmExpandNumeric("%{__ignore_arch}") || rpmExpandNumeric("%{__ignore_os}")) {
+ platform = rpmExpand(
+ rpmExpandNumeric("%{__ignore_arch}") ? "%{_target_cpu}" : arch,
+ "-unknown-",
+ rpmExpandNumeric("%{__ignore_os}") ? "%{_target_os}" : os,
+ NULL);
+ } else {
+ he->tag = RPMTAG_PLATFORM;
+ xx = headerGet(h, he, 0);
+ platform = he->p.str;
+ if (!xx || platform == NULL)
+ platform = rpmExpand(arch, "-unknown-", os, NULL);
+ }
rc = rpmPlatformScore(platform, platpat, nplatpat);
#if defined(RPM_VENDOR_MANDRIVA)
--- rpm-5.4.10/rpmpopt.in.ignore_arch~ 2012-07-27 21:29:07.687135285 +0200
+++ rpm-5.4.10/rpmpopt.in 2012-07-27 21:29:35.399788829 +0200
@@ -431,6 +431,10 @@ rpm alias --without --define "_without_
rpm alias --arch --qf '%-34{=NAME}\t%{ARCH}\n' \
--POPTdesc=$"list package architecture"
+
+rpm alias --ignorearch --define '__ignore_arch 1'
+rpm alias --ignoreos --define '__ignore_os 1'
+
#==============================================================================
rpmbuild alias --dbpath --define '_dbpath !#:+' \
--POPTdesc=$"use database in DIRECTORY" \