OpenPKG CVS Repository http://cvs.openpkg.org/ ____________________________________________________________________________
Server: cvs.openpkg.org Name: Ralf S. Engelschall Root: /e/openpkg/cvs Email: [EMAIL PROTECTED] Module: openpkg-src Date: 23-Aug-2003 22:56:27 Branch: OPENPKG_UPGRADE_RPM42 Handle: 2003082321562600 Modified files: (Branch: OPENPKG_UPGRADE_RPM42) openpkg-src/openpkg rpm.patch.feature rpmpopt Log: the new POPT library allows special "argument eating" markers "!#:+" to be used. With this patch it is also possible to eat multiple arguments. This allows provides new command line possibilities: --with foo ==> --define 'with_foo yes' ==> %option with_foo yes --without foo ==> --define 'with_foo no' ==> %option with_foo no --option with_foo bar ==> --define 'with_foo bar' ==> %option with_foo bar Summary: Revision Changes Path 1.4.2.3 +17 -0 openpkg-src/openpkg/rpm.patch.feature 1.5.8.2 +13 -0 openpkg-src/openpkg/rpmpopt ____________________________________________________________________________ patch -p0 <<'@@ .' Index: openpkg-src/openpkg/rpm.patch.feature ============================================================================ $ cvs diff -u -r1.4.2.2 -r1.4.2.3 rpm.patch.feature --- openpkg-src/openpkg/rpm.patch.feature 23 Aug 2003 11:08:53 -0000 1.4.2.2 +++ openpkg-src/openpkg/rpm.patch.feature 23 Aug 2003 20:56:26 -0000 1.4.2.3 @@ -554,3 +554,20 @@ memcpy(argv + argc, con->leftovers, sizeof(*argv) * con->numLeftovers); argc += con->numLeftovers; } ++--------------------------------------------------------------------------- +| allow special marker '!#:+' to be used multiple times instead of +| expanding always the same argument. ++--------------------------------------------------------------------------- +--- popt/popt.c.orig Sat Aug 23 22:30:26 2003 ++++ popt/popt.c Sat Aug 23 22:45:19 2003 +@@ -578,10 +578,8 @@ + if (!(s[0] == '#' && s[1] == ':' && s[2] == '+')) + /[EMAIL PROTECTED]@*/ break; + /* XXX Make sure that findNextArg deletes only next arg. */ +- if (a == NULL) { + if ((a = findNextArg(con, 1, 1)) == NULL) + /[EMAIL PROTECTED]@*/ break; +- } + s += 3; + + alen = strlen(a); @@ . patch -p0 <<'@@ .' Index: openpkg-src/openpkg/rpmpopt ============================================================================ $ cvs diff -u -r1.5.8.1 -r1.5.8.2 rpmpopt --- openpkg-src/openpkg/rpmpopt 23 Aug 2003 19:42:02 -0000 1.5.8.1 +++ openpkg-src/openpkg/rpmpopt 23 Aug 2003 20:56:26 -0000 1.5.8.2 @@ -12,6 +12,19 @@ rpm alias --restriction --define "restriction yes" rpm alias --norestriction --define "restriction no" +# override --with/--without +rpm alias --with --define "with_!#:+ yes" \ + --POPTdesc=$"set '%option <name> yes'" \ + --POPTargs=$"<name>" +rpm alias --without --define "with_!#:+ no" \ + --POPTdesc=$"set '%option with_<name> no'" \ + --POPTargs=$"<name>" + +# provide more generalized --option +rpm alias --option --define "!#:+ !#:+" \ + --POPTdesc=$"set '%option <option> <value>'" \ + --POPTargs=$"<option> <value>" + # override -i/--info display rpmq alias --info --qf '\ Name: %-25{NAME} Source RPM: %{SOURCERPM}\n\ @@ . ______________________________________________________________________ The OpenPKG Project www.openpkg.org CVS Repository Commit List [EMAIL PROTECTED]