- Macro-expand load macro argument
This commit is contained in:
parent
9787eb5021
commit
7674f0d76b
30
rpm-4.11.90-expand-load-arg.patch
Normal file
30
rpm-4.11.90-expand-load-arg.patch
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
commit d4ab1d82d7888f41b866751d0ef340a82be7cff2
|
||||||
|
Author: Panu Matilainen <pmatilai@redhat.com>
|
||||||
|
Date: Tue Jul 1 12:04:40 2014 +0300
|
||||||
|
|
||||||
|
Macro-expand %{load:...} argument to make the thing more useful...
|
||||||
|
|
||||||
|
diff --git a/rpmio/macro.c b/rpmio/macro.c
|
||||||
|
index b00155c..1d9bd1c 100644
|
||||||
|
--- a/rpmio/macro.c
|
||||||
|
+++ b/rpmio/macro.c
|
||||||
|
@@ -1093,16 +1093,15 @@ expandMacro(MacroBuf mb, const char *src, size_t slen)
|
||||||
|
|
||||||
|
/* Expand builtin macros */
|
||||||
|
if (STREQ("load", f, fn)) {
|
||||||
|
- if (g && gn > 0) {
|
||||||
|
- char arg[gn + 1];
|
||||||
|
- strncpy(arg, g, gn);
|
||||||
|
- arg[gn] = '\0';
|
||||||
|
+ char *arg = NULL;
|
||||||
|
+ if (g && gn > 0 && expandThis(mb, g, gn, &arg) == 0) {
|
||||||
|
/* Print failure iff %{load:...} or %{!?load:...} */
|
||||||
|
if (loadMacroFile(mb->mc, arg) && chkexist == negate) {
|
||||||
|
rpmlog(RPMLOG_ERR,
|
||||||
|
_("failed to load macro file %s"), arg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
+ free(arg);
|
||||||
|
s = se;
|
||||||
|
continue;
|
||||||
|
}
|
3
rpm.spec
3
rpm.spec
@ -49,6 +49,7 @@ Patch4: rpm-4.8.1-use-gpg2.patch
|
|||||||
|
|
||||||
# Patches already upstream:
|
# Patches already upstream:
|
||||||
Patch100: rpm-4.11.90-hardlink-groups.patch
|
Patch100: rpm-4.11.90-hardlink-groups.patch
|
||||||
|
Patch101: rpm-4.11.90-expand-load-arg.patch
|
||||||
|
|
||||||
# These are not yet upstream
|
# These are not yet upstream
|
||||||
Patch302: rpm-4.7.1-geode-i686.patch
|
Patch302: rpm-4.7.1-geode-i686.patch
|
||||||
@ -286,6 +287,7 @@ Requires: rpm-libs%{_isa} = %{version}-%{release}
|
|||||||
%patch4 -p1 -b .use-gpg2
|
%patch4 -p1 -b .use-gpg2
|
||||||
|
|
||||||
%patch100 -p1 -b .hardlink-groups
|
%patch100 -p1 -b .hardlink-groups
|
||||||
|
%patch101 -p1 -b .expand-load-arg
|
||||||
|
|
||||||
%patch302 -p1 -b .geode
|
%patch302 -p1 -b .geode
|
||||||
%patch304 -p1 -b .ldflags
|
%patch304 -p1 -b .ldflags
|
||||||
@ -541,6 +543,7 @@ exit 0
|
|||||||
%changelog
|
%changelog
|
||||||
* Tue Jul 01 2014 Panu Matilainen <pmatilai@redhat.com> - 4.11.90-0.git12844.3
|
* Tue Jul 01 2014 Panu Matilainen <pmatilai@redhat.com> - 4.11.90-0.git12844.3
|
||||||
- Drop no longer needed temporary UsrMove patch
|
- Drop no longer needed temporary UsrMove patch
|
||||||
|
- Macro-expand load macro argument
|
||||||
|
|
||||||
* Mon Jun 30 2014 Panu Matilainen <pmatilai@redhat.com> - 4.11.90-0.git12844.2
|
* Mon Jun 30 2014 Panu Matilainen <pmatilai@redhat.com> - 4.11.90-0.git12844.2
|
||||||
- Fix multiple interleaved hardlink groups during build
|
- Fix multiple interleaved hardlink groups during build
|
||||||
|
Loading…
Reference in New Issue
Block a user