]> git.pld-linux.org Git - packages/rpm.git/blame - rpm-ignore-missing-macro-files.patch
- release 48 (by relup.sh)
[packages/rpm.git] / rpm-ignore-missing-macro-files.patch
CommitLineData
10a92209
JR
1--- rpm-5.4.15/rpmio/macro.c~ 2014-12-07 20:24:53.000000000 +0100
2+++ rpm-5.4.15/rpmio/macro.c 2014-12-07 20:44:45.739944044 +0100
3@@ -2965,7 +2965,17 @@
4 se = rpmMCExpand(mc, s, NULL);
5 rc = rpmGlob(se, &argc, &argv);
6 for(i = 0; i < argc; i++) {
7- rc |= rpmLoadMacroFile(mc, argv[i], nesting - 1);
8+ /* Skip backups, non existing files and %config leftovers. */
9+#define _suffix(_s, _x) \
9668011e
JR
10+ (strlen(_s) >= sizeof(_x) && !strcmp((_s)+strlen(_s)-(sizeof(_x)-1), (_x)))
11+ if (!(_suffix(argv[i], "~")
12+ || _suffix(argv[i], ".rpmnew")
13+ || _suffix(argv[i], ".rpmorig")
14+ || _suffix(argv[i], ".rpmsave"))
10a92209
JR
15+ && !Access(argv[i], R_OK)
16+ )
17+ rc |= rpmLoadMacroFile(mc, argv[i], nesting - 1);
18+#undef _suffix
19 argv[i] = _free(argv[i]);
20 }
21 argv = _free(argv);
22--- rpm-5.4.15/macros/macros.in~ 2014-12-07 21:43:59.000000000 +0100
23+++ rpm-5.4.15/macros/macros.in 2014-12-07 22:07:57.383101292 +0100
24@@ -1019,13 +1019,7 @@
25 %{nil}
26
27 #==============================================================================
28-# XXX Caveat:
29-# XXX With %{load:...} being interpreted immediately -- not lazily --
30-# XXX within a macro init file, a failure to load causes immediate loading
31-# XXX termination silently.
32-# XXX
33-# XXX So the order as well as the existence of the %{load:...} macros below
34-# XXX are critically important.
35+# XXX If a file specified in %{load:...} does not exist, it will be skipped.
36 # XXX
37 # XXX Note also that loaded macro files can NOT recursively load other
38 # XXX macro files; only a top-level (i.e. after --macros, or within a *.spec)
39@@ -1036,11 +1030,8 @@
40 # XXX for configuring RPM itself.
41 # XXX
42 # XXX Simple example(s):
43-# XXX If the file %{_usrlibrpm}/macros.d/selinux doesn't exist,
44-# XXX then %{_usrlibrpm}/macros.rpmbuild will NOT be loaded.
45-# XXX
46 # XXX if the file %{_usrlibrpm}/macros.d/cmake attempts another
47-# XXX %{load:...}, then loading will CEASE at that point in the file.
48+# XXX %{load:...}, then the statement will be IGNORED.
49 #==============================================================================
50 # ---- SELinux configuration macros.
51 %{load:%{_usrlibrpm}/macros.d/selinux}
This page took 0.036194 seconds and 4 git commands to generate.