[prev in list] [next in list] [prev in thread] [next in thread] 

List:       rpm-cvs
Subject:    [CVS] RPM: rpm/ CHANGES rpm/lib/ Makefile.am librpm.vers rpmdpkg.c rpm...
From:       "Jeff Johnson" <jbj () rpm5 ! org>
Date:       2008-06-20 11:09:47
Message-ID: 20080620110947.E059F34848A () rpm5 ! org
[Download RAW message or body]

  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:   20-Jun-2008 13:09:47
  Branch: HEAD                             Handle: 2008062011094501

  Added files:
    rpm/rpmdb               rpmdpkg.c rpmdpkg.h rpmevr.c rpmevr.h
  Modified files:
    rpm                     CHANGES
    rpm/lib                 Makefile.am librpm.vers
    rpm/rpmdb               Makefile.am librpmdb.vers
  Removed files:
    rpm/lib                 rpmdpkg.c rpmdpkg.h rpmevr.c rpmevr.h

  Log:
    - jbj: move rpmevr.[ch] to -lrpmdb for use with header format
    extensions.

  Summary:
    Revision    Changes     Path
    1.2427      +1  -0      rpm/CHANGES
    2.181       +2  -2      rpm/lib/Makefile.am
    1.41        +0  -10     rpm/lib/librpm.vers
    1.3         +0  -72     rpm/lib/rpmdpkg.c
    1.3         +0  -53     rpm/lib/rpmdpkg.h
    1.5         +0  -207    rpm/lib/rpmevr.c
    1.11        +0  -173    rpm/lib/rpmevr.h
    1.97        +2  -2      rpm/rpmdb/Makefile.am
    1.49        +12 -0      rpm/rpmdb/librpmdb.vers
    1.1         +72 -0      rpm/rpmdb/rpmdpkg.c
    1.1         +53 -0      rpm/rpmdb/rpmdpkg.h
    1.1         +207 -0     rpm/rpmdb/rpmevr.c
    1.1         +173 -0     rpm/rpmdb/rpmevr.h
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: rpm/CHANGES
  ============================================================================
  $ cvs diff -u -r1.2426 -r1.2427 CHANGES
  --- rpm/CHANGES	19 Jun 2008 15:31:06 -0000	1.2426
  +++ rpm/CHANGES	20 Jun 2008 11:09:45 -0000	1.2427
  @@ -1,5 +1,6 @@
   
   5.1.0 -> 5.2a0:
  +    - jbj: move rpmevr.[ch] to -lrpmdb for use with header format extensions.
       - jbj: fix: "%description -n foo-bar" needs an additional comparison.
       - jbj: add non-{GIF,XPM} formats opaquely using arbitrary Icon: tagno.
       - jbj: fix: allocate Icon: buffer after iconsize is initialized.
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/lib/Makefile.am
  ============================================================================
  $ cvs diff -u -r2.180 -r2.181 Makefile.am
  --- rpm/lib/Makefile.am	16 May 2008 20:09:35 -0000	2.180
  +++ rpm/lib/Makefile.am	20 Jun 2008 11:09:46 -0000	2.181
  @@ -36,7 +36,7 @@
   pkgincdir = $(pkgincludedir)$(WITH_PATH_VERSIONED_SUFFIX)
   pkginc_HEADERS = \
   	fs.h misc.h rpmcli.h rpmlib.h rpmversion.h \
  -	rpmal.h rpmdpkg.h rpmds.h rpmevr.h rpmfc.h rpmfi.h rpmgi.h \
  +	rpmal.h rpmds.h rpmfc.h rpmfi.h rpmgi.h \
   	rpmns.h rpmps.h rpmsx.h rpmte.h rpmts.h rpm4compat.h
   noinst_HEADERS = \
   	fsm.h manifest.h psm.h rpmlock.h rpmluaext.h
  @@ -47,7 +47,7 @@
   	depends.c formats.c fs.c fsm.c \
   	manifest.c misc.c package.c \
   	poptALL.c poptI.c poptQV.c psm.c query.c \
  -	rpmal.c rpmchecksig.c rpmdpkg.c rpmds.c rpmevr.c rpmfc.c \
  +	rpmal.c rpmchecksig.c rpmds.c rpmfc.c \
   	rpmfi.c rpmgi.c rpminstall.c rpmrollback.c rpmversion.c \
   	rpmlock.c rpmns.c rpmps.c rpmrc.c rpmsx.c rpmte.c rpmts.c \
   	transaction.c verify.c rpmluaext.c
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/lib/librpm.vers
  ============================================================================
  $ cvs diff -u -r1.40 -r1.41 librpm.vers
  --- rpm/lib/librpm.vers	22 May 2008 16:03:09 -0000	1.40
  +++ rpm/lib/librpm.vers	20 Jun 2008 11:09:46 -0000	1.41
  @@ -6,9 +6,6 @@
       currentDirectory;
       doputenv;
       dosetenv;
  -    dpkgEVRcmp;
  -    dpkgEVRcompare;
  -    dpkgEVRparse;
       fileActionString;
       fileStageString;
       _fini;
  @@ -128,12 +125,7 @@
       rpmdsUname;
       _rpmds_unspecified_epoch_noise;
       rpmErase;
  -    _rpmevr_debug;
       rpmEVR;
  -    rpmEVRcmp;
  -    rpmEVRcompare;
  -    rpmEVRflags;
  -    rpmEVRparse;
       _rpmfc_debug;
       rpmfcApply;
       rpmfcClassify;
  @@ -396,8 +388,6 @@
       rpmtsUpdateDSI;
       rpmtsVerifyDB;
       rpmtsVSFlags;
  -    _rpmvercmp;
  -    rpmvercmp;
       rpmVerifyFile;
       rpmVerifyPoptTable;
       rpmVerifySignatures;
  @@ .
  rm -f rpm/lib/rpmdpkg.c <<'@@ .'
  Index: rpm/lib/rpmdpkg.c
  ============================================================================
  [NO CHANGE SUMMARY BECAUSE FILE AS A WHOLE IS JUST REMOVED]
  @@ .
  rm -f rpm/lib/rpmdpkg.h <<'@@ .'
  Index: rpm/lib/rpmdpkg.h
  ============================================================================
  [NO CHANGE SUMMARY BECAUSE FILE AS A WHOLE IS JUST REMOVED]
  @@ .
  rm -f rpm/lib/rpmevr.c <<'@@ .'
  Index: rpm/lib/rpmevr.c
  ============================================================================
  [NO CHANGE SUMMARY BECAUSE FILE AS A WHOLE IS JUST REMOVED]
  @@ .
  rm -f rpm/lib/rpmevr.h <<'@@ .'
  Index: rpm/lib/rpmevr.h
  ============================================================================
  [NO CHANGE SUMMARY BECAUSE FILE AS A WHOLE IS JUST REMOVED]
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmdb/Makefile.am
  ============================================================================
  $ cvs diff -u -r1.96 -r1.97 Makefile.am
  --- rpm/rpmdb/Makefile.am	7 May 2008 16:58:25 -0000	1.96
  +++ rpm/rpmdb/Makefile.am	20 Jun 2008 11:09:46 -0000	1.97
  @@ -30,7 +30,7 @@
   tjfn_LDADD = librpmdb.la
   
   pkgincdir = $(pkgincludedir)$(WITH_PATH_VERSIONED_SUFFIX)
  -pkginc_HEADERS = pkgio.h rpmdb.h rpmtag.h signature.h rpmwf.h
  +pkginc_HEADERS = pkgio.h rpmdb.h rpmdpkg.h rpmevr.h rpmtag.h rpmwf.h signature.h
   noinst_HEADERS = fprint.h header_internal.h legacy.h
   
   pkglibdir =		@USRLIBRPM@
  @@ -45,7 +45,7 @@
   librpmdb_la_SOURCES = \
   	dbconfig.c fprint.c \
   	hdrfmt.c hdrNVR.c header.c header_internal.c legacy.c merge.c \
  -	pkgio.c poptDB.c rpmdb.c rpmwf.c \
  +	pkgio.c poptDB.c rpmdb.c rpmdpkg.c rpmevr.c rpmwf.c \
   	signature.c tagname.c tagtbl.c
   librpmdb_la_LDFLAGS = -release $(LT_CURRENT).$(LT_REVISION)
   if HAVE_LD_VERSION_SCRIPT
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmdb/librpmdb.vers
  ============================================================================
  $ cvs diff -u -r1.48 -r1.49 librpmdb.vers
  --- rpm/rpmdb/librpmdb.vers	29 May 2008 13:45:07 -0000	1.48
  +++ rpm/rpmdb/librpmdb.vers	20 Jun 2008 11:09:46 -0000	1.49
  @@ -13,6 +13,9 @@
       dbiOpen;
       dbiStatsAccumulator;
       dodigest;
  +    dpkgEVRcmp;
  +    dpkgEVRcompare;
  +    dpkgEVRparse;
       _fini;
       fpCacheCreate;
       fpCacheFree;
  @@ -41,6 +44,8 @@
       headerSetBaseURL;
       headerGetDigest;
       headerSetDigest;
  +    headerGetRpmdb;
  +    headerSetRpmdb;
       headerGetInstance;
       headerSetInstance;
       headerGetMagic;
  @@ -113,6 +118,11 @@
       rpmdbVerify;
       rpmdbVerifyAllDBI;
       rpmDisplayQueryTags;
  +    _rpmevr_debug;
  +    rpmEVRcmp;
  +    rpmEVRcompare;
  +    rpmEVRflags;
  +    rpmEVRparse;
       rpmpkgCheck;
       rpmpkgClean;
       rpmpkgRead;
  @@ -129,6 +139,8 @@
       rpmtsGetRdb;
       rpmtsOp;
       rpmtsPubkey;
  +    _rpmvercmp;
  +    rpmvercmp;
       _rpmwf_debug;
       rdRPM;
       rdXAR;
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmdb/rpmdpkg.c
  ============================================================================
  $ cvs diff -u -r0 -r1.1 rpmdpkg.c
  --- /dev/null	2008-06-20 13:00:06 +0200
  +++ rpmdpkg.c	2008-06-20 13:09:46 +0200
  @@ -0,0 +1,72 @@
  +/** \ingroup rpmds
  + * \file lib/rpmdpkg.c
  + */
  +#include "system.h"
  +
  +#include <rpmio.h>
  +
  +#define	_RPMEVR_INTERNAL
  +#include <rpmdpkg.h>
  +
  +#include "debug.h"
  +
  +/*@access EVR_t @*/
  +
  +/*@unchecked@*/
  +int _rpmdpkg_debug = 0;
  +
  +/* assume ascii */
  +static inline int dpkgEVRctype(char x)
  +	/*@*/
  +{
  +    return (
  +	  x == '~' ? -1 
  +	: xisdigit(x) ? 0
  +	: !x ? 0 \
  +	: xisalpha(x) ? x
  +	: x + 256
  +    );
  +}
  +
  +int dpkgEVRcmp(const char *a, const char *b)
  +{
  +    if (!a) a = "";
  +    if (!b) b = "";
  +
  +    while (*a || *b) {
  +	int first_diff= 0;
  +
  +	while ( (*a && !xisdigit(*a)) || (*b && !xisdigit(*b)) ) {
  +	    int vc = dpkgEVRctype(*a);
  +	    int rc = dpkgEVRctype(*b);
  +	    if (vc != rc) return vc - rc;
  +	    a++; b++;
  +	}
  +
  +	while (*a == '0') a++;
  +	while (*b == '0') b++;
  +	while (xisdigit(*a) && xisdigit(*b)) {
  +	    if (!first_diff) first_diff = *a - *b;
  +	    a++; b++;
  +	}
  +	if (xisdigit(*a)) return 1;
  +	if (xisdigit(*b)) return -1;
  +	if (first_diff) return first_diff;
  +    }
  +    return 0;
  +}
  +
  +int dpkgEVRparse(const char * evrstr, EVR_t evr)
  +{
  +    return rpmEVRparse(evrstr, evr);
  +}
  +
  +int dpkgEVRcompare(const EVR_t a, const EVR_t b)
  +{
  +    int r;
  +
  +    if (a->Elong > b->Elong) return 1;
  +    if (a->Elong < b->Elong) return -1;
  +    r = dpkgEVRcmp(a->V, b->V);  if (r) return r;
  +    return dpkgEVRcmp(a->R, b->R);
  +}
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmdb/rpmdpkg.h
  ============================================================================
  $ cvs diff -u -r0 -r1.1 rpmdpkg.h
  --- /dev/null	2008-06-20 13:00:06 +0200
  +++ rpmdpkg.h	2008-06-20 13:09:46 +0200
  @@ -0,0 +1,53 @@
  +#ifndef H_RPMDPKG
  +#define H_RPMDPKG
  +
  +/** \ingroup rpmds
  + * \file lib/rpmdpkg.h
  + * Structure(s) and routine(s) used for dpkg EVR parsing and comparison.
  + */
  +
  +#include "rpmevr.h"
  +
  +/**
  + */
  +/*@-exportlocal@*/
  +/*@unchecked@*/
  +extern int _rpmdpkg_debug;
  +/*@=exportlocal@*/
  +
  +#ifdef __cplusplus
  +extern "C" {
  +#endif
  +
  +/** \ingroup rpmds
  + * Segmented string compare.
  + * @param a		1st string
  + * @param b		2nd string
  + * @return		+1 if a is "newer", 0 if equal, -1 if b is "newer"
  + */
  +int dpkgEVRcmp(const char *a, const char *b)
  +	/*@*/;
  +
  +/** \ingroup rpmds
  + * Split EVR string into epoch, version, and release components.
  + * @param evrstr	[epoch:]version[-release] string
  + * @retval *evr		parse results
  + * @return		0 always
  + */
  +int dpkgEVRparse(const char * evrstr, EVR_t evr)
  +	/*@modifies evrstr, evr @*/;
  +
  +/** \ingroup rpmds
  + * Compare EVR containers.
  + * @param a		1st EVR container
  + * @param b		2nd EVR container
  + * @return		+1 if a is "newer", 0 if equal, -1 if b is "newer"
  + */
  +int dpkgEVRcompare(const EVR_t a, const EVR_t b)
  +	/*@*/;
  +
  +#ifdef __cplusplus
  +}
  +#endif
  +
  +#endif	/* H_RPMDPKG */
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmdb/rpmevr.c
  ============================================================================
  $ cvs diff -u -r0 -r1.1 rpmevr.c
  --- /dev/null	2008-06-20 13:00:06 +0200
  +++ rpmevr.c	2008-06-20 13:09:46 +0200
  @@ -0,0 +1,207 @@
  +/** \ingroup rpmds
  + * \file lib/rpmevr.c
  + */
  +#include "system.h"
  +
  +#include <rpmio.h>
  +
  +#define	_RPMEVR_INTERNAL
  +#include <rpmevr.h>
  +
  +#include "debug.h"
  +
  +/*@unchecked@*/
  +int _rpmevr_debug = 0;
  +
  +#if !defined(MAX)
  +#define MAX(x, y) ( ((x)>(y))?(x):(y) )
  +#endif
  +
  +/* XXX Force digits to beat alphas. See bugzilla #50977. */
  +/*@unchecked@*/
  +static int _invert_digits_alphas_comparison = -1;
  +
  +/* XXX Punctuation characters that are not treated as alphas */
  +/*@unchecked@*/ /*@observer@*/
  +static const char * _rpmnotalpha = ".:-";
  +
  +/**
  + * Return rpm's analogue of xisalpha.
  + * @param c		character to test
  + * @return		is this an alpha character?
  + */
  +static inline int xisrpmalpha(int c)
  +	/*@*/
  +{
  +    int rc = xisalpha(c);
  +    if (!rc)
  +	rc = xispunct(c);
  +    if (rc && _rpmnotalpha && *_rpmnotalpha)
  +	rc = (strchr(_rpmnotalpha, c) == NULL);
  +    return rc;
  +}
  +
  +int rpmEVRcmp(const char * a, const char * b)
  +	/*@*/
  +{
  +    const char * ae, * be;
  +    int rc = 0;
  +
  +    /* Compare version strings segment by segment. */
  +    for (; *a && *b && rc == 0; a = ae, b = be) {
  +
  +	/* Skip leading non-alpha, non-digit characters. */
  +	while (*a && !(xisdigit(*a) || xisrpmalpha(*a))) a++;
  +	while (*b && !(xisdigit(*b) || xisrpmalpha(*b))) b++;
  +
  +	/* Digit string comparison? */
  +#if defined(RPM_VENDOR_OPENPKG) /* support-wildcards-in-EVR-comparison */
  +        if (a[0] == '*') {
  +            ae = a + 1;
  +            if ((be = strchr(b, a[1])) == NULL)
  +                be = b;
  +        }
  +        else if (b[0] == '*') {
  +            be = b + 1;
  +            if ((ae = strchr(a, b[1])) == NULL)
  +                ae = a;
  +        }
  +        else
  +#endif
  +	if (xisdigit(*a) || xisdigit(*b)) {
  +	    /* Discard leading zeroes. */
  +	    while (a[0] == '0' && xisdigit(a[1])) a++;
  +	    while (b[0] == '0' && xisdigit(b[1])) b++;
  +
  +	    /* Find end of digit strings. */
  +	    ae = a; while (xisdigit(*ae)) ae++;
  +	    be = b; while (xisdigit(*be)) be++;
  +
  +	    /* Calculate digit comparison return code. */
  +	    if (a == ae || b == be)
  +		rc = (*b - *a) * _invert_digits_alphas_comparison;
  +	    else {
  +		rc = (ae - a) - (be - b);
  +		if (!rc)
  +		    rc = strncmp(a, b, (ae - a));
  +	    }
  +	} else {
  +	    /* Find end of alpha strings. */
  +	    ae = a; while (xisrpmalpha(*ae)) ae++;
  +	    be = b; while (xisrpmalpha(*be)) be++;
  +
  +	    /* Calculate alpha comparison return code. */
  +	    rc = strncmp(a, b, MAX((ae - a), (be - b)));
  +	}
  +    }
  +
  +    /* Longer string wins. */
  +    if (!rc)
  +	rc = (*a - *b);
  +
  +    /* Force strict -1, 0, 1 return. */
  +    rc = (rc > 0 ? 1
  +	: rc < 0 ? -1
  +	: 0);
  +    return rc;
  +}
  +
  +int rpmEVRparse(const char * evrstr, EVR_t evr)
  +	/*@modifies evrstr, evr @*/
  +{
  +    char *s = xstrdup(evrstr);
  +    char *se;
  +
  +    evr->str = se = s;
  +    while (*se && xisdigit(*se)) se++;	/* se points to epoch terminator */
  +
  +    if (*se == ':') {
  +	evr->E = s;
  +	*se++ = '\0';
  +	evr->V = se;
  +	if (*evr->E == '\0') evr->E = "0";
  +	evr->Elong = strtoul(evr->E, NULL, 10);
  +    } else {
  +	evr->E = NULL;	/* XXX disable epoch compare if missing */
  +	evr->V = s;
  +	evr->Elong = 0;
  +    }
  +    se = strrchr(se, '-');		/* se points to version terminator */
  +    if (se) {
  +	*se++ = '\0';
  +	evr->R = se;
  +    } else {
  +	evr->R = NULL;
  +    }
  +    return 0;
  +}
  +
  +/**
  + * Dressed rpmEVRcmp, handling missing values.
  + * @param a		1st string
  + * @param b		2nd string
  + * @return		+1 if a is "newer", 0 if equal, -1 if b is "newer"
  + */
  +static int compare_values(const char *a, const char *b)
  +	/*@*/
  +{
  +    return rpmvercmp(a, b);
  +}
  +
  +int rpmEVRcompare(const EVR_t a, const EVR_t b)
  +{
  +    int rc = 0;
  +
  +    if (!rc)
  +	rc = compare_values(a->E, b->E);
  +    if (!rc)
  +	rc = compare_values(a->V, b->V);
  +    if (!rc)
  +	rc = compare_values(a->R, b->R);
  +    return rc;
  +}
  +
  +int (*rpmvercmp) (const char *a, const char *b) = rpmEVRcmp;
  +
  +/**
  + */
  +/*@unchecked@*/ /*@observer@*/
  +static struct EVRop_s {
  +/*@observer@*/ /*@null@*/
  +    const char * operator;
  +    rpmsenseFlags sense;
  +} cops[] = {
  +    { "<=", RPMSENSE_LESS ^ RPMSENSE_EQUAL},
  +    { "=<", RPMSENSE_LESS ^ RPMSENSE_EQUAL},
  +
  +    { "==", RPMSENSE_EQUAL},
  +    { "!=", RPMSENSE_NOTEQUAL},
  +    
  +    { ">=", RPMSENSE_GREATER ^ RPMSENSE_EQUAL},
  +    { "=>", RPMSENSE_GREATER ^ RPMSENSE_EQUAL},
  +
  +    { "<", RPMSENSE_LESS},
  +    { "=", RPMSENSE_EQUAL},
  +    { ">", RPMSENSE_GREATER},
  +
  +    { NULL, 0 },
  +};
  +
  +rpmsenseFlags rpmEVRflags(const char *op, const char **end)
  +{
  +    rpmsenseFlags Flags = 0;
  +    struct EVRop_s *cop;
  +
  +    if (op == NULL || *op == '\0')
  +	Flags = RPMSENSE_EQUAL;
  +    else
  +    for (cop = cops; cop->operator != NULL; cop++) {
  +	if (strncmp(op, cop->operator, strlen(cop->operator)))
  +	    continue;
  +	Flags = cop->sense;
  +	if (end)
  +	    *end = op + strlen(cop->operator);
  +	break;
  +    }
  +    return Flags;
  +}
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmdb/rpmevr.h
  ============================================================================
  $ cvs diff -u -r0 -r1.1 rpmevr.h
  --- /dev/null	2008-06-20 13:00:06 +0200
  +++ rpmevr.h	2008-06-20 13:09:46 +0200
  @@ -0,0 +1,173 @@
  +#ifndef H_RPMEVR
  +#define H_RPMEVR
  +
  +/** \ingroup rpmds
  + * \file lib/rpmevr.h
  + * Structure(s) and routine(s) used for EVR parsing and comparison.
  + */
  +
  +#ifdef __cplusplus
  +extern "C" {
  +#endif
  +
  +/**
  + */
  +/*@-exportlocal@*/
  +/*@unchecked@*/
  +extern int _rpmevr_debug;
  +/*@=exportlocal@*/
  +
  +typedef	/*@abstract@*/ struct EVR_s * EVR_t;
  +
  +/**
  + * Dependency Attributes.
  + */
  +/*@-matchfields@*/
  +typedef enum evrFlags_e {
  +#if defined(_RPMEVR_INTERNAL)
  +    RPMSENSE_ANY	= 0,
  +/*@-enummemuse@*/
  +    RPMSENSE_SERIAL	= (1 << 0),	/*!< (obsolete). */
  +/*@=enummemuse@*/
  +#endif
  +    RPMSENSE_LESS	= (1 << 1),
  +    RPMSENSE_GREATER	= (1 << 2),
  +    RPMSENSE_EQUAL	= (1 << 3),
  +#if defined(_RPMEVR_INTERNAL)
  +    RPMSENSE_PROVIDES	= (1 << 4), /* only used internally by builds */
  +    RPMSENSE_CONFLICTS	= (1 << 5), /* only used internally by builds */
  +#endif
  +    RPMSENSE_PREREQ	= (1 << 6),	/*!< (obsolete). */
  +#if defined(_RPMEVR_INTERNAL)
  +    RPMSENSE_OBSOLETES	= (1 << 7), /* only used internally by builds */
  +    RPMSENSE_INTERP	= (1 << 8),	/*!< Interpreter used by scriptlet. */
  +    RPMSENSE_SCRIPT_PRE	= (1 << 9),	/*!< %pre dependency. */
  +    RPMSENSE_SCRIPT_POST = (1 << 10),	/*!< %post dependency. */
  +    RPMSENSE_SCRIPT_PREUN = (1 << 11),	/*!< %preun dependency. */
  +    RPMSENSE_SCRIPT_POSTUN = (1 << 12), /*!< %postun dependency. */
  +    RPMSENSE_SCRIPT_VERIFY = (1 << 13),	/*!< %verify dependency. */
  +    RPMSENSE_FIND_REQUIRES = (1 << 14), /*!< find-requires dependency. */
  +    RPMSENSE_FIND_PROVIDES = (1 << 15), /*!< find-provides dependency. */
  +
  +    RPMSENSE_TRIGGERIN	= (1 << 16),	/*!< %triggerin dependency. */
  +    RPMSENSE_TRIGGERUN	= (1 << 17),	/*!< %triggerun dependency. */
  +    RPMSENSE_TRIGGERPOSTUN = (1 << 18),	/*!< %triggerpostun dependency. */
  +    RPMSENSE_MISSINGOK	= (1 << 19),	/*!< suggests/enhances hint. */
  +    RPMSENSE_SCRIPT_PREP = (1 << 20),	/*!< %prep build dependency. */
  +    RPMSENSE_SCRIPT_BUILD = (1 << 21),	/*!< %build build dependency. */
  +    RPMSENSE_SCRIPT_INSTALL = (1 << 22),/*!< %install build dependency. */
  +    RPMSENSE_SCRIPT_CLEAN = (1 << 23),	/*!< %clean build dependency. */
  +    RPMSENSE_RPMLIB = (1 << 24),	/*!< rpmlib(feature) dependency. */
  +    RPMSENSE_TRIGGERPREIN = (1 << 25),	/*!< %triggerprein dependency. */
  +    RPMSENSE_KEYRING	= (1 << 26),
  +    RPMSENSE_STRONG	= (1 << 27),	/*!< placeholder SuSE */
  +    RPMSENSE_CONFIG	= (1 << 28),
  +    RPMSENSE_PROBE	= (1 << 29),
  +    RPMSENSE_PACKAGE	= (1 << 30),
  +    RPMSENSE_SCRIPT_SANITYCHECK = (1 << 31) /*!< %sanitycheck dependency. */
  +#endif
  +} evrFlags;
  +/*@=matchfields@*/
  +
  +typedef enum evrFlags_e rpmsenseFlags;
  +
  +#define	RPMSENSE_SENSEMASK	0x0e	 /* Mask to get senses, ie serial, */
  +                                         /* less, greater, equal.          */
  +#define	RPMSENSE_NOTEQUAL	(RPMSENSE_EQUAL ^ RPMSENSE_SENSEMASK)
  +
  +#if defined(_RPMEVR_INTERNAL)
  +/** \ingroup rpmds
  + * An EVR parsing container.
  + */
  +struct EVR_s {
  +    const char * str;		/*!< EVR storage */
  +/*@observer@*/ /*@null@*/
  +    const char * E;		/*!< Epoch */
  +    unsigned long Elong;
  +/*@observer@*/ /*@null@*/
  +    const char * V;		/*!< Version */
  +/*@observer@*/ /*@null@*/
  +    const char * R;		/*!< Release */
  +    evrFlags Flags;		/*!< EVR comparison flags. */
  +};
  +
  +#define	RPMSENSE_TRIGGER	\
  +	(RPMSENSE_TRIGGERPREIN | RPMSENSE_TRIGGERIN | RPMSENSE_TRIGGERUN | RPMSENSE_TRIGGERPOSTUN)
  +
  +#define	_ALL_REQUIRES_MASK	(\
  +    RPMSENSE_INTERP | \
  +    RPMSENSE_SCRIPT_PRE | \
  +    RPMSENSE_SCRIPT_POST | \
  +    RPMSENSE_SCRIPT_PREUN | \
  +    RPMSENSE_SCRIPT_POSTUN | \
  +    RPMSENSE_SCRIPT_VERIFY | \
  +    RPMSENSE_FIND_REQUIRES | \
  +    RPMSENSE_MISSINGOK | \
  +    RPMSENSE_SCRIPT_PREP | \
  +    RPMSENSE_SCRIPT_BUILD | \
  +    RPMSENSE_SCRIPT_INSTALL | \
  +    RPMSENSE_SCRIPT_CLEAN | \
  +    RPMSENSE_RPMLIB | \
  +    RPMSENSE_KEYRING | \
  +    RPMSENSE_PACKAGE )
  +
  +#define	_notpre(_x)		((_x) & ~RPMSENSE_PREREQ)
  +#define	_INSTALL_ONLY_MASK \
  +    _notpre(RPMSENSE_SCRIPT_PRE|RPMSENSE_SCRIPT_POST|RPMSENSE_RPMLIB|RPMSENSE_KEYRING)
  +#define	_ERASE_ONLY_MASK  \
  +    _notpre(RPMSENSE_SCRIPT_PREUN|RPMSENSE_SCRIPT_POSTUN)
  +
  +#define	isInstallPreReq(_x)	((_x) & _INSTALL_ONLY_MASK)
  +#define	isErasePreReq(_x)	((_x) & _ERASE_ONLY_MASK)
  +#endif	/* _RPMEVR_INTERNAL */
  +
  +/** \ingroup rpmds
  + * Segmented string compare.
  + * @param a		1st string
  + * @param b		2nd string
  + * @return		+1 if a is "newer", 0 if equal, -1 if b is "newer"
  + */
  +int rpmEVRcmp(const char *a, const char *b)
  +	/*@*/;
  +
  +/** \ingroup rpmds
  + * Split EVR string into epoch, version, and release components.
  + * @param evrstr	[epoch:]version[-release] string
  + * @retval *evr		parse results
  + * @return		0 always
  + */
  +int rpmEVRparse(const char * evrstr, EVR_t evr)
  +	/*@modifies evrstr, evr @*/;
  +
  +/** \ingroup rpmds
  + * Compare EVR containers.
  + * @param a		1st EVR container
  + * @param b		2nd EVR container
  + * @return		+1 if a is "newer", 0 if equal, -1 if b is "newer"
  + */
  +int rpmEVRcompare(const EVR_t a, const EVR_t b)
  +	/*@*/;
  +
  +/** \ingroup rpmds
  + * Segmented string compare vector.
  + * @param a		1st string
  + * @param b		2nd string
  + * @return		+1 if a is "newer", 0 if equal, -1 if b is "newer"
  + */
  +extern int (*rpmvercmp)(const char *a, const char *b)
  +	/*@*/;
  +
  +/**
  + * Return comparison operator sense flags.
  + * @param op		operator string (NULL or "" uses RPMSENSE_EQUAL)
  + * @param *end		pointer to 1st character after operator (or NULL)
  + * @return		sense flags
  + */
  +rpmsenseFlags rpmEVRflags(/*@null@*/const char *op, /*@null@*/const char **end)
  +	/*@modifies *end @*/;
  +
  +#ifdef __cplusplus
  +}
  +#endif
  +
  +#endif	/* H_RPMEVR */
  @@ .
______________________________________________________________________
RPM Package Manager                                    http://rpm5.org
CVS Sources Repository                                rpm-cvs@rpm5.org
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic