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
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) \
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"))
15 + && !Access(argv[i], R_OK)
17 + rc |= rpmLoadMacroFile(mc, argv[i], nesting - 1);
19 argv[i] = _free(argv[i]);
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 @@
27 #==============================================================================
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.
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.
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.
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.
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}