RPM Community Forums

Mailing List Message of <rpm-cvs>

[CVS] RPM: rpm/ CHANGES rpm/lib/ rpminstall.c rpm/ macros.in

From: Jeff Johnson <jbj@rpm5.org>
Date: Sat 09 Feb 2008 - 18:55:31 CET
Message-Id: <20080209175531.B0412348486@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:   09-Feb-2008 18:55:31
  Branch: HEAD                             Handle: 2008020917553100

  Modified files:
    rpm                     CHANGES macros.in
    rpm/lib                 rpminstall.c

  Log:
    - jbj: pemit %{___NVRA} to parameterize the displayed NVRA while installing.
    - jbj: create %___NVRA to split external <-> internal package names.

  Summary:
    Revision    Changes     Path
    1.2166      +2  -0      rpm/CHANGES
    1.200       +10 -9      rpm/lib/rpminstall.c
    1.235       +11 -6      rpm/macros.in
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: rpm/CHANGES
  ============================================================================
  $ cvs diff -u -r1.2165 -r1.2166 CHANGES
  --- rpm/CHANGES	9 Feb 2008 16:35:47 -0000	1.2165
  +++ rpm/CHANGES	9 Feb 2008 17:55:31 -0000	1.2166
  @@ -1,4 +1,6 @@
   5.0.0 -> 5.1a1:
  +    - jbj: pemit %{___NVRA} to parameterize the displayed NVRA while installing.
  +    - jbj: create %___NVRA to split external <-> internal package names.
       - rpm.org: Mass convert (back) to rpmTag as it's usable everywhere now
       - rpm.org: Use rpmSigTag enum for signature tags everywhere, more or less..
       - jbj: import a modified copy of testHTML.c from libxml2.
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/lib/rpminstall.c
  ============================================================================
  $ cvs diff -u -r1.199 -r1.200 rpminstall.c
  --- rpm/lib/rpminstall.c	8 Feb 2008 02:08:40 -0000	1.199
  +++ rpm/lib/rpminstall.c	9 Feb 2008 17:55:31 -0000	1.200
  @@ -103,7 +103,7 @@
   /*@-abstract -castexpose @*/
       Header h = (Header) arg;
   /*@=abstract =castexpose @*/
  -    char * s;
  +    const char * s;
       int flags = (int) ((long)data);
       void * rc = NULL;
   /*@-abstract -assignexpose @*/
  @@ -158,11 +158,12 @@
   	    (void) fflush(stdout);
   	    s = _free(s);
   	} else {
  -	    s = headerSprintf(h, "%{NAME}-%{VERSION}-%{RELEASE}",
  -				  NULL, rpmHeaderFormats, NULL);
  +	    char * t = rpmExpand("%{?___NVRA}%{!?___NVRA:%%{NAME}-%%{VERSION}-%%{RELEASE}}", NULL);
  +	    s = headerSprintf(h, t, NULL, rpmHeaderFormats, NULL);
   	    fprintf(stdout, "%s\n", s);
   	    (void) fflush(stdout);
   	    s = _free(s);
  +	    t = _free(t);
   	}
   	break;
   
  @@ -251,7 +252,7 @@
       }
   
       return rc;
  -}	
  +}
   
   int rpmcliInstallProblems(rpmts ts, const char * msg, int rc)
   	/*@globals fileSystem @*/
  @@ -491,10 +492,10 @@
       if (rpmExpandNumeric("%{?_rollback_transaction_on_failure}")) {
   	if (ia->arbtid) {
   	    time_t ttid = (time_t)ia->arbtid;
  -	    rpmlog(RPMLOG_DEBUG, D_("Autorollback Goal: %-24.24s (0x%08x)\n"), 
  +	    rpmlog(RPMLOG_DEBUG, D_("Autorollback Goal: %-24.24s (0x%08x)\n"),
   		ctime(&ttid), ia->arbtid);
   	    rpmtsSetARBGoal(ts, ia->arbtid);
  -	}	
  +	}
       }
   
       if (ia->installInterfaceFlags & INSTALL_UPGRADE)
  @@ -711,10 +712,10 @@
       if (rpmExpandNumeric("%{?_rollback_transaction_on_failure}")) {
   	if (ia->arbtid) {
   	    time_t ttid = (time_t)ia->arbtid;
  -	    rpmlog(RPMLOG_DEBUG, D_("Autorollback Goal: %-24.24s (0x%08x)\n"), 
  +	    rpmlog(RPMLOG_DEBUG, D_("Autorollback Goal: %-24.24s (0x%08x)\n"),
   		ctime(&ttid), ia->arbtid);
   	    rpmtsSetARBGoal(ts, ia->arbtid);
  -	}	
  +	}
       }
   
   #ifdef	NOTYET	/* XXX no callbacks on erase yet */
  @@ -787,7 +788,7 @@
   	/* Drop added/available package indices and dependency sets. */
   	rpmtsClean(ts);
   
  -	numPackages = rpmtsRun(ts, NULL, 
  +	numPackages = rpmtsRun(ts, NULL,
   		ia->probFilter & (RPMPROB_FILTER_DISKSPACE|RPMPROB_FILTER_DISKNODES));
   	ps = rpmtsProblems(ts);
   	if (rpmpsNumProblems(ps) > 0)
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/macros.in
  ============================================================================
  $ cvs diff -u -r1.234 -r1.235 macros.in
  --- rpm/macros.in	7 Feb 2008 19:29:32 -0000	1.234
  +++ rpm/macros.in	9 Feb 2008 17:55:31 -0000	1.235
  @@ -1,7 +1,7 @@
   #/*! \page config_macros Default configuration: @USRLIBRPM@/macros
   # \verbatim
   #
  -# $Id: macros.in,v 1.234 2008/02/07 19:29:32 jbj Exp $
  +# $Id: macros.in,v 1.235 2008/02/09 17:55:31 jbj Exp $
   #
   # This is a global RPM configuration file. All changes made here will
   # be lost when the rpm package is upgraded. Any per-system configuration
  @@ -771,7 +771,7 @@
   # Export package NEVRA (stamped with install tid) info for HRMIB on this path.
   #
   # XXX	Note: escaped %% for use in headerSprintf()
  -#%_hrmib_path	/var/cache/hrmib/%%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}
  +#%_hrmib_path	/var/cache/hrmib/%{___NVRA}
   
   #==============================================================================
   # ---- GPG/PGP/PGP5 signature macros.
  @@ -832,7 +832,7 @@
   #	binary packages.
   #
   # XXX	Note: escaped %% for use in headerSprintf()
  -%_build_name_fmt	%%{ARCH}/%%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm
  +%_build_name_fmt	%%{ARCH}/%{___NVRA}.rpm
   
   #	The default transaction color. This value is a set of bits to
   #	determine file and dependency affinity for this arch.
  @@ -863,6 +863,8 @@
   
   #	The path to the dependency universe packages. This should
   #	be a path to the packages contained in the solve database.
  +#
  +# XXX	Note: needs a pesky trailing /
   #%_solve_pkgsdir	/mnt/rpm/test/latest-i386/RedHat/RPMS/
   
   #	The output binary package file name template used when suggesting
  @@ -870,13 +872,13 @@
   #	in %{_etcrpm}/macros.solve, installed with the rpmdb-vendor package.
   #
   # XXX	Note: escaped %% for use in headerSprintf()
  -#%_solve_name_fmt	%{?_solve_pkgsdir}%%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm
  +#%_solve_name_fmt	%{?_solve_pkgsdir}%{___NVRA}.rpm
   
   #	The output binary package file name template used when repackaging
   #	erased packages.
   #
   # XXX	Note: escaped %% for use in headerSprintf()
  -%_repackage_name_fmt	%%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm
  +%_repackage_name_fmt	%{___NVRA}.rpm
   
   #	The "transactional rollback" directory in which erased packages will
   #	be saved when using the --repackage option.
  @@ -965,10 +967,13 @@
   #==============================================================================
   # ---- Query macros.
   #
  +# Default query format string for displaying package names everywhere
  +%___NVRA	%%{NAME}-%%{VERSION}-%%{RELEASE}%%|ARCH?{.%%|SOURCERPM?{%%{ARCH}}:{src}|}:{}|
  +
   # Default headerSprintf() output format string for rpm -qa
   #
   # XXX	Note: escaped %% for use in headerSprintf()
  -%_query_all_fmt		%%{name}-%%{version}-%%{release}.%%{arch}
  +%_query_all_fmt		%{___NVRA}
   
   #
   # Path for rpm -qH (default is /usr/share/comps/%{_arch}/hdlist)
  @@ .
Received on Sat Feb 9 18:55:31 2008
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.