RPM Package Manager, CVS Repository http://rpm5.org/cvs/ ____________________________________________________________________________
Server: rpm5.org Name: Jeff Johnson Root: /v/rpm/cvs Email: [EMAIL PROTECTED] Module: rpm Date: 18-Jun-2008 18:22:04 Branch: rpm-5_1 Handle: 2008061816220400 Modified files: (Branch: rpm-5_1) rpm CHANGES rpm/rpmio macro.c Log: - permit configurable POSIX behavior for parameterized macros (Marcin Kowalczyk<[EMAIL PROTECTED]>). Summary: Revision Changes Path 1.2288.2.65 +2 -0 rpm/CHANGES 2.193.2.4 +18 -3 rpm/rpmio/macro.c ____________________________________________________________________________ patch -p0 <<'@@ .' Index: rpm/CHANGES ============================================================================ $ cvs diff -u -r1.2288.2.64 -r1.2288.2.65 CHANGES --- rpm/CHANGES 16 Jun 2008 17:48:11 -0000 1.2288.2.64 +++ rpm/CHANGES 18 Jun 2008 16:22:04 -0000 1.2288.2.65 @@ -1,4 +1,6 @@ 5.1.3 -> 5.1.4: + - jbj: permit configurable POSIX behavior for parameterized macros + (Marcin Kowalczyk<[EMAIL PROTECTED]>). - jbj: fix: skip %exclude/%ghost files to get more accurate RPMTAG_SIZE. - jbj: fix: RPMTAG_SIZE is incorrect with %exclude and %ghost directives (Alexey Tourbin<[EMAIL PROTECTED]>). @@ . patch -p0 <<'@@ .' Index: rpm/rpmio/macro.c ============================================================================ $ cvs diff -u -r2.193.2.3 -r2.193.2.4 macro.c --- rpm/rpmio/macro.c 31 May 2008 16:59:03 -0000 2.193.2.3 +++ rpm/rpmio/macro.c 18 Jun 2008 16:22:04 -0000 2.193.2.4 @@ -1001,6 +1001,7 @@ int argc = 0; const char **argv; int c; + unsigned int popt_flags; /* Copy macro name as argv[0], save beginning of args. */ buf[0] = '\0'; @@ -1061,12 +1062,26 @@ /* assert(b == be); */ argv[argc] = NULL; + /* '+' as the first character means that options are recognized + * only before positional arguments, as POSIX requires. + */ + popt_flags = POPT_CONTEXT_NO_EXEC; +#if defined(RPM_VENDOR_OPENPKG) /* XXX maintain compat w 5.0 behavior. */ + popt_flags |= POPT_CONTEXT_POSIXMEHARDER; +#endif + if (me->opts[0] == '+') popt_flags |= POPT_CONTEXT_POSIXMEHARDER; + /* Count the number of short options. */ - for (c = 0, opts = me->opts; *opts != '\0'; opts++) + opts = me->opts; + if (*opts == '+') opts++; + for (c = 0; *opts != '\0'; opts++) if (*opts != ':') c++; + /* Set up popt option table. */ optTbl = xcalloc(sizeof(*optTbl), (c + 1)); - for (c = 0, opts = me->opts; *opts != '\0'; opts++) { + opts = me->opts; + if (*opts == '+') opts++; + for (c = 0; *opts != '\0'; opts++) { if (*opts == ':') continue; optTbl[c].shortName = opts[0]; optTbl[c].val = (int) opts[0]; @@ -1077,7 +1092,7 @@ /* Parse the options, defining option macros. */ /[EMAIL PROTECTED]@*/ - optCon = poptGetContext(argv[0], argc, argv, optTbl, POPT_CONTEXT_NO_EXEC|POPT_CONTEXT_POSIXMEHARDER); + optCon = poptGetContext(argv[0], argc, argv, optTbl, popt_flags); /[EMAIL PROTECTED]@*/ while ((c = poptGetNextOpt(optCon)) > 0) { const char * optArg = poptGetOptArg(optCon); @@ . ______________________________________________________________________ RPM Package Manager http://rpm5.org CVS Sources Repository rpm-cvs@rpm5.org