]> git.pld-linux.org Git - packages/rpm.git/commitdiff
- ignore non-existing files and backups specified in %{load:...}
authorJan Rękorajski <baggins@pld-linux.org>
Sun, 7 Dec 2014 21:10:58 +0000 (22:10 +0100)
committerJan Rękorajski <baggins@pld-linux.org>
Sun, 7 Dec 2014 21:10:58 +0000 (22:10 +0100)
  statement in macro files
- rel 4

rpm-ignore-missing-macro-files.patch [new file with mode: 0644]
rpm.spec

diff --git a/rpm-ignore-missing-macro-files.patch b/rpm-ignore-missing-macro-files.patch
new file mode 100644 (file)
index 0000000..43c48e4
--- /dev/null
@@ -0,0 +1,51 @@
+--- rpm-5.4.15/rpmio/macro.c~  2014-12-07 20:24:53.000000000 +0100
++++ rpm-5.4.15/rpmio/macro.c   2014-12-07 20:44:45.739944044 +0100
+@@ -2965,7 +2965,17 @@
+           se = rpmMCExpand(mc, s, NULL);
+           rc = rpmGlob(se, &argc, &argv);
+           for(i = 0; i < argc; i++) {
+-              rc |= rpmLoadMacroFile(mc, argv[i], nesting - 1);
++              /* Skip backups, non existing files and %config leftovers. */
++#define       _suffix(_s, _x) \
++    (slen >= sizeof(_x) && !strcmp((_s)+slen-(sizeof(_x)-1), (_x)))
++              if (!(_suffix(fn, "~")
++                 || _suffix(fn, ".rpmnew")
++                 || _suffix(fn, ".rpmorig")
++                 || _suffix(fn, ".rpmsave"))
++                 && !Access(argv[i], R_OK)
++                 )
++                  rc |= rpmLoadMacroFile(mc, argv[i], nesting - 1);
++#undef _suffix
+               argv[i] = _free(argv[i]);
+           }
+           argv = _free(argv);
+--- rpm-5.4.15/macros/macros.in~       2014-12-07 21:43:59.000000000 +0100
++++ rpm-5.4.15/macros/macros.in        2014-12-07 22:07:57.383101292 +0100
+@@ -1019,13 +1019,7 @@
+ %{nil}
+ #==============================================================================
+-# XXX Caveat:
+-# XXX With %{load:...} being interpreted immediately -- not lazily --
+-# XXX within a macro init file, a failure to load causes immediate loading
+-# XXX termination silently.
+-# XXX
+-# XXX So the order as well as the existence of the %{load:...} macros below
+-# XXX are critically important.
++# XXX If a file specified in %{load:...} does not exist, it will be skipped.
+ # XXX
+ # XXX Note also that loaded macro files can NOT recursively load other
+ # XXX macro files; only a top-level (i.e. after --macros, or within a *.spec)
+@@ -1036,11 +1030,8 @@
+ # XXX for configuring RPM itself.
+ # XXX
+ # XXX Simple example(s):
+-# XXX If the file %{_usrlibrpm}/macros.d/selinux doesn't exist,
+-# XXX then %{_usrlibrpm}/macros.rpmbuild will NOT be loaded.
+-# XXX
+ # XXX if the file %{_usrlibrpm}/macros.d/cmake attempts another
+-# XXX %{load:...}, then loading will CEASE at that point in the file.
++# XXX %{load:...}, then the statement will be IGNORED.
+ #==============================================================================
+ # ---- SELinux configuration macros.
+ %{load:%{_usrlibrpm}/macros.d/selinux}
index 18354ee94ad69a06718762de593de789453edc2a..530644dc5f6a8a44ce0b9098a8ddf9aa36771b3c 100644 (file)
--- a/rpm.spec
+++ b/rpm.spec
@@ -51,7 +51,7 @@ Summary(ru.UTF-8):    Менеджер пакетов от RPM
 Summary(uk.UTF-8):     Менеджер пакетів від RPM
 Name:          rpm
 Version:       5.4.15
-Release:       3
+Release:       4
 License:       LGPL v2.1
 Group:         Base
 # http://rpm5.org/files/rpm/rpm-5.4/rpm-5.4.15-0.20140824.src.rpm
@@ -168,6 +168,7 @@ Patch79:    %{name}-rpmspec.patch
 Patch80:       %{name}-revert-gpg-argv-parsing.patch
 Patch81:       %{name}-perl-magic.patch
 Patch82:       %{name}-5.4.15-use-DSA-sig.patch
+Patch83:       %{name}-ignore-missing-macro-files.patch
 
 # Patches imported from Mandriva
 
@@ -971,6 +972,8 @@ Dokumentacja API RPM-a oraz przewodniki w formacie HTML generowane ze
 %patch1046 -p1
 %patch1047 -p1
 
+%patch83 -p1
+
 install %{SOURCE2} macros/pld.in
 install %{SOURCE8} scripts/php.prov.in
 install %{SOURCE9} scripts/php.req.in
This page took 0.158341 seconds and 4 git commands to generate.