RPM Community Forums

Mailing List Message of <rpm-cvs>

[CVS] RPM: rpm/ CHANGES rpm/build/ parsePrep.c rpm/rpmio/ rpmio.c

From: Anders F. Björklund <afb@rpm5.org>
Date: Fri 30 Nov 2007 - 16:22:38 CET
Message-Id: <20071130152238.725CC348456@rpm5.org>
  RPM Package Manager, CVS Repository
  http://rpm5.org/cvs/
  ____________________________________________________________________________

  Server: rpm5.org                         Name:   Anders F. Björklund
  Root:   /v/rpm/cvs                       Email:  afb@rpm5.org
  Module: rpm                              Date:   30-Nov-2007 16:22:38
  Branch: HEAD                             Handle: 2007113015223701

  Modified files:
    rpm                     CHANGES
    rpm/build               parsePrep.c
    rpm/rpmio               rpmio.c

  Log:
    use the new macros, instead of hardcoded values

  Summary:
    Revision    Changes     Path
    1.1900      +1  -0      rpm/CHANGES
    2.96        +1  -1      rpm/build/parsePrep.c
    1.110       +12 -1      rpm/rpmio/rpmio.c
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: rpm/CHANGES
  ============================================================================
  $ cvs diff -u -r1.1899 -r1.1900 CHANGES
  --- rpm/CHANGES	30 Nov 2007 04:51:29 -0000	1.1899
  +++ rpm/CHANGES	30 Nov 2007 15:22:37 -0000	1.1900
  @@ -1,4 +1,5 @@
   5.0a2 -> 5.0a3:
  +    - afb: use %{?__lzma_encode_args} and %{?__lzma_decode_args} macros.
       - jbj: parse arbitrary tags permitted by _arbitrary_tags white list.
       - jbj: fix: renumber rpmParseState_e to avoid rpmRC error returns.
       - rpm.org: remove unnecessary includes.
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/build/parsePrep.c
  ============================================================================
  $ cvs diff -u -r2.95 -r2.96 parsePrep.c
  --- rpm/build/parsePrep.c	27 Nov 2007 02:29:27 -0000	2.95
  +++ rpm/build/parsePrep.c	30 Nov 2007 15:22:38 -0000	2.96
  @@ -260,7 +260,7 @@
   	    t = "%{__lzop} -dc";
   	    break;
   	case COMPRESSED_LZMA:
  -	    t = "%{__lzma} -dc";
  +	    t = "%{__lzma} %{?__lzma_decode_args}%{!?__lzma_decode_args:-dc}";
   	    break;
   	case COMPRESSED_ZIP:
   	    if (rpmIsVerbose() && !quietly)
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmio/rpmio.c
  ============================================================================
  $ cvs diff -u -r1.109 -r1.110 rpmio.c
  --- rpm/rpmio/rpmio.c	23 Nov 2007 12:12:33 -0000	1.109
  +++ rpm/rpmio/rpmio.c	30 Nov 2007 15:22:38 -0000	1.110
  @@ -2782,6 +2782,8 @@
       return rc;
   }
   
  +#define LZMA_ARGS_LEN	32 /* should be enough for any tweaking */
  +
   /*@-mods@*/	/* XXX hide rpmGlobalMacroContext mods for now. */
   static FD_t lzdWriteOpen(int fdno, int fopen)
   	/*@globals fileSystem, internalState @*/
  @@ -2791,6 +2793,9 @@
       int p[2];
       int xx;
       const char *lzma;
  +    char *args;
  +    char *av[LZMA_ARGS_LEN+2];
  +    char *saveptr;
   
       if (fdno < 0) return NULL;
       if (pipe(p) < 0) {
  @@ -2828,9 +2833,15 @@
           for (i = 3; i < 1024; i++)
   	    xx = close(i);
           lzma = rpmGetPath("%{?__lzma}%{!?__lzma:/usr/bin/lzma}", NULL);
  -        if (execl(lzma, "lzma", "e", "-si", "-so", NULL))
  +        av[0] = (char*)lzma;
  +        args = rpmExpand("%{?__lzma_encode_args}", NULL);
  +        for (i = 1; i < sizeof(av)/sizeof(av[0])-1; i++)
  +            av[i] = strtok_r(i == 1 ? args : NULL, " ", &saveptr);
  +        av[i] = NULL;
  +        if (execv(lzma, av))
               _exit(1);
           lzma = _free(lzma);
  +        args = _free(args);
       }
       return NULL; /* warning */
   }
  @@ .
Received on Fri Nov 30 16:22:38 2007
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.