RPM Package Manager, CVS Repository
http://rpm5.org/cvs/
____________________________________________________________________________
Server: rpm5.org Name: Ralf S. Engelschall
Root: /v/rpm/cvs Email: rse@rpm5.org
Module: rpm Date: 01-Feb-2008 08:32:32
Branch: HEAD Handle: 2008020107323101
Modified files:
rpm CHANGES
rpm/lib depends.c psm.c rpmte.c rpmte.h
rpm/rpmdb rpmtag.h
Log:
Provide both ORIGINTIME (based on INSTALLTIME) and ORIGINTID (based on
INSTALLTID)
Summary:
Revision Changes Path
1.2119 +1 -0 rpm/CHANGES
1.387 +7 -0 rpm/lib/depends.c
2.284 +9 -1 rpm/lib/psm.c
2.75 +6 -0 rpm/lib/rpmte.c
2.44 +9 -0 rpm/lib/rpmte.h
1.38 +2 -1 rpm/rpmdb/rpmtag.h
____________________________________________________________________________
patch -p0 <<'@@ .'
Index: rpm/CHANGES
============================================================================
$ cvs diff -u -r1.2118 -r1.2119 CHANGES
--- rpm/CHANGES 1 Feb 2008 01:23:51 -0000 1.2118
+++ rpm/CHANGES 1 Feb 2008 07:32:31 -0000 1.2119
@@ -1,4 +1,5 @@
5.0.0 -> 5.1a1:
+ - rse: provide both ORIGINTIME (based on INSTALLTIME) and ORIGINTID (based on INSTALLTID)
- jbj: pedantic identification of Foo (not foo) syscalls in --fsmdebug spew.
- jbj: fix: --rollback PSM_INIT changes added fstates before initialize.
- rse: ensure macro option parsing is done correctly also under GLIBC by not allowing option/argument permutations
@@ .
patch -p0 <<'@@ .'
Index: rpm/lib/depends.c
============================================================================
$ cvs diff -u -r1.386 -r1.387 depends.c
--- rpm/lib/depends.c 31 Jan 2008 18:46:28 -0000 1.386
+++ rpm/lib/depends.c 1 Feb 2008 07:32:31 -0000 1.387
@@ -419,6 +419,13 @@
continue;
/* Snarf the original install time from older package(s). */
+ he->tag = RPMTAG_ORIGINTID;
+ xx = headerGet(oh, he, 0);
+ if (xx && he->p.ui32p != NULL) {
+ if (p->originTid == 0 || p->originTid > he->p.ui32p[0])
+ p->originTid = he->p.ui32p[0];
+ he->p.ptr = _free(he->p.ptr);
+ }
he->tag = RPMTAG_ORIGINTIME;
xx = headerGet(oh, he, 0);
if (xx && he->p.ui32p != NULL) {
@@ .
patch -p0 <<'@@ .'
Index: rpm/lib/psm.c
============================================================================
$ cvs diff -u -r2.283 -r2.284 psm.c
--- rpm/lib/psm.c 31 Jan 2008 21:33:08 -0000 2.283
+++ rpm/lib/psm.c 1 Feb 2008 07:32:31 -0000 2.284
@@ -1551,6 +1551,7 @@
uint32_t tscolor = rpmtsColor(ts);
uint32_t tecolor = rpmteColor(te);
uint32_t installTime = (uint32_t) time(NULL);
+ uint32_t originTid = rpmteOriginTid(te);
uint32_t originTime = rpmteOriginTime(te);
int xx = 1;
@@ -1563,8 +1564,15 @@
xx = headerPut(fi->h, he, 0);
/* Propagate the time that the package was first installed. */
+ if (originTid == 0)
+ originTid = rpmtsGetTid(ts);
+ he->tag = RPMTAG_ORIGINTID;
+ he->t = RPM_UINT32_TYPE;
+ he->p.ui32p = &originTid;
+ he->c = 1;
+ xx = headerPut(fi->h, he, 0);
if (originTime == 0)
- originTime = rpmtsGetTid(ts);
+ originTime = installTime;
he->tag = RPMTAG_ORIGINTIME;
he->t = RPM_UINT32_TYPE;
he->p.ui32p = &originTime;
@@ .
patch -p0 <<'@@ .'
Index: rpm/lib/rpmte.c
============================================================================
$ cvs diff -u -r2.74 -r2.75 rpmte.c
--- rpm/lib/rpmte.c 30 Jan 2008 21:39:30 -0000 2.74
+++ rpm/lib/rpmte.c 1 Feb 2008 07:32:31 -0000 2.75
@@ -181,6 +181,7 @@
p->replaced = NULL;
p->pkgFileSize = 0;
+ p->originTid = 0;
p->originTime = 0;
p->PRCO = rpmdsNewPRCO(h);
@@ -328,6 +329,11 @@
return (te != NULL ? te->pkgFileSize : 0);
}
+uint32_t rpmteOriginTid(rpmte te)
+{
+ return (te != NULL ? te->originTid : 0);
+}
+
uint32_t rpmteOriginTime(rpmte te)
{
return (te != NULL ? te->originTime : 0);
@@ .
patch -p0 <<'@@ .'
Index: rpm/lib/rpmte.h
============================================================================
$ cvs diff -u -r2.43 -r2.44 rpmte.h
--- rpm/lib/rpmte.h 30 Jan 2008 21:39:30 -0000 2.43
+++ rpm/lib/rpmte.h 1 Feb 2008 07:32:31 -0000 2.44
@@ -148,6 +148,7 @@
struct rpmChainLink_s flink;/*!< Forward link info to installed element. */
int linkFailed; /*!< Did the linked element upgrade succeed? */
int done; /*!< Has the element been installed/erased? */
+ uint32_t originTid; /*!< Time of transaction that package was first installed. */
uint32_t originTime; /*!< Time that package was first installed. */
int installed; /*!< Was the header installed? */
@@ -343,6 +344,14 @@
/*@*/;
/** \ingroup rpmte
+ * Retrieve transaction start time that package was first installed.
+ * @param te transaction element
+ * @return origin time
+ */
+uint32_t rpmteOriginTid(rpmte te)
+ /*@*/;
+
+/** \ingroup rpmte
* Retrieve time that package was first installed.
* @param te transaction element
* @return origin time
@@ .
patch -p0 <<'@@ .'
Index: rpm/rpmdb/rpmtag.h
============================================================================
$ cvs diff -u -r1.37 -r1.38 rpmtag.h
--- rpm/rpmdb/rpmtag.h 31 Jan 2008 07:26:12 -0000 1.37
+++ rpm/rpmdb/rpmtag.h 1 Feb 2008 07:32:32 -0000 1.38
@@ -412,7 +412,8 @@
RPMTAG_SANITYCHECKPROG = 1206, /* s */
RPMTAG_FILESTAT = 1207, /* s[] stat(2) from metadata extension*/
RPMTAG_STAT = 1208, /* s[] stat(2) from disk extension */
- RPMTAG_ORIGINTIME = 1209, /* i */
+ RPMTAG_ORIGINTID = 1209, /* i */
+ RPMTAG_ORIGINTIME = 1210, /* i */
/*@-enummemuse@*/
RPMTAG_FIRSTFREE_TAG /*!< internal */
@@ .
Received on Fri Feb 1 08:32:32 2008