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: Sun 03 Feb 2008 - 17:05:24 CET
Message-Id: <20080203160524.B0340348458@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:   03-Feb-2008 17:05:24
  Branch: HEAD                             Handle: 2008020316052400

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

  Log:
    - rse: add _rpmgi_pattern_{glob,regex} macros for "+N" arg-to-path
    rewrite.

  Summary:
    Revision    Changes     Path
    1.2127      +1  -0      rpm/CHANGES
    1.195       +11 -5      rpm/lib/rpminstall.c
    1.230       +6  -1      rpm/macros.in
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: rpm/CHANGES
  ============================================================================
  $ cvs diff -u -r1.2126 -r1.2127 CHANGES
  --- rpm/CHANGES	3 Feb 2008 09:55:02 -0000	1.2126
  +++ rpm/CHANGES	3 Feb 2008 16:05:24 -0000	1.2127
  @@ -1,4 +1,5 @@
   5.0.0 -> 5.1a1:
  +    - rse: add _rpmgi_pattern_{glob,regex} macros for "+N" arg-to-path rewrite.
       - jbj: functional "+N-V-R.A" path-to-repository expansions with -i/-U.
       - jbj: mire.c: add STANDALONE test exerciser.
       - jbj: use struct timeval timestamp for INSTALL{TID,TIME} and ORIGIN{TID,TIME}.
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/lib/rpminstall.c
  ============================================================================
  $ cvs diff -u -r1.194 -r1.195 rpminstall.c
  --- rpm/lib/rpminstall.c	3 Feb 2008 08:28:38 -0000	1.194
  +++ rpm/lib/rpminstall.c	3 Feb 2008 16:05:24 -0000	1.195
  @@ -334,18 +334,24 @@
   
   static const char * rpmcliInstallElementPath(rpmts ts, const char * arg)
   {
  -    static const char * pkgpat = "-[^-]+-[^-]+\\.[^.]+\\.rpm$";
  -    const char * mirePattern = rpmExpand(arg, pkgpat, NULL);
  +    /* XXX note the added "-*.rpm" to force globbing on '-' boundaries. */
  +    const char * fn = rpmGetPath(
  +	"%{?_rpmgi_pattern_glob:%{_rpmgi_pattern_glob ", arg, "}}"
  +	"%{!?_rpmgi_pattern_glob:", arg, "-*-*.*.rpm}",
  +	NULL
  +    );
  +    const char * mirePattern = rpmExpand(
  +        "%{?_rpmgi_pattern_regex:%{_rpmgi_pattern_regex ", arg, "}}"
  +        "%{!?_rpmgi_pattern_regex:", arg, "-[^-]+-[^-]+\\.[^.]+\\.rpm$}",
  +        NULL
  +    );
       miRE mire = mireNew(RPMMIRE_REGEX, 0);
  -    const char * fn = NULL;
       ARGV_t av = NULL;
       int ac = 0;
       int xx = mireRegcomp(mire, mirePattern);
       int i;
   
       /* Get list of candidate package paths. */
  -    /* XXX note the added "-*.rpm" to force globbing on '-' boundaries. */
  -    fn = rpmGetPath("%{?_rpmgi_prefix:%{?_rpmgi_prefix}/}", arg, "-*.rpm", NULL);
       xx = rpmGlob(fn, &ac, &av);
       fn = _free(fn);
   
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/macros.in
  ============================================================================
  $ cvs diff -u -r1.229 -r1.230 macros.in
  --- rpm/macros.in	27 Jan 2008 01:54:39 -0000	1.229
  +++ rpm/macros.in	3 Feb 2008 16:05:24 -0000	1.230
  @@ -1,7 +1,7 @@
   #/*! \page config_macros Default configuration: @USRLIBRPM@/macros
   # \verbatim
   #
  -# $Id: macros.in,v 1.229 2008/01/27 01:54:39 jbj Exp $
  +# $Id: macros.in,v 1.230 2008/02/03 16:05:24 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
  @@ -979,6 +979,11 @@
   # Permit network access? (".fdio" prohibits network access)
   %_rpmgio	.fdio
   
  +#
  +# Pattern matching for installation via "+N-V-R.A" CLI arguments
  +%_rpmgi_pattern_glob()    %{_rpmdir}/%1-*-*.*.rpm
  +%_rpmgi_pattern_regex()   ^.+/%1-[^-]+-[^-]+\\.[^.]+\\.rpm$
  +
   #==============================================================================
   # ---- Run-time probe dependency macros.
   
  @@ .
Received on Sun Feb 3 17:05:24 2008
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.