summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjbj <devnull@localhost>2001-02-28 13:59:29 +0000
committerjbj <devnull@localhost>2001-02-28 13:59:29 +0000
commit15941e5fea63d566111ac57e94886b1ea761b110 (patch)
treecacdddd45970250d996941c2bedc1033c9788240
parent770f01d2d4f5783a60e7854e2c4f5918520c2f2d (diff)
downloadlibrpm-tizen-15941e5fea63d566111ac57e94886b1ea761b110.tar.gz
librpm-tizen-15941e5fea63d566111ac57e94886b1ea761b110.tar.bz2
librpm-tizen-15941e5fea63d566111ac57e94886b1ea761b110.zip
Move more args into PSM_t.
CVS patchset: 4586 CVS date: 2001/02/28 13:59:29
-rw-r--r--lib/fsm.c2
-rw-r--r--lib/fsm.h1
-rw-r--r--lib/psm.c54
-rw-r--r--lib/psm.h10
-rw-r--r--lib/scriptlet.c140
-rw-r--r--lib/scriptlet.h21
-rw-r--r--lib/verify.c25
-rw-r--r--po/rpm.pot34
8 files changed, 172 insertions, 115 deletions
diff --git a/lib/fsm.c b/lib/fsm.c
index 0fd18e416..207f6c20f 100644
--- a/lib/fsm.c
+++ b/lib/fsm.c
@@ -1153,6 +1153,7 @@ int fsmStage(FSM_t fsm, fileStage stage)
break;
}
break;
+ case FSM_PKGSAVE:
case FSM_PKGBUILD:
while (1) {
@@ -1914,6 +1915,7 @@ if (fsm->rdnb != fsm->wrnb) fprintf(stderr, "*** short write: had %d, got %d\n",
case FSM_PKGBUILD: return "pkgbuild";
case FSM_PKGCOMMIT: return "pkgcommit";
case FSM_PKGUNDO: return "pkgundo";
+ case FSM_PKGSAVE: return "pkgsave";
case FSM_CREATE: return "create";
case FSM_INIT: return "init";
diff --git a/lib/fsm.h b/lib/fsm.h
index 85c0d2da6..6cf75ff1b 100644
--- a/lib/fsm.h
+++ b/lib/fsm.h
@@ -31,6 +31,7 @@ typedef enum fileStage_e {
FSM_PKGBUILD = _fd(9),
FSM_PKGCOMMIT = _fd(10),
FSM_PKGUNDO = _fd(11),
+ FSM_PKGSAVE = _fd(12),
FSM_CREATE = _fd(17),
FSM_MAP = _fd(18),
diff --git a/lib/psm.c b/lib/psm.c
index 71490fe46..162e41b24 100644
--- a/lib/psm.c
+++ b/lib/psm.c
@@ -630,7 +630,7 @@ static int installArchive(const rpmTransactionSet ts, TFI_t fi, int allFiles)
/**
*/
-static rpmRC chkdir (const char * dpath, const char * dname)
+static rpmRC chkdir (const char * dpath, const char * dname)
{
struct stat st;
int rc;
@@ -925,6 +925,8 @@ int psmStage(PSM_t psm, fileStage stage)
break;
case FSM_PKGERASE:
break;
+ case FSM_PKGSAVE:
+ break;
case FSM_PKGCOMMIT:
break;
case FSM_PKGBUILD:
@@ -1024,8 +1026,8 @@ int installBinaryPackage(PSM_t psm)
* When we run scripts, we pass an argument which is the number of
* versions of this package that will be installed when we are finished.
*/
- fi->scriptArg = rpmdbCountPackages(ts->rpmdb, fi->name) + 1;
- if (fi->scriptArg < 1)
+ psm->scriptArg = rpmdbCountPackages(ts->rpmdb, fi->name) + 1;
+ if (psm->scriptArg < 1)
goto exit;
{ rpmdbMatchIterator mi;
@@ -1083,8 +1085,9 @@ int installBinaryPackage(PSM_t psm)
rpmMessage(RPMMESS_DEBUG, _("%s: running %s script(s) (if any)\n"),
stepName, "pre-install");
- rc = runInstScript(ts, fi->h, RPMTAG_PREIN, RPMTAG_PREINPROG, fi->scriptArg,
- ts->transFlags & RPMTRANS_FLAG_NOSCRIPTS);
+ psm->scriptTag = RPMTAG_PREIN;
+ psm->progTag = RPMTAG_PREINPROG;
+ rc = runInstScript(psm);
if (rc) {
rpmError(RPMERR_SCRIPT,
_("skipping %s-%s-%s install, %%pre scriptlet failed rc %d\n"),
@@ -1151,21 +1154,26 @@ int installBinaryPackage(PSM_t psm)
rpmMessage(RPMMESS_DEBUG, _("%s: running %s script(s) (if any)\n"),
stepName, "post-install");
- rc = runInstScript(ts, fi->h, RPMTAG_POSTIN, RPMTAG_POSTINPROG,
- fi->scriptArg, (ts->transFlags & RPMTRANS_FLAG_NOSCRIPTS));
+ psm->scriptTag = RPMTAG_POSTIN;
+ psm->progTag = RPMTAG_POSTINPROG;
+ rc = runInstScript(psm);
if (rc)
goto exit;
if (!(ts->transFlags & RPMTRANS_FLAG_NOTRIGGERS)) {
/* Run triggers this package sets off */
- if (runTriggers(psm, RPMSENSE_TRIGGERIN, 0))
+ psm->sense = RPMSENSE_TRIGGERIN;
+ psm->countCorrection = 0;
+ rc = runTriggers(psm);
+ if (rc)
goto exit;
/*
* Run triggers in this package which are set off by other packages in
* the database.
*/
- if (runImmedTriggers(psm, RPMSENSE_TRIGGERIN, 0))
+ rc = runImmedTriggers(psm);
+ if (rc)
goto exit;
}
@@ -1200,8 +1208,8 @@ assert(fi->type == TR_REMOVED);
* When we run scripts, we pass an argument which is the number of
* versions of this package that will be installed when we are finished.
*/
- fi->scriptArg = rpmdbCountPackages(ts->rpmdb, fi->name) - 1;
- if (fi->scriptArg < 0) {
+ psm->scriptArg = rpmdbCountPackages(ts->rpmdb, fi->name) - 1;
+ if (psm->scriptArg < 0) {
rc = 1;
goto exit;
}
@@ -1228,14 +1236,18 @@ assert(fi->type == TR_REMOVED);
if (!(ts->transFlags & RPMTRANS_FLAG_NOTRIGGERS)) {
/* run triggers from this package which are keyed on installed
packages */
- rc = runImmedTriggers(psm, RPMSENSE_TRIGGERUN, -1);
+ psm->sense = RPMSENSE_TRIGGERUN;
+ psm->countCorrection = -1;
+ rc = runImmedTriggers(psm);
if (rc) {
rc = 2;
goto exit;
}
/* run triggers which are set off by the removal of this package */
- rc = runTriggers(psm, RPMSENSE_TRIGGERUN, -1);
+ psm->sense = RPMSENSE_TRIGGERUN;
+ psm->countCorrection = -1;
+ rc = runTriggers(psm);
if (rc) {
rc = 1;
goto exit;
@@ -1245,8 +1257,9 @@ assert(fi->type == TR_REMOVED);
rpmMessage(RPMMESS_DEBUG, _("%s: running %s script(s) (if any)\n"),
stepName, "pre-erase");
- rc = runInstScript(ts, fi->h, RPMTAG_PREUN, RPMTAG_PREUNPROG, fi->scriptArg,
- (ts->transFlags & RPMTRANS_FLAG_NOSCRIPTS));
+ psm->scriptTag = RPMTAG_PREUN;
+ psm->progTag = RPMTAG_PREUNPROG;
+ rc = runInstScript(psm);
if (rc) {
rc = 1;
goto exit;
@@ -1270,13 +1283,16 @@ assert(fi->type == TR_REMOVED);
rpmMessage(RPMMESS_DEBUG, _("%s: running %s script(s) (if any)\n"),
stepName, "post-erase");
- rc = runInstScript(ts, fi->h, RPMTAG_POSTUN, RPMTAG_POSTUNPROG,
- fi->scriptArg, (ts->transFlags & RPMTRANS_FLAG_NOSCRIPTS));
+ psm->scriptTag = RPMTAG_POSTUN;
+ psm->progTag = RPMTAG_POSTUNPROG;
+ rc = runInstScript(psm);
/* XXX WTFO? postun failures are not cause for erasure failure. */
if (!(ts->transFlags & RPMTRANS_FLAG_NOTRIGGERS)) {
/* Run postun triggers which are set off by this package's removal. */
- rc = runTriggers(psm, RPMSENSE_TRIGGERPOSTUN, -1);
+ psm->sense = RPMSENSE_TRIGGERPOSTUN;
+ psm->countCorrection = -1;
+ rc = runTriggers(psm);
if (rc) {
rc = 2;
goto exit;
@@ -1435,7 +1451,7 @@ assert(fi->type == TR_REMOVED);
cfd = Fdopen(fdDup(Fileno(fd)), rpmio_flags);
/* XXX failedFile? */
- rc = fsmSetup(fi->fsm, FSM_PKGBUILD, ts, fi, cfd, NULL, NULL);
+ rc = fsmSetup(fi->fsm, FSM_PKGSAVE, ts, fi, cfd, NULL, NULL);
(void) fsmTeardown(fi->fsm);
saveerrno = errno; /* XXX FIXME: Fclose with libio destroys errno */
diff --git a/lib/psm.h b/lib/psm.h
index 6ba8c483c..b44ba35cc 100644
--- a/lib/psm.h
+++ b/lib/psm.h
@@ -72,7 +72,6 @@ struct transactionFileInfo_s {
int dnlmax; /*!< Length (in bytes) of longest dir name. */
int astriplen;
int striplen;
- int scriptArg;
int chrootDone;
unsigned int archiveSize;
mode_t dperms; /*!< Directory perms (0755) if not mapped. */
@@ -101,8 +100,13 @@ struct transactionFileInfo_s {
struct psm_s {
rpmTransactionSet ts;
TFI_t fi;
- int rc; /*!< External file stage return code. */
- fileStage stage; /*!< External package stage. */
+ int scriptTag; /*!< Scriptlet tag. */
+ int progTag; /*!< Scriptlet interpreter tag. */
+ int scriptArg; /*!< No. of installed instances. */
+ int sense; /*!< One of RPMSENSE_TRIGGER{IN,UN,POSTUN}. */
+ int countCorrection; /*!< 0 if installing, -1 if removing. */
+ int rc;
+ fileStage stage;
};
#ifdef __cplusplus
diff --git a/lib/scriptlet.c b/lib/scriptlet.c
index 22ab1c0d1..3ab047bcd 100644
--- a/lib/scriptlet.c
+++ b/lib/scriptlet.c
@@ -43,7 +43,7 @@ static /*@observer@*/ const char * const tag2sln(int tag)
* /bin/sh will be used. If the interpreter is /bin/sh, then the args from
* the header will be ignored, passing instead arg1 and arg2.
*
- * @param ts transaction set
+ * @param psm package state machine data
* @param h header
* @param sln name of scriptlet section
* @param progArgc no. of args from header
@@ -54,15 +54,20 @@ static /*@observer@*/ const char * const tag2sln(int tag)
* @param arg2 ditto, but for the target package
* @return 0 on success, 1 on error
*/
-static int runScript(const rpmTransactionSet ts, Header h,
+static int runScript(PSM_t psm, Header h,
const char * sln,
int progArgc, const char ** progArgv,
const char * script, int arg1, int arg2)
{
+ const rpmTransactionSet ts = psm->ts;
+ TFI_t fi = psm->fi;
+ HGE_t hge = fi->hge;
+ HFD_t hfd = fi->hfd;
const char ** argv = NULL;
int argc = 0;
const char ** prefixes = NULL;
int numPrefixes;
+ int_32 ipt;
const char * oldPrefix;
int maxPrefixLength;
int len;
@@ -90,12 +95,9 @@ static int runScript(const rpmTransactionSet ts, Header h,
}
headerNVR(h, &n, &v, &r);
- if (headerGetEntry(h, RPMTAG_INSTPREFIXES, NULL, (void **) &prefixes,
- &numPrefixes)) {
+ if (hge(h, RPMTAG_INSTPREFIXES, &ipt, (void **) &prefixes, &numPrefixes)) {
freePrefixes = 1;
- } else if (headerGetEntry(h, RPMTAG_INSTALLPREFIX, NULL,
- (void **) &oldPrefix, NULL))
- {
+ } else if (hge(h, RPMTAG_INSTALLPREFIX, NULL, (void **) &oldPrefix, NULL)) {
prefixes = &oldPrefix;
numPrefixes = 1;
} else {
@@ -241,7 +243,7 @@ static int runScript(const rpmTransactionSet ts, Header h,
}
}
- if (freePrefixes) free(prefixes);
+ if (freePrefixes) prefixes = hfd(prefixes, ipt);
Fclose(out); /* XXX dup'd STDOUT_FILENO */
@@ -253,58 +255,65 @@ static int runScript(const rpmTransactionSet ts, Header h,
return rc;
}
-int runInstScript(const rpmTransactionSet ts, Header h,
- int scriptTag, int progTag, int arg, int norunScripts)
+int runInstScript(PSM_t psm)
{
+ const rpmTransactionSet ts = psm->ts;
+ TFI_t fi = psm->fi;
+ HGE_t hge = fi->hge;
+ HFD_t hfd = fi->hfd;
void ** programArgv;
int programArgc;
const char ** argv;
- int programType;
- char * script;
+ int_32 ptt, stt;
+ const char * script;
int rc;
- if (norunScripts) return 0;
+ if (ts->transFlags & RPMTRANS_FLAG_NOSCRIPTS)
+ return 0;
- /* headerGetEntry() sets the data pointer to NULL if the entry does
- not exist */
- headerGetEntry(h, progTag, &programType, (void **) &programArgv,
- &programArgc);
- headerGetEntry(h, scriptTag, NULL, (void **) &script, NULL);
+ /*
+ * headerGetEntry() sets the data pointer to NULL if the entry does
+ * not exist.
+ */
+ hge(fi->h, psm->progTag, &ptt, (void **) &programArgv, &programArgc);
+ hge(fi->h, psm->scriptTag, &stt, (void **) &script, NULL);
- if (programArgv && programType == RPM_STRING_TYPE) {
+ if (programArgv && ptt == RPM_STRING_TYPE) {
argv = alloca(sizeof(char *));
*argv = (const char *) programArgv;
} else {
argv = (const char **) programArgv;
}
- rc = runScript(ts, h, tag2sln(scriptTag), programArgc, argv, script,
- arg, -1);
- programArgv = headerFreeData(programArgv, programType);
+ rc = runScript(psm, fi->h, tag2sln(psm->scriptTag), programArgc, argv,
+ script, psm->scriptArg, -1);
+ programArgv = hfd(programArgv, ptt);
+ script = hfd(script, stt);
return rc;
}
/**
- * @param ts transaction set
- * @param sense
+ * @param psm package state machine data
* @param sourceH
* @param triggeredH
- * @param arg1correction
* @param arg2
* @param triggersAlreadyRun
* @return
*/
-static int handleOneTrigger(const rpmTransactionSet ts, int sense,
- Header sourceH, Header triggeredH,
- int arg1correction, int arg2,
- char * triggersAlreadyRun)
+static int handleOneTrigger(PSM_t psm, Header sourceH, Header triggeredH,
+ int arg2, char * triggersAlreadyRun)
{
+ const rpmTransactionSet ts = psm->ts;
+ TFI_t fi = psm->fi;
+ HGE_t hge = fi->hge;
+ HFD_t hfd = fi->hfd;
const char ** triggerNames;
const char ** triggerEVR;
const char ** triggerScripts;
const char ** triggerProgs;
int_32 * triggerFlags;
int_32 * triggerIndices;
+ int_32 tnt, tvt, tft;
const char * triggerPackageName;
const char * sourceName;
int numTriggers;
@@ -312,21 +321,19 @@ static int handleOneTrigger(const rpmTransactionSet ts, int sense,
int i;
int skip;
- if (!headerGetEntry(triggeredH, RPMTAG_TRIGGERNAME, NULL,
- (void **) &triggerNames, &numTriggers)) {
+ if (!hge(triggeredH, RPMTAG_TRIGGERNAME, &tnt,
+ (void **) &triggerNames, &numTriggers))
return 0;
- }
headerNVR(sourceH, &sourceName, NULL, NULL);
- headerGetEntry(triggeredH, RPMTAG_TRIGGERFLAGS, NULL,
- (void **) &triggerFlags, NULL);
- headerGetEntry(triggeredH, RPMTAG_TRIGGERVERSION, NULL,
- (void **) &triggerEVR, NULL);
+ hge(triggeredH, RPMTAG_TRIGGERFLAGS, &tft, (void **) &triggerFlags, NULL);
+ hge(triggeredH, RPMTAG_TRIGGERVERSION, &tvt, (void **) &triggerEVR, NULL);
for (i = 0; i < numTriggers; i++) {
+ int_32 tit, tst, tpt;
- if (!(triggerFlags[i] & sense)) continue;
+ if (!(triggerFlags[i] & psm->sense)) continue;
if (strcmp(triggerNames[i], sourceName)) continue;
/*
@@ -346,11 +353,11 @@ static int handleOneTrigger(const rpmTransactionSet ts, int sense,
triggerEVR[i] + skip, triggerFlags[i]))
continue;
- headerGetEntry(triggeredH, RPMTAG_TRIGGERINDEX, NULL,
+ hge(triggeredH, RPMTAG_TRIGGERINDEX, &tit,
(void **) &triggerIndices, NULL);
- headerGetEntry(triggeredH, RPMTAG_TRIGGERSCRIPTS, NULL,
+ hge(triggeredH, RPMTAG_TRIGGERSCRIPTS, &tst,
(void **) &triggerScripts, NULL);
- headerGetEntry(triggeredH, RPMTAG_TRIGGERSCRIPTPROG, NULL,
+ hge(triggeredH, RPMTAG_TRIGGERSCRIPTPROG, &tpt,
(void **) &triggerProgs, NULL);
headerNVR(triggeredH, &triggerPackageName, NULL, NULL);
@@ -358,13 +365,14 @@ static int handleOneTrigger(const rpmTransactionSet ts, int sense,
{ int arg1;
int index;
- if ((arg1 = rpmdbCountPackages(ts->rpmdb, triggerPackageName)) < 0) {
+ arg1 = rpmdbCountPackages(ts->rpmdb, triggerPackageName);
+ if (arg1 < 0) {
rc = 1; /* XXX W2DO? same as "execution of script failed" */
} else {
- arg1 += arg1correction;
+ arg1 += psm->countCorrection;
index = triggerIndices[i];
if (!triggersAlreadyRun || !triggersAlreadyRun[index]) {
- rc = runScript(ts, triggeredH, "%trigger", 1,
+ rc = runScript(psm, triggeredH, "%trigger", 1,
triggerProgs + index, triggerScripts[index],
arg1, arg2);
if (triggersAlreadyRun) triggersAlreadyRun[index] = 1;
@@ -372,60 +380,71 @@ static int handleOneTrigger(const rpmTransactionSet ts, int sense,
}
}
- free(triggerScripts);
- free(triggerProgs);
+ triggerIndices = hfd(triggerIndices, tit);
+ triggerScripts = hfd(triggerScripts, tst);
+ triggerProgs = hfd(triggerProgs, tpt);
- /* each target/source header pair can only result in a single
- script being run */
+ /*
+ * Each target/source header pair can only result in a single
+ * script being run.
+ */
break;
}
- free(triggerNames);
+ triggerNames = hfd(triggerNames, tnt);
+ triggerFlags = hfd(triggerFlags, tft);
+ triggerEVR = hfd(triggerEVR, tvt);
return rc;
}
-int runTriggers(PSM_t psm, int sense, int countCorrection)
+int runTriggers(PSM_t psm)
{
const rpmTransactionSet ts = psm->ts;
TFI_t fi = psm->fi;
int numPackage;
int rc = 0;
- numPackage = rpmdbCountPackages(ts->rpmdb, fi->name) + countCorrection;
+ numPackage = rpmdbCountPackages(ts->rpmdb, fi->name) + psm->countCorrection;
if (numPackage < 0)
return 1;
{ Header triggeredH;
rpmdbMatchIterator mi;
+ int countCorrection = psm->countCorrection;
+ psm->countCorrection = 0;
mi = rpmdbInitIterator(ts->rpmdb, RPMTAG_TRIGGERNAME, fi->name, 0);
while((triggeredH = rpmdbNextIterator(mi)) != NULL) {
- rc |= handleOneTrigger(ts, sense, fi->h, triggeredH, 0, numPackage,
- NULL);
+ rc |= handleOneTrigger(psm, fi->h, triggeredH, numPackage, NULL);
}
rpmdbFreeIterator(mi);
+ psm->countCorrection = countCorrection;
}
return rc;
}
-int runImmedTriggers(PSM_t psm, int sense, int countCorrection)
+int runImmedTriggers(PSM_t psm)
{
const rpmTransactionSet ts = psm->ts;
TFI_t fi = psm->fi;
+ HGE_t hge = fi->hge;
+ HFD_t hfd = fi->hfd;
const char ** triggerNames;
int numTriggers;
int_32 * triggerIndices;
+ int_32 tnt, tit;
int numTriggerIndices;
char * triggersRun;
int rc = 0;
- if (!headerGetEntry(fi->h, RPMTAG_TRIGGERNAME, NULL,
+ if (!hge(fi->h, RPMTAG_TRIGGERNAME, &tnt,
(void **) &triggerNames, &numTriggers))
return 0;
- headerGetEntry(fi->h, RPMTAG_TRIGGERINDEX, NULL, (void **) &triggerIndices,
+
+ hge(fi->h, RPMTAG_TRIGGERINDEX, &tit, (void **) &triggerIndices,
&numTriggerIndices);
triggersRun = alloca(sizeof(*triggersRun) * numTriggerIndices);
memset(triggersRun, 0, sizeof(*triggersRun) * numTriggerIndices);
@@ -435,20 +454,21 @@ int runImmedTriggers(PSM_t psm, int sense, int countCorrection)
for (i = 0; i < numTriggers; i++) {
rpmdbMatchIterator mi;
- const char * name = triggerNames[i];
if (triggersRun[triggerIndices[i]]) continue;
- mi = rpmdbInitIterator(ts->rpmdb, RPMTAG_NAME, name, 0);
+ mi = rpmdbInitIterator(ts->rpmdb, RPMTAG_NAME, triggerNames[i], 0);
while((sourceH = rpmdbNextIterator(mi)) != NULL) {
- rc |= handleOneTrigger(ts, sense, sourceH, fi->h,
- countCorrection, rpmdbGetIteratorCount(mi),
- triggersRun);
+ rc |= handleOneTrigger(psm, sourceH, fi->h,
+ rpmdbGetIteratorCount(mi),
+ triggersRun);
}
rpmdbFreeIterator(mi);
}
}
+ triggerIndices = hfd(triggerNames, tit);
+ triggerNames = hfd(triggerNames, tnt);
return rc;
}
diff --git a/lib/scriptlet.h b/lib/scriptlet.h
index c97c91ec4..7ca356434 100644
--- a/lib/scriptlet.h
+++ b/lib/scriptlet.h
@@ -12,34 +12,27 @@ extern "C" {
/**
* Retrieve and run scriptlet from header.
- * @param ts transaction set
- * @param h header
- * @param scriptTag scriptlet tag
- * @param progTag scriptlet interpreter tag
- * @param arg no. instances of package installed after scriptlet exec
- * @param norunScripts should scriptlet be executed?
+ * @param psm package state machine data
* @return 0 on success
*/
-int runInstScript(const rpmTransactionSet ts, Header h,
- int scriptTag, int progTag, int arg, int norunScripts);
+int runInstScript(PSM_t psm)
+ /*@modifies psm @*/;
/**
* Run trigger scripts in the database that are fired by this header.
* @param psm package state machine data
- * @param sense one of RPMSENSE_TRIGGER{IN,UN,POSTUN}
- * @param countCorrection 0 if installing, -1 if removing, package
* @return 0 on success, 1 on error
*/
-int runTriggers(PSM_t psm, int sense, int countCorrection);
+int runTriggers(PSM_t psm)
+ /*@modifies psm @*/;
/**
* Run triggers from this header that are fired by headers in the database.
* @param psm package state machine data
- * @param sense one of RPMSENSE_TRIGGER{IN,UN,POSTUN}
- * @param countCorrection 0 if installing, -1 if removing, package
* @return 0 on success, 1 on error
*/
-int runImmedTriggers(PSM_t psm, int sense, int countCorrection);
+int runImmedTriggers(PSM_t psm)
+ /*@modifies psm @*/;
#ifdef __cplusplus
}
diff --git a/lib/verify.c b/lib/verify.c
index 2a9e3f7f0..008a222df 100644
--- a/lib/verify.c
+++ b/lib/verify.c
@@ -65,6 +65,16 @@ struct poptOption rpmVerifyPoptTable[] = {
POPT_TABLEEND
};
+/**
+ * Wrapper to free(3), hides const compilation noise, permit NULL, return NULL.
+ * @param this memory to free
+ * @retval NULL always
+ */
+static /*@null@*/ void * _free(/*@only@*/ /*@null@*/ const void * this) {
+ if (this) free((void *)this);
+ return NULL;
+}
+
/* ======================================================================== */
int rpmVerifyFile(const char * prefix, Header h, int filenum,
int * result, int omitMask)
@@ -275,12 +285,23 @@ int rpmVerifyScript(const char * rootDir, Header h, FD_t scriptFd)
{
rpmdb rpmdb = NULL;
rpmTransactionSet ts = rpmtransCreateSet(rpmdb, rootDir);
+ TFI_t fi = xcalloc(1, sizeof(*fi));
+ struct psm_s psmbuf;
+ PSM_t psm = &psmbuf;
int rc;
if (scriptFd)
ts->scriptFd = fdLink(scriptFd, "rpmVerifyScript");
- rc = runInstScript(ts, h, RPMTAG_VERIFYSCRIPT, RPMTAG_VERIFYSCRIPTPROG,
- 0, 0);
+ fi->magic = TFIMAGIC;
+ loadFi(h, fi);
+ memset(psm, 0, sizeof(*psm));
+ psm->ts = ts;
+ psm->fi = fi;
+ psm->scriptTag = RPMTAG_VERIFYSCRIPT;
+ psm->progTag = RPMTAG_VERIFYSCRIPTPROG;
+ rc = runInstScript(psm);
+ freeFi(fi);
+ fi = _free(fi);
rpmtransFree(ts);
return rc;
}
diff --git a/po/rpm.pot b/po/rpm.pot
index c5f1a5843..a89b71209 100644
--- a/po/rpm.pot
+++ b/po/rpm.pot
@@ -6,7 +6,7 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
-"POT-Creation-Date: 2001-02-27 17:55-0500\n"
+"POT-Creation-Date: 2001-02-28 08:53-0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -1808,7 +1808,7 @@ msgstr ""
msgid "Could not open %s: %s\n"
msgstr ""
-#: build/pack.c:484 lib/psm.c:1405
+#: build/pack.c:484 lib/psm.c:1421
#, c-format
msgid "Unable to write package: %s\n"
msgstr ""
@@ -1838,7 +1838,7 @@ msgstr ""
msgid "Unable to write payload to %s: %s\n"
msgstr ""
-#: build/pack.c:566 lib/psm.c:1461
+#: build/pack.c:566 lib/psm.c:1477
#, c-format
msgid "Wrote: %s\n"
msgstr ""
@@ -2481,27 +2481,27 @@ msgstr ""
msgid "%s directory created with perms %04o.\n"
msgstr ""
-#: lib/fsm.c:1344 lib/fsm.c:1461
+#: lib/fsm.c:1345 lib/fsm.c:1462
#, c-format
msgid "%s saved as %s\n"
msgstr ""
-#: lib/fsm.c:1486
+#: lib/fsm.c:1487
#, c-format
msgid "%s rmdir of %s failed: Directory not empty\n"
msgstr ""
-#: lib/fsm.c:1491
+#: lib/fsm.c:1492
#, c-format
msgid "%s rmdir of %s failed: %s\n"
msgstr ""
-#: lib/fsm.c:1500
+#: lib/fsm.c:1501
#, c-format
msgid "%s unlink of %s failed: %s\n"
msgstr ""
-#: lib/fsm.c:1517
+#: lib/fsm.c:1518
#, c-format
msgid "%s created as %s\n"
msgstr ""
@@ -2925,18 +2925,18 @@ msgstr ""
msgid "source package expected, binary found\n"
msgstr ""
-#: lib/psm.c:1019 lib/psm.c:1194
+#: lib/psm.c:1021 lib/psm.c:1202
#, c-format
msgid "%s: %s-%s-%s has %d files, test = %d\n"
msgstr ""
#. XXX WTFO? erase failures are not cause for stopping.
-#: lib/psm.c:1083 lib/psm.c:1151 lib/psm.c:1245 lib/psm.c:1270
+#: lib/psm.c:1085 lib/psm.c:1154 lib/psm.c:1257 lib/psm.c:1283
#, c-format
msgid "%s: running %s script(s) (if any)\n"
msgstr ""
-#: lib/psm.c:1090
+#: lib/psm.c:1093
msgid "skipping %s-%s-%s install, %%pre scriptlet failed rc %d\n"
msgstr ""
@@ -3508,12 +3508,12 @@ msgstr ""
msgid "Please contact rpm-list@redhat.com\n"
msgstr ""
-#: lib/scriptlet.c:231
+#: lib/scriptlet.c:233
#, c-format
msgid "execution of %s scriptlet from %s-%s-%s failed, waitpid returned %s\n"
msgstr ""
-#: lib/scriptlet.c:238
+#: lib/scriptlet.c:240
#, c-format
msgid "execution of %s scriptlet from %s-%s-%s failed, exit status %d\n"
msgstr ""
@@ -3688,20 +3688,20 @@ msgstr ""
msgid "do not execute %verifyscript (if any)"
msgstr ""
-#: lib/verify.c:239
+#: lib/verify.c:249
msgid "package lacks both user name and id lists (this should never happen)\n"
msgstr ""
-#: lib/verify.c:257
+#: lib/verify.c:267
msgid "package lacks both group name and id lists (this should never happen)\n"
msgstr ""
-#: lib/verify.c:319
+#: lib/verify.c:340
#, c-format
msgid "missing %s"
msgstr ""
-#: lib/verify.c:400
+#: lib/verify.c:421
#, c-format
msgid "Unsatisfied dependencies for %s-%s-%s: "
msgstr ""