1 --- rpm-4.5/rpmio/macro.c.org 2009-08-08 15:42:25.574860247 +0200
2 +++ rpm-4.5/rpmio/macro.c 2009-08-08 15:47:20.495455961 +0200
8 + * Parse (and execute) macro undefinition.
9 + * @param mc macro context
10 + * @param se macro name to undefine
11 + * @return address to continue parsing
13 +/*@dependent@*/ static const char *
14 +doUnglobal(MacroContext mc, /*@returned@*/ const char * se)
15 + /*@globals rpmGlobalMacroContext @*/
16 + /*@modifies mc, rpmGlobalMacroContext @*/
19 + char *buf = alloca(_macro_BUFSIZ);
20 + char *n = buf, *ne = n;
25 + /* Move scan over body */
30 + /* Names must start with alphabetic or _ and be at least 3 chars */
31 + if (!((c = *n) && (xisalpha(c) || c == '_') && (ne - n) > 2)) {
32 + rpmError(RPMERR_BADSPEC,
33 + _("Macro %%%s has illegal name (%%unglobal)\n"), n);
44 dumpME(const char * msg, MacroEntry me)
45 @@ -1430,6 +1465,10 @@
46 s = doUndefine(mb->mc, se);
49 + if (STREQ("unglobal", f, fn)) {
50 + s = doUnglobal(mb->mc, se);
54 if (STREQ("echo", f, fn) ||
55 STREQ("warn", f, fn) ||
56 @@ -1984,6 +2023,18 @@
61 +delMacroAll(MacroContext mc, const char * n)
65 + if (mc == NULL) mc = rpmGlobalMacroContext;
66 + /* If name exists, pop entry */
67 + while ((mep = findEntry(mc, n, 0)) != NULL) {
72 /*@-mustmod@*/ /* LCL: mc is modified through mb->mc, mb is abstract */
74 rpmDefineMacro(MacroContext mc, const char * macro, int level)