RPM Community Forums

Mailing List Message of <rpm-devel>

Re: [CVS] RPM: rpm/ CHANGES rpm/lib/ depends.c librpm.vers rpmte.c rpmte.h

From: Jeff Johnson <n3npq@mac.com>
Date: Thu 22 May 2008 - 18:20:33 CEST
Message-id: <0A0FA54F-4C1F-4016-8C81-D8A80EAC28A6@mac.com>
This change likely needs some context ...

There's a desire to manage -debuginfo*.rpm packages through upgrades.

But an upgrade for -debuginfo packages needs (imho) a different
upgrade model.

You can see my attempt to describe what I think is needed for -debuginfo
upgrades at comment #4 here:
     https://bugzilla.redhat.com/show_bug.cgi?id=447708

So I need a set membership marker for all packages (including - 
debuginfo) that
were created during a single build.

The ideal choice for a "build set marker" would be the new-fangled
ELF buildid. The buildid is based on a SHA-1 and is supposed to
insensitive to the aliasing issues involved with rebuilding a package.

Alas, there are portability issues using buildid on non-ELF systems. And
I haven't bothered to extract the buildid to include in package  
metadata (yet).

My 2nd choice for a set marker would have been RPMTAG_SOURCEPKGID,
which is also unique and mostly insensitive to rebuild liasing issues.

Alas, rpm.org is used by Fedora and does not support RPMTAG_SOURCEPKGID.
<... I'm tempted to say some unkind words here ... >

So I will use RPMTAG_SOURCERPM as a build set marker in order to get
the logic in place to decide when a -debuginfo should be upgraded or  
erased.
The RPMTAG_SOURCERPM has all the usual well known issues with
rebuild aliasing, but will suffice for a development (and non-ELF)  
build set marker.

The upgrade/erase logic for -debuginfo is described at the URL above.

Basically, the measure of the build set will be used as a reference  
count when a -debuginfo package
has been installed to decide if/when a -debuginfo package should be
automagically erased.

hth

73 de Jeff

On May 22, 2008, at 12:03 PM, Jeff Johnson wrote:

