There's likely a bit more that could be done to establish consistently
reliable behavior for RPM paramaterized macros.

However, there are conflicting expectations of what the "default"
behavior should be, and so there's little hope of resolving the
different expectations in the code to everyone's satisfaction.

Personally, I think POSIX behavior should be the default according to
the principle of least surprise. But I have no wish to convince anyone
of what their expectations should be, the first character passed to
getopt(3) is a deeply obscure and arcane GLIBC extension.

73 de Jeff

On Jun 18, 2008, at 12:49 PM, Jeff Johnson wrote:

  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:49:27
  Branch: rpm-5_0                          Handle: 2008061816492601

  Modified files:           (Branch: rpm-5_0)
    rpm                     CHANGES
    rpm/rpmio               macro.c

  Log:
    - jbj: permit configurable POSIX behavior for parameterized macros
        (Marcin Kowalczyk<[EMAIL PROTECTED]>).

  Summary:
    Revision    Changes     Path
    1.2054.2.94 +2  -0      rpm/CHANGES
    2.171.2.6   +5  -3      rpm/rpmio/macro.c
______________________________________________________________________ ______

  patch -p0 <<'@@ .'
  Index: rpm/CHANGES
====================================================================== ======
  $ cvs diff -u -r1.2054.2.93 -r1.2054.2.94 CHANGES
  --- rpm/CHANGES       16 Jun 2008 17:49:47 -0000      1.2054.2.93
  +++ rpm/CHANGES       18 Jun 2008 16:49:26 -0000      1.2054.2.94
  @@ -1,4 +1,6 @@
   5.0.3 -> 5.0.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.171.2.5 -r2.171.2.6 macro.c
  --- rpm/rpmio/macro.c 31 May 2008 18:36:34 -0000      2.171.2.5
  +++ rpm/rpmio/macro.c 18 Jun 2008 16:49:27 -0000      2.171.2.6
  @@ -1073,7 +1073,7 @@
        */
       /* 1003.2 says this must be 1 before any call.  */

  -#ifdef __GLIBC__
  +#ifdef       __GLIBC__
       /[EMAIL PROTECTED]@*/
       optind = 0;              /* XXX but posix != glibc */
       /[EMAIL PROTECTED]@*/
  @@ -1083,7 +1083,8 @@

       opts = me->opts;

  -#ifdef __GLIBC__
  +/* XXX maintain compat w 5.0 behavior. */
  +#if defined(__GLIBC__) && defined(RPM_VENDOR_OPENPKG)
       /*
* Ensure option parsing is done without allowing option/ argument permutations * to avoid accidentally picking up and complaining about unknown options.
  @@ -1132,7 +1133,8 @@
        be = b; /* reuse the space */
       }

  -#ifdef __GLIBC__
  +/* XXX maintain compat w 5.0 behavior. */
  +#if defined(__GLIBC__) && defined(RPM_VENDOR_OPENPKG)
       if (posixly_correct != NULL)
           setenv("POSIXLY_CORRECT", posixly_correct, 1);
       else
  @@ .
______________________________________________________________________
RPM Package Manager                                    http://rpm5.org
CVS Sources Repository                                [EMAIL PROTECTED]

______________________________________________________________________
RPM Package Manager                                    http://rpm5.org
Developer Communication List                        rpm-devel@rpm5.org

Reply via email to