RPM Community Forums

Mailing List Message of <rpm-cvs>

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

From: Jeff Johnson <jbj@rpm5.org>
Date: Sat 22 Sep 2007 - 18:06:05 CEST
Message-Id: <20070922160605.DDC7D34845E@rpm5.org>
  RPM Package Manager, CVS Repository
  http://rpm5.org/cvs/
  ____________________________________________________________________________

  Server: rpm5.org                         Name:   Jeff Johnson
  Root:   /v/rpm/cvs                       Email:  jbj@rpm5.org
  Module: rpm                              Date:   22-Sep-2007 18:06:05
  Branch: HEAD                             Handle: 2007092217060500

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

  Log:
    - add %{mkstemp: ... } macro primitive.

  Summary:
    Revision    Changes     Path
    1.1636      +1  -0      rpm/CHANGES
    2.107       +2  -6      rpm/build.c
    2.144       +16 -3      rpm/rpmio/macro.c
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: rpm/CHANGES
  ============================================================================
  $ cvs diff -u -r1.1635 -r1.1636 CHANGES
  --- rpm/CHANGES	18 Sep 2007 19:19:21 -0000	1.1635
  +++ rpm/CHANGES	22 Sep 2007 16:06:05 -0000	1.1636
  @@ -1,4 +1,5 @@
   4.5 -> 5.0:
  +    - jbj: add %{mkstemp: ... } macro primitive.
       - rse: fix po/POTFILES.in and tools/Makefile.am to reflect recent changes (fixes "make dist", too)
       - rpm.org: cleanup main() definitions in tests and tools
       - rse: include <netinet/in.h> and/or <arpa/inet.h> for htonl(3)
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/build.c
  ============================================================================
  $ cvs diff -u -r2.106 -r2.107 build.c
  --- rpm/build.c	24 Jul 2007 14:36:46 -0000	2.106
  +++ rpm/build.c	22 Sep 2007 16:06:05 -0000	2.107
  @@ -121,6 +121,7 @@
   
       /*@-compmempass@*/ /* FIX: static zcmds heartburn */
       if (ba->buildMode == 't') {
  +	static const char _specfn[] = "%{mkstemp:%{_specdir}/rpm-spec.XXXXXX}";
   	FILE *fp;
   	const char * specDir;
   	char * tmpSpecFile;
  @@ -131,12 +132,7 @@
   
   	specDir = rpmGetPath("%{_specdir}", NULL);
   
  -	tmpSpecFile = (char *) rpmGetPath("%{_specdir}/", "rpm-spec.XXXXXX", NULL);
  -#if defined(HAVE_MKSTEMP)
  -	(void) close(mkstemp(tmpSpecFile));
  -#else
  -	(void) mktemp(tmpSpecFile);
  -#endif
  +	tmpSpecFile = (char *) rpmGetPath(_specfn, NULL);
   
   	(void) isCompressed(arg, &res);
   
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmio/macro.c
  ============================================================================
  $ cvs diff -u -r2.143 -r2.144 macro.c
  --- rpm/rpmio/macro.c	27 Aug 2007 23:18:44 -0000	2.143
  +++ rpm/rpmio/macro.c	22 Sep 2007 16:06:05 -0000	2.144
  @@ -1133,9 +1133,9 @@
   	/*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
   	/*@modifies mb, rpmGlobalMacroContext, fileSystem, internalState @*/
   {
  -     size_t bufn = _macro_BUFSIZ + fn + gn;
  -     char * buf = alloca(bufn);
  -     char *b = NULL, *be;
  +    size_t bufn = _macro_BUFSIZ + fn + gn;
  +    char * buf = alloca(bufn);
  +    char *b = NULL, *be;
       int c;
   
       buf[0] = '\0';
  @@ -1211,6 +1211,18 @@
   	    break;
   	}
   	b = be;
  +    } else if (STREQ("mkstemp", f, fn)) {
  +/*@-globs@*/
  +	for (b = buf; (c = *b) && isblank(c);)
  +	    b++;
  +	for (be = b; (c = *be) && !isblank(c);)
  +	    be++;
  +/*@=globs@*/
  +#if defined(HAVE_MKSTEMP)
  +        (void) close(mkstemp(b));
  +#else
  +        (void) mktemp(b);
  +#endif
       } else if (STREQ("S", f, fn)) {
   	for (b = buf; (c = *b) && xisdigit(c);)
   	    b++;
  @@ -1509,6 +1521,7 @@
   	    STREQ("expand", f, fn) ||
   	    STREQ("verbose", f, fn) ||
   	    STREQ("uncompress", f, fn) ||
  +	    STREQ("mkstemp", f, fn) ||
   	    STREQ("url2path", f, fn) ||
   	    STREQ("u2p", f, fn) ||
   	    STREQ("S", f, fn) ||
  @@ .
Received on Sat Sep 22 18:06:05 2007
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.