From 34d956065f0c0d514e79127eeb1d7eee5a7ad2fcbaceac0bbdbcd11cb4e567de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Schr=C3=B6der?= Date: Tue, 16 Apr 2019 11:19:24 +0000 Subject: [PATCH] Accepting request 694739 from home:hellcp:rust - Backport rpmfc-push-name-epoch-version-release-macro-before-invoking-depgens.patch for correct generation of dependencies by other dep generators OBS-URL: https://build.opensuse.org/request/show/694739 OBS-URL: https://build.opensuse.org/package/show/Base:System/rpm?expand=0&rev=494 --- rpm.changes | 6 ++ rpm.spec | 3 +- ...elease-macro-before-invoking-depgens.patch | 58 +++++++++++++++++++ 3 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 rpmfc-push-name-epoch-version-release-macro-before-invoking-depgens.patch diff --git a/rpm.changes b/rpm.changes index 49d7bf8..b68804b 100644 --- a/rpm.changes +++ b/rpm.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Apr 16 08:40:11 UTC 2019 - Stasiek Michalski + +- Backport rpmfc-push-name-epoch-version-release-macro-before-invoking-depgens.patch + for correct generation of dependencies by other dep generators + ------------------------------------------------------------------- Thu Feb 7 15:42:17 CET 2019 - mls@suse.de diff --git a/rpm.spec b/rpm.spec index 2790d13..30245e2 100644 --- a/rpm.spec +++ b/rpm.spec @@ -128,6 +128,7 @@ Patch114: source_date_epoch_buildtime.diff Patch117: findsupplements.diff Patch118: dwz-compression.patch Patch119: getncpus.diff +Patch120: rpmfc-push-name-epoch-version-release-macro-before-invoking-depgens.patch Patch6464: auto-config-update-aarch64-ppc64le.diff Patch6465: auto-config-update-riscv64.diff BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -226,7 +227,7 @@ rm -f rpmdb/db.h %patch -P 93 -P 94 -P 99 %patch -P 100 -P 102 -P 103 -P 108 %patch -P 109 -P 114 -P 117 -P 118 -%patch -P 119 +%patch -P 119 -P 120 %ifarch aarch64 ppc64le riscv64 %patch6464 diff --git a/rpmfc-push-name-epoch-version-release-macro-before-invoking-depgens.patch b/rpmfc-push-name-epoch-version-release-macro-before-invoking-depgens.patch new file mode 100644 index 0000000..6f723d4 --- /dev/null +++ b/rpmfc-push-name-epoch-version-release-macro-before-invoking-depgens.patch @@ -0,0 +1,58 @@ +From 0d2176c9a3ae44fd0a67c9983b1a5ba0a00388fd Mon Sep 17 00:00:00 2001 +From: Igor Gnatenko +Date: Mon, 15 Oct 2018 19:49:57 +0200 +Subject: [PATCH] rpmfc: push name/epoch/version/release macro before invoking + depgens + +Fixes: https://github.com/rpm-software-management/rpm/issues/502 +Signed-off-by: Igor Gnatenko +--- + build/rpmfc.c | 25 +++++++++++++++++++++++++ + 1 file changed, 25 insertions(+) + +diff --git build/rpmfc.c build/rpmfc.c +index 2fbfc69ab..eccd6582a 100644 +--- build/rpmfc.c ++++ build/rpmfc.c +@@ -1334,9 +1334,31 @@ static rpmRC rpmfcApplyExternal(rpmfc fc) + return rc; + } + ++typedef const struct macroExport_s { ++ const char * name; ++ rpmTagVal tag; ++} * macroExport; ++ ++static struct macroExport_s const macroExportList[] = { ++ { "name", RPMTAG_NAME }, ++ { "epoch", RPMTAG_EPOCH }, ++ { "version", RPMTAG_VERSION }, ++ { "release", RPMTAG_RELEASE }, ++ { NULL, 0 } ++}; ++ + rpmRC rpmfcApply(rpmfc fc) + { + rpmRC rc; ++ Package pkg = fc->pkg; ++ macroExport me; ++ for (me = macroExportList; me->name; me++) { ++ char *val = headerGetAsString(pkg->header, me->tag); ++ if (val) { ++ rpmPushMacro(NULL, me->name, NULL, val, RMIL_SPEC); ++ free(val); ++ } ++ } + /* If new-fangled dependency generation is disabled ... */ + if (!rpmExpandNumeric("%{?_use_internal_dependency_generator}")) { + /* ... then generate dependencies using %{__find_requires} et al. */ +@@ -1347,6 +1369,9 @@ rpmRC rpmfcApply(rpmfc fc) + /* ... otherwise generate per-file dependencies */ + rc = rpmfcApplyInternal(fc); + } ++ for (me = macroExportList; me->name; me++) ++ if (headerIsEntry(pkg->header, me->tag)) ++ rpmPopMacro(NULL, me->name); + return rc; + } +