>   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-May-2008  
> 18:03:09
>   Branch: HEAD                             Handle: 2008052216030900
>
>   Modified files:
>     rpm                     CHANGES
>     rpm/lib                 depends.c librpm.vers rpmte.c rpmte.h
>
>   Log:
>     - jbj: rpmte: add rpmteSourcerpm() (for use as a -debuginfo  
> buildset
>     key).
>
>   Summary:
>     Revision    Changes     Path
>     1.2360      +1  -0      rpm/CHANGES
>     1.398       +1  -1      rpm/lib/depends.c
>     1.40        +1  -0      rpm/lib/librpm.vers
>     2.83        +14 -4      rpm/lib/rpmte.c
>     2.48        +13 -0      rpm/lib/rpmte.h
>    
> ______________________________________________________________________ 
> ______
>
>   patch -p0 <<'@@ .'
>   Index: rpm/CHANGES
>    
> ====================================================================== 
> ======
>   $ cvs diff -u -r1.2359 -r1.2360 CHANGES
>   --- rpm/CHANGES	22 May 2008 15:06:51 -0000	1.2359
>   +++ rpm/CHANGES	22 May 2008 16:03:09 -0000	1.2360
>   @@ -1,5 +1,6 @@
>
>    5.1.0 -> 5.2a0:
>   +    - jbj: rpmte: add rpmteSourcerpm() (for use as a -debuginfo  
> buildset key).
>        - jbj: fix: skip the :extractor/|transformer mark  
> checking :xml/:yaml.
>        - jbj: splint: annotate argvAppend differently.
>        - jbj: hdrfmt: return failure if PACKAGE{ORIGIN,DIGEST} do  
> not exist.
>   @@ .
>   patch -p0 <<'@@ .'
>   Index: rpm/lib/depends.c
>    
> ====================================================================== 
> ======
>   $ cvs diff -u -r1.397 -r1.398 depends.c
>   --- rpm/lib/depends.c	19 May 2008 06:00:03 -0000	1.397
>   +++ rpm/lib/depends.c	22 May 2008 16:03:09 -0000	1.398
>   @@ -482,11 +482,11 @@
>
>    	/* Ignore colored obsoletes not in our rainbow. */
>    #if 0
>   +	/* XXX obsoletes are never colored, so this is for future  
> devel. */
>    	dscolor = rpmdsColor(obsoletes);
>    #else
>    	dscolor = hcolor;
>    #endif
>   -	/* XXX obsoletes are never colored, so this is for future  
> devel. */
>    	if (tscolor && dscolor && !(tscolor & dscolor))
>    	    continue;
>
>   @@ .
>   patch -p0 <<'@@ .'
>   Index: rpm/lib/librpm.vers
>    
> ====================================================================== 
> ======
>   $ cvs diff -u -r1.39 -r1.40 librpm.vers
>   --- rpm/lib/librpm.vers	18 Mar 2008 22:02:50 -0000	1.39
>   +++ rpm/lib/librpm.vers	22 May 2008 16:03:09 -0000	1.40
>   @@ -319,6 +319,7 @@
>        rpmteSetNpreds;
>        rpmteSetParent;
>        rpmteSetTree;
>   +    rpmteSourcerpm;
>        rpmteTree;
>        rpmteTSI;
>        rpmteType;
>   @@ .
>   patch -p0 <<'@@ .'
>   Index: rpm/lib/rpmte.c
>    
> ====================================================================== 
> ======
>   $ cvs diff -u -r2.82 -r2.83 rpmte.c
>   --- rpm/lib/rpmte.c	17 Apr 2008 06:59:02 -0000	2.82
>   +++ rpm/lib/rpmte.c	22 May 2008 16:03:09 -0000	2.83
>   @@ -63,6 +63,7 @@
>        p->NEVRA = _free(p->NEVRA);
>        p->pkgid = _free(p->pkgid);
>        p->hdrid = _free(p->hdrid);
>   +    p->sourcerpm = _free(p->sourcerpm);
>
>        p->replaced = _free(p->replaced);
>
>   @@ -117,10 +118,6 @@
>
>        p->db_instance = 0;
>
>   -    he->tag = RPMTAG_HDRID;
>   -    xx = headerGet(h, he, 0);
>   -    p->hdrid = (xx ? he->p.str : xstrdup("?RPMTAG_HDRID?"));
>   -
>        he->tag = RPMTAG_PKGID;
>        xx = headerGet(h, he, 0);
>        if (he->p.ui8p != NULL) {
>   @@ -138,6 +135,14 @@
>        } else
>    	p->pkgid = NULL;
>
>   +    he->tag = RPMTAG_HDRID;
>   +    xx = headerGet(h, he, 0);
>   +    p->hdrid = (xx ? he->p.str : xstrdup("?RPMTAG_HDRID?"));
>   +
>   +    he->tag = RPMTAG_SOURCERPM;
>   +    xx = headerGet(h, he, 0);
>   +    p->sourcerpm = (xx ? he->p.str : NULL);
>   +
>        he->tag = RPMTAG_ARCH;
>        xx = headerGet(h, he, 0);
>        p->arch = (xx ? he->p.str : xstrdup("?RPMTAG_ARCH?"));
>   @@ -512,6 +517,11 @@
>        return (te != NULL ? te->hdrid : NULL);
>    }
>
>   +const char * rpmteSourcerpm(rpmte te)
>   +{
>   +    return (te != NULL ? te->sourcerpm : NULL);
>   +}
>   +
>    FD_t rpmteFd(rpmte te)
>    {
>        /*@-compdef -refcounttrans -retalias -retexpose -usereleased  
> @*/
>   @@ .
>   patch -p0 <<'@@ .'
>   Index: rpm/lib/rpmte.h
>    
> ====================================================================== 
> ======
>   $ cvs diff -u -r2.47 -r2.48 rpmte.h
>   --- rpm/lib/rpmte.h	12 Mar 2008 18:11:08 -0000	2.47
>   +++ rpm/lib/rpmte.h	22 May 2008 16:03:09 -0000	2.48
>   @@ -99,6 +99,8 @@
>        const char * pkgid;		/*!< Package identifier (header+payload  
> md5). */
>    /*@only@*/ /*@relnull@*/
>        const char * hdrid;		/*!< Package header identifier (header  
> sha1). */
>   +/*@only@*/ /*@null@*/
>   +    const char * sourcerpm;	/*!< Source package. */
>    /*@owned@*/
>        const char * name;		/*!< Name: */
>    /*@only@*/ /*@null@*/
>   @@ -565,6 +567,17 @@
>    /*@=exportlocal@*/
>
>    /** \ingroup rpmte
>   + * Retrieve sourcerpm string from transaction element.
>   + * @param te		transaction element
>   + * @return		sourcerpm string
>   + */
>   +/*@-exportlocal@*/
>   +/*@observer@*/ /*@null@*/
>   +extern const char * rpmteSourcerpm(rpmte te)
>   +	/*@*/;
>   +/*@=exportlocal@*/
>   +
>   +/** \ingroup rpmte
>     * Retrieve file handle from transaction element.
>     * @param te		transaction element
>     * @return		file handle
>   @@ .
> ______________________________________________________________________
> RPM Package Manager                                    http://rpm5.org
> CVS Sources Repository                                rpm-cvs@rpm5.org
Received on Thu May 22 18:22:40 2008
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.