RPM Community Forums

Mailing List Message of <rpm-cvs>

[CVS] RPM: rpm/ CHANGES rpm/lib/ rpminstall.c rpmrc.c tgi.c rpm/rpmdb/...

From: Jeff Johnson <jbj@rpm5.org>
Date: Sun 10 Feb 2008 - 19:32:33 CET
Message-Id: <20080210183233.B7FA834844A@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:   10-Feb-2008 19:32:33
  Branch: HEAD                             Handle: 2008021018323102

  Modified files:
    rpm                     CHANGES
    rpm/lib                 rpminstall.c rpmrc.c tgi.c
    rpm/rpmdb               rpmdb.c
    rpm/rpmio               macro.c mire.c mire.h rpmgrep.c tfts.c tmire.c

  Log:
    - jbj: mire: add vallen argument to mireRegexec().

  Summary:
    Revision    Changes     Path
    1.2173      +1  -0      rpm/CHANGES
    1.201       +1  -1      rpm/lib/rpminstall.c
    2.224       +1  -1      rpm/lib/rpmrc.c
    2.18        +1  -1      rpm/lib/tgi.c
    1.236       +7  -7      rpm/rpmdb/rpmdb.c
    2.185       +1  -1      rpm/rpmio/macro.c
    1.15        +5  -3      rpm/rpmio/mire.c
    1.11        +2  -1      rpm/rpmio/mire.h
    1.7         +2  -2      rpm/rpmio/rpmgrep.c
    2.22        +1  -1      rpm/rpmio/tfts.c
    1.5         +1  -1      rpm/rpmio/tmire.c
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: rpm/CHANGES
  ============================================================================
  $ cvs diff -u -r1.2172 -r1.2173 CHANGES
  --- rpm/CHANGES	10 Feb 2008 15:06:55 -0000	1.2172
  +++ rpm/CHANGES	10 Feb 2008 18:32:31 -0000	1.2173
  @@ -1,4 +1,5 @@
   5.0.0 -> 5.1a1:
  +    - jbj: mire: add vallen argument to mireRegexec().
       - jbj: borrow pcregrep.c from pcre-7.6, rename as rpmgrep.c.
       - jbj: rpmio: use tmire.c, not -DSTANDALONE, so librpmio doesnt rebuild.
       - jbj: rpmio: add tmire to noinst_PROGRAMS.
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/lib/rpminstall.c
  ============================================================================
  $ cvs diff -u -r1.200 -r1.201 rpminstall.c
  --- rpm/lib/rpminstall.c	9 Feb 2008 17:55:31 -0000	1.200
  +++ rpm/lib/rpminstall.c	10 Feb 2008 18:32:32 -0000	1.201
  @@ -361,7 +361,7 @@
   	    continue;
   	    /*@notreached@*/ break;
   	case FTS_F:		/* regular file */
  -	    if (mireRegexec(mire, fts->fts_accpath))
  +	    if (mireRegexec(mire, fts->fts_accpath, 0))
   		continue;
   	    break;
   	/* Error conditions. */
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/lib/rpmrc.c
  ============================================================================
  $ cvs diff -u -r2.223 -r2.224 rpmrc.c
  --- rpm/lib/rpmrc.c	2 Jan 2008 15:01:35 -0000	2.223
  +++ rpm/lib/rpmrc.c	10 Feb 2008 18:32:32 -0000	2.224
  @@ -528,7 +528,7 @@
   
       if ((mire = mi_re) != NULL)
       for (i = 0; i < mi_nre; i++) {
  -	if (!mireRegexec(mire + i, platform))
  +	if (!mireRegexec(mire + i, platform, 0))
   	    return (i + 1);
       }
       return 0;
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/lib/tgi.c
  ============================================================================
  $ cvs diff -u -r2.17 -r2.18 tgi.c
  --- rpm/lib/tgi.c	2 Feb 2008 21:45:18 -0000	2.17
  +++ rpm/lib/tgi.c	10 Feb 2008 18:32:32 -0000	2.18
  @@ -89,7 +89,7 @@
   
       /* Filter out glibc <-> glibc-common confusions. */
       for (i = 0; i < ac; i++) {
  -	if (mireRegexec(mire, av[i]))
  +	if (mireRegexec(mire, av[i], 0))
   	    continue;
   	fn = xstrdup(av[0]);
   	break;
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmdb/rpmdb.c
  ============================================================================
  $ cvs diff -u -r1.235 -r1.236 rpmdb.c
  --- rpm/rpmdb/rpmdb.c	1 Feb 2008 19:45:54 -0000	1.235
  +++ rpm/rpmdb/rpmdb.c	10 Feb 2008 18:32:33 -0000	1.236
  @@ -2195,7 +2195,7 @@
   	    case RPM_UINT8_TYPE:
   		for (j = 0; j < (unsigned) he->c; j++) {
   		    sprintf(numbuf, "%u", (unsigned) he->p.ui8p[j]);
  -		    rc = mireRegexec(mire, numbuf);
  +		    rc = mireRegexec(mire, numbuf, 0);
   		    if ((!rc && !mire->notmatch) || (rc && mire->notmatch))
   			anymatch++;
   		}
  @@ -2203,7 +2203,7 @@
   	    case RPM_UINT16_TYPE:
   		for (j = 0; j < (unsigned) he->c; j++) {
   		    sprintf(numbuf, "%u", (unsigned) he->p.ui16p[j]);
  -		    rc = mireRegexec(mire, numbuf);
  +		    rc = mireRegexec(mire, numbuf, 0);
   		    if ((!rc && !mire->notmatch) || (rc && mire->notmatch))
   			anymatch++;
   		}
  @@ -2211,7 +2211,7 @@
   	    case RPM_UINT32_TYPE:
   		for (j = 0; j < (unsigned) he->c; j++) {
   		    sprintf(numbuf, "%u", (unsigned) he->p.ui32p[j]);
  -		    rc = mireRegexec(mire, numbuf);
  +		    rc = mireRegexec(mire, numbuf, 0);
   		    if ((!rc && !mire->notmatch) || (rc && mire->notmatch))
   			anymatch++;
   		}
  @@ -2220,20 +2220,20 @@
   /*@-duplicatequals@*/
   		for (j = 0; j < (unsigned) he->c; j++) {
   		    sprintf(numbuf, "%llu", (unsigned long long)he->p.ui64p[j]);
  -		    rc = mireRegexec(mire, numbuf);
  +		    rc = mireRegexec(mire, numbuf, 0);
   		    if ((!rc && !mire->notmatch) || (rc && mire->notmatch))
   			anymatch++;
   		}
   /*@=duplicatequals@*/
   		/*@switchbreak@*/ break;
   	    case RPM_STRING_TYPE:
  -		rc = mireRegexec(mire, he->p.str);
  +		rc = mireRegexec(mire, he->p.str, 0);
   		if ((!rc && !mire->notmatch) || (rc && mire->notmatch))
   		    anymatch++;
   		/*@switchbreak@*/ break;
   	    case RPM_STRING_ARRAY_TYPE:
   		for (j = 0; j < (unsigned) he->c; j++) {
  -		    rc = mireRegexec(mire, he->p.argv[j]);
  +		    rc = mireRegexec(mire, he->p.argv[j], 0);
   		    if ((!rc && !mire->notmatch) || (rc && mire->notmatch)) {
   			anymatch++;
   			/*@innerbreak@*/ break;
  @@ -2242,7 +2242,7 @@
   		/*@switchbreak@*/ break;
   	    case RPM_BIN_TYPE:
   	    {   const char * s = bin2hex(he->p.ptr, he->c);
  -		rc = mireRegexec(mire, s);
  +		rc = mireRegexec(mire, s, 0);
   		if ((!rc && !mire->notmatch) || (rc && mire->notmatch))
   		    anymatch++;
   		s = _free(s);
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmio/macro.c
  ============================================================================
  $ cvs diff -u -r2.184 -r2.185 macro.c
  --- rpm/rpmio/macro.c	4 Feb 2008 21:18:50 -0000	2.184
  +++ rpm/rpmio/macro.c	10 Feb 2008 18:32:33 -0000	2.185
  @@ -298,7 +298,7 @@
   	if (used == 0 && me->used != 0)
   	    continue;
   #if !defined(DEBUG_MACROS)	/* XXX preserve standalone build */
  -	if (mire != NULL && mireRegexec(mire, me->name))
  +	if (mire != NULL && mireRegexec(mire, me->name, 0))
   	    continue;
   #endif
   	av[ac++] = dupMacroEntry(me);
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmio/mire.c
  ============================================================================
  $ cvs diff -u -r1.14 -r1.15 mire.c
  --- rpm/rpmio/mire.c	10 Feb 2008 18:13:47 -0000	1.14
  +++ rpm/rpmio/mire.c	10 Feb 2008 18:32:33 -0000	1.15
  @@ -108,7 +108,7 @@
       return mireLink(mire,"mireNew");
   }
   
  -int mireRegexec(miRE mire, const char * val)
  +int mireRegexec(miRE mire, const char * val, size_t vallen)
   {
       int rc = 0;
   
  @@ -133,7 +133,9 @@
   	break;
   #ifdef	WITH_PCRE
       case RPMMIRE_PCRE:
  -	rc = pcre_exec(mire->pcre, mire->hints, val, (int)strlen(val), 0,
  +	if (vallen == 0)
  +	    vallen = strlen(val);
  +	rc = pcre_exec(mire->pcre, mire->hints, val, vallen, 0,
   		mire->eoptions, mire->offsets, mire->noffsets);
   	if (rc && rc != PCRE_ERROR_NOMATCH) {
   	    rpmlog(RPMLOG_ERR, _("%s: pcre_exec failed: return %d\n"), rc);
  @@ -155,7 +157,7 @@
   
   /*@-modfilesys@*/
   if (_mire_debug)
  -fprintf(stderr, "--> mireRegexec(%p, \"%s\") rc %d\n", mire, val, rc);
  +fprintf(stderr, "--> mireRegexec(%p, \"%s\", %u) rc %d\n", mire, val, (unsigned)vallen, rc);
   /*@=modfilesys@*/
       return rc;
   }
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmio/mire.h
  ============================================================================
  $ cvs diff -u -r1.10 -r1.11 mire.h
  --- rpm/rpmio/mire.h	10 Feb 2008 18:13:47 -0000	1.10
  +++ rpm/rpmio/mire.h	10 Feb 2008 18:32:33 -0000	1.11
  @@ -140,9 +140,10 @@
    * Execute pattern match.
    * @param mire		pattern container
    * @param val		value to match
  + * @param vallen	length of value string (0 will use strlen)
    * @return		0 if pattern matches, >0 on nomatch, <0 on error
    */
  -int mireRegexec(miRE mire, const char * val)
  +int mireRegexec(miRE mire, const char * val, size_t vallen)
   	/*@modifies mire @*/;
   
   /**
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmio/rpmgrep.c
  ============================================================================
  $ cvs diff -u -r1.6 -r1.7 rpmgrep.c
  --- rpm/rpmio/rpmgrep.c	10 Feb 2008 18:13:47 -0000	1.6
  +++ rpm/rpmio/rpmgrep.c	10 Feb 2008 18:32:33 -0000	1.7
  @@ -1088,10 +1088,10 @@
             int frc;
             sprintf(buffer, "%.512s%c%.128s", pathname, sep, nextfile);
       
  -          if (excludeMire && mireRegexec(excludeMire, buffer) != PCRE_ERROR_NOMATCH)
  +          if (excludeMire && mireRegexec(excludeMire, buffer, 0) != PCRE_ERROR_NOMATCH)
               continue;
       
  -          if (includeMire && mireRegexec(includeMire, buffer) == PCRE_ERROR_NOMATCH)
  +          if (includeMire && mireRegexec(includeMire, buffer, 0) == PCRE_ERROR_NOMATCH)
               continue;
       
             frc = grep_or_recurse(buffer, dir_recurse, FALSE);
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmio/tfts.c
  ============================================================================
  $ cvs diff -u -r2.21 -r2.22 tfts.c
  --- rpm/rpmio/tfts.c	9 Feb 2008 23:12:33 -0000	2.21
  +++ rpm/rpmio/tfts.c	10 Feb 2008 18:32:33 -0000	2.22
  @@ -79,7 +79,7 @@
   	    fprintf(stderr, "%s\n", fts->fts_path);
   	if (mire) {
   	    mireNExecs++;
  -	    xx = mireRegexec(mire, fts->fts_path);
  +	    xx = mireRegexec(mire, fts->fts_path, 0);
   	    if (xx == 0) {
   		fprintf(stdout, " mire: %s\n", fts->fts_path);
   		mireNMatches++;
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmio/tmire.c
  ============================================================================
  $ cvs diff -u -r1.4 -r1.5 tmire.c
  --- rpm/rpmio/tmire.c	10 Feb 2008 02:08:27 -0000	1.4
  +++ rpm/rpmio/tmire.c	10 Feb 2008 18:32:33 -0000	1.5
  @@ -62,7 +62,7 @@
       ac = argvCount(av);
       if (av && *av)
       for (i = 0; i < ac; i++) {
  -	xx = mireRegexec(mire, av[i]);
  +	xx = mireRegexec(mire, av[i], 0);
   	if (xx == 0) {
   	    fprintf(stdout, "%s\n", av[i]);
   	    rc = 0;
  @@ .
Received on Sun Feb 10 19:32:33 2008
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.