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: 07-Dec-2007 00:32:05
Branch: HEAD Handle: 2007120623320401
Modified files:
rpm CHANGES TODO
rpm/lib depends.c psm.c rpmlib.h rpmns.c rpmns.h verify.c
Log:
- stub in Requires: sanitycheck(N) probe. needs to run the script, duh.
- drill sanitycheck exec into psmStage() like %verifyscript.
Summary:
Revision Changes Path
1.1956 +2 -0 rpm/CHANGES
1.46 +0 -1 rpm/TODO
1.370 +22 -1 rpm/lib/depends.c
2.276 +2 -0 rpm/lib/psm.c
2.457 +1 -0 rpm/lib/rpmlib.h
1.6 +2 -0 rpm/lib/rpmns.c
1.8 +1 -0 rpm/lib/rpmns.h
2.182 +7 -1 rpm/lib/verify.c
____________________________________________________________________________
patch -p0 <<'@@ .'
Index: rpm/CHANGES
============================================================================
$ cvs diff -u -r1.1955 -r1.1956 CHANGES
--- rpm/CHANGES 6 Dec 2007 23:24:44 -0000 1.1955
+++ rpm/CHANGES 6 Dec 2007 23:32:04 -0000 1.1956
@@ -1,4 +1,6 @@
5.0a4 -> 5.0b1:
+ - jbj: stub in Requires: sanitycheck(N) probe. needs to run the script, duh.
+ - jbj: drill sanitycheck exec into psmStage() like %verifyscript.
- jbj: --rebuilddb has too many NOKEY's using rpmnss. use rpmbc in beta1.
- jbj: fix: rpmbuild --sign needed to test for password entry.
- jbj: display the rpmlib Version/Timestamp/Vendor markers lest I forget.
@@ .
patch -p0 <<'@@ .'
Index: rpm/TODO
============================================================================
$ cvs diff -u -r1.45 -r1.46 TODO
--- rpm/TODO 6 Dec 2007 23:24:44 -0000 1.45
+++ rpm/TODO 6 Dec 2007 23:32:04 -0000 1.46
@@ -93,7 +93,6 @@
- jbj: add the wiring for RPMTAG_CLASS as an arbitrary tag.
- jbj: change RPM_I18NSTRING_TYPE wiring to use arbitrary tag.
- jbj: hmm RPMTAG_TRACK contents not added to *.rpm yet.
- - jbj: drill sanitycheck exec into psmStage() like %verifyscript.
- jbj: add Requires: sanitycheck(N) runtime namespace probe.
o to be resolved before RPM 5.0.0:
@@ .
patch -p0 <<'@@ .'
Index: rpm/lib/depends.c
============================================================================
$ cvs diff -u -r1.369 -r1.370 depends.c
--- rpm/lib/depends.c 3 Dec 2007 21:11:53 -0000 1.369
+++ rpm/lib/depends.c 6 Dec 2007 23:32:05 -0000 1.370
@@ -890,6 +890,28 @@
goto exit;
}
+ if (NSType == RPMNS_TYPE_SANITY) {
+ /* XXX only the installer does not have the database open here. */
+ rc = 1; /* assume failure */
+ if (rpmtsGetRdb(ts) != NULL) {
+ mi = rpmtsInitIterator(ts, RPMTAG_PROVIDENAME, Name, 0);
+ while ((h = rpmdbNextIterator(mi)) != NULL) {
+ if (!rpmdsAnyMatchesDep(h, dep, _rpmds_nopromote))
+ continue;
+ rc = (headerIsEntry(h, RPMTAG_SANITYCHECK) == 0);
+ if (rc == 0) {
+ /* XXX FIXME: actually run the sanitycheck script. */
+ break;
+ }
+ }
+ mi = rpmdbFreeIterator(mi);
+ }
+ if (Flags & RPMSENSE_MISSINGOK)
+ goto unsatisfied;
+ rpmdsNotify(dep, _("(sanity probe)"), rc);
+ goto exit;
+ }
+
/* Search system configured provides. */
if (sysinfo_path == NULL) {
sysinfo_path = rpmExpand("%{?_rpmds_sysinfo_path}", NULL);
@@ -1049,7 +1071,6 @@
}
}
mi = rpmdbFreeIterator(mi);
-
}
/*
@@ .
patch -p0 <<'@@ .'
Index: rpm/lib/psm.c
============================================================================
$ cvs diff -u -r2.275 -r2.276 psm.c
--- rpm/lib/psm.c 6 Dec 2007 21:21:06 -0000 2.275
+++ rpm/lib/psm.c 6 Dec 2007 23:32:05 -0000 2.276
@@ -451,6 +451,7 @@
case RPMTAG_POSTTRANS: return "%posttrans";
case RPMTAG_TRIGGERPOSTUN: return "%triggerpostun";
case RPMTAG_VERIFYSCRIPT: return "%verify";
+ case RPMTAG_SANITYCHECK: return "%sanitycheck";
}
return "%unknownscript";
}
@@ -475,6 +476,7 @@
case RPMTAG_POSTTRANS: return RPMSCRIPT_POSTTRANS;
case RPMTAG_TRIGGERPOSTUN: return RPMSCRIPT_TRIGGERPOSTUN;
case RPMTAG_VERIFYSCRIPT: return RPMSCRIPT_VERIFY;
+ case RPMTAG_SANITYCHECK: return RPMSCRIPT_SANITYCHECK;
}
return RPMSCRIPT_UNKNOWN;
}
@@ .
patch -p0 <<'@@ .'
Index: rpm/lib/rpmlib.h
============================================================================
$ cvs diff -u -r2.456 -r2.457 rpmlib.h
--- rpm/lib/rpmlib.h 6 Dec 2007 21:21:06 -0000 2.456
+++ rpm/lib/rpmlib.h 6 Dec 2007 23:32:05 -0000 2.457
@@ -136,6 +136,7 @@
RPMSCRIPT_POSTTRANS = 10, /*!< %posttrans scriptlet */
/* 11-15 unused */
RPMSCRIPT_VERIFY = 16, /*!< %verify scriptlet */
+ RPMSCRIPT_SANITYCHECK = 17, /*!< %sanitycheck scriptlet */
RPMSCRIPT_MAX = 32
} rpmScriptID;
@@ .
patch -p0 <<'@@ .'
Index: rpm/lib/rpmns.c
============================================================================
$ cvs diff -u -r1.5 -r1.6 rpmns.c
--- rpm/lib/rpmns.c 30 Sep 2007 20:38:25 -0000 1.5
+++ rpm/lib/rpmns.c 6 Dec 2007 23:32:05 -0000 1.6
@@ -77,6 +77,7 @@
{ "macro", RPMNS_TYPE_MACRO },
{ "envvar", RPMNS_TYPE_ENVVAR },
{ "running", RPMNS_TYPE_RUNNING },
+ { "sanitycheck", RPMNS_TYPE_SANITY },
{ "exists", RPMNS_TYPE_ACCESS },
{ "executable", RPMNS_TYPE_ACCESS },
{ "readable", RPMNS_TYPE_ACCESS },
@@ -192,6 +193,7 @@
case RPMNS_TYPE_MACRO:
case RPMNS_TYPE_ENVVAR:
case RPMNS_TYPE_RUNNING:
+ case RPMNS_TYPE_SANITY:
ns->NS = ns->str;
if (ns->NS[0] == '!')
ns->NS++;
@@ .
patch -p0 <<'@@ .'
Index: rpm/lib/rpmns.h
============================================================================
$ cvs diff -u -r1.7 -r1.8 rpmns.h
--- rpm/lib/rpmns.h 9 Nov 2007 20:11:00 -0000 1.7
+++ rpm/lib/rpmns.h 6 Dec 2007 23:32:05 -0000 1.8
@@ -48,6 +48,7 @@
RPMNS_TYPE_MACRO = (1 << 22), /*!< macro(foo) */
RPMNS_TYPE_ENVVAR = (1 << 23), /*!< envvar(foo) */
RPMNS_TYPE_RUNNING = (1 << 24), /*!< running(foo) */
+ RPMNS_TYPE_SANITY = (1 << 25), /*!< sanitycheck(foo) */
} nsType;
#if defined(_RPMNS_INTERNAL)
@@ .
patch -p0 <<'@@ .'
Index: rpm/lib/verify.c
============================================================================
$ cvs diff -u -r2.181 -r2.182 verify.c
--- rpm/lib/verify.c 3 Dec 2007 18:11:09 -0000 2.181
+++ rpm/lib/verify.c 6 Dec 2007 23:32:05 -0000 2.182
@@ -241,6 +241,11 @@
psm->progTag = RPMTAG_VERIFYSCRIPTPROG;
rc = rpmpsmStage(psm, PSM_SCRIPT);
+ psm->stepName = "sanitycheck";
+ psm->scriptTag = RPMTAG_SANITYCHECK;
+ psm->progTag = RPMTAG_SANITYCHECKPROG;
+ rc = rpmpsmStage(psm, PSM_SCRIPT);
+
if (scriptFd != NULL)
rpmtsSetScriptFd(psm->ts, NULL);
@@ -481,7 +486,8 @@
ec = rc;
}
if ((qva->qva_flags & VERIFY_SCRIPT)
- && headerIsEntry(h, RPMTAG_VERIFYSCRIPT))
+ && (headerIsEntry(h, RPMTAG_VERIFYSCRIPT) ||
+ headerIsEntry(h, RPMTAG_SANITYCHECK)))
{
FD_t fdo = fdDup(STDOUT_FILENO);
@@ .
Received on Fri Dec 7 00:32:05 2007