/*@noteached@*/
}
-/*@obserever@*/ const char *const fileActionString(fileAction a)
-{
- switch (a) {
- case FA_UNKNOWN: return "unknown";
- case FA_CREATE: return "create";
- case FA_COPYOUT: return "copyout";
- case FA_COPYIN: return "copyin";
- case FA_BACKUP: return "backup";
- case FA_SAVE: return "save";
- case FA_SKIP: return "skip";
- case FA_ALTNAME: return "altname";
- case FA_ERASE: return "erase";
- case FA_SKIPNSTATE: return "skipnstate";
- case FA_SKIPNETSHARED: return "skipnetshared";
- case FA_SKIPMULTILIB: return "skipmultilib";
- default: return "???";
- }
- /*@notreached@*/
-}
-
/**
* Macros to be defined from per-header tag values.
* @todo Should other macros be added from header when installing a package?
if (waitpid(child, &status, 0) < 0) {
rpmError(RPMERR_SCRIPT,
- _("execution of %s scriptlet from %s-%s-%s failed, waitpid returned %s\n"),
+ _("execution of %s scriptlet from %s-%s-%s failed, waitpid returned %s\n"),
sln, n, v, r, strerror (errno));
/* XXX what to do here? */
rc = RPMRC_OK;
} else {
if (!WIFEXITED(status) || WEXITSTATUS(status)) {
rpmError(RPMERR_SCRIPT,
- _("execution of %s scriptlet from %s-%s-%s failed, exit status %d\n"),
+ _("execution of %s scriptlet from %s-%s-%s failed, exit status %d\n"),
sln, n, v, r, WEXITSTATUS(status));
rc = RPMRC_FAIL;
}
*/
static rpmRC runInstScript(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 * script;
rpmRC rc = RPMRC_OK;
- if (ts->transFlags & RPMTRANS_FLAG_NOSCRIPTS)
- return rc;
-
/*
* headerGetEntry() sets the data pointer to NULL if the entry does
* not exist.
rc = runScript(psm, fi->h, tag2sln(psm->scriptTag), programArgc, argv,
script, psm->scriptArg, -1);
+
programArgv = hfd(programArgv, ptt);
script = hfd(script, stt);
return rc;
psm->stepName, fi->name, fi->version, fi->release,
fi->fc, (ts->transFlags & RPMTRANS_FLAG_TEST));
+ /*
+ * 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.
+ */
+ psm->npkgs_installed = rpmdbCountPackages(ts->rpmdb, fi->name);
+ if (psm->npkgs_installed < 0) {
+ rc = RPMRC_FAIL;
+ break;
+ }
+
if (psm->goal == PSM_PKGINSTALL) {
- /*
- * 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.
- */
- psm->scriptArg = rpmdbCountPackages(ts->rpmdb, fi->name) + 1;
- if (psm->scriptArg < 1) {
- rc = RPMRC_FAIL;
- break;
- }
+ psm->scriptArg = psm->npkgs_installed + 1;
assert(psm->mi == NULL);
psm->mi = rpmdbInitIterator(ts->rpmdb, RPMTAG_NAME, fi->name, 0);
rc = RPMRC_OK;
}
if (psm->goal == PSM_PKGERASE) {
- /*
- * 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.
- */
- psm->scriptArg = rpmdbCountPackages(ts->rpmdb, fi->name) - 1;
- if (psm->scriptArg < 0) {
- rc = RPMRC_FAIL;
- break;
- }
+ psm->scriptArg = psm->npkgs_installed - 1;
/* Retrieve installed header. */
rc = psmStage(psm, PSM_RPMDB_LOAD);
- if (rc) break;
}
if (psm->goal == PSM_PKGSAVE) {
+ psm->scriptArg = psm->npkgs_installed - 1;
+
/* Retrieve installed header. */
rc = psmStage(psm, PSM_RPMDB_LOAD);
+
+ /* Open output package for writing. */
+ { const char * bfmt = rpmGetPath("%{_repackage_name_fmt}", NULL);
+ const char * pkgbn =
+ headerSprintf(fi->h, bfmt, rpmTagTable, rpmHeaderFormats, NULL);
+
+ bfmt = _free(bfmt);
+ psm->pkgURL = rpmGenPath("%{?_repackage_root:%{_repackage_root}}",
+ "%{?_repackage_dir:%{_repackage_dir}}",
+ pkgbn);
+ pkgbn = _free(pkgbn);
+ (void) urlPath(psm->pkgURL, &psm->pkgfn);
+ psm->fd = Fopen(psm->pkgfn, "w.ufdio");
+ if (psm->fd == NULL || Ferror(psm->fd)) {
+ rc = RPMRC_FAIL;
+ break;
+ }
+ }
}
break;
case PSM_PRE:
if (ts->transFlags & RPMTRANS_FLAG_TEST) break;
+ /* Change root directory if requested and not already done. */
+ rc = psmStage(psm, PSM_CHROOT_IN);
+
if (psm->goal == PSM_PKGINSTALL) {
psm->scriptTag = RPMTAG_PREIN;
psm->progTag = RPMTAG_PREINPROG;
break;
}
+#ifdef DYING
/* Change root directory if requested and not already done. */
(void) psmStage(psm, PSM_CHROOT_IN);
+#endif
}
if (psm->goal == PSM_PKGERASE) {
psm->scriptTag = RPMTAG_PREUN;
psm->sense = RPMSENSE_TRIGGERUN;
psm->countCorrection = -1;
+#ifdef DYING
/* Change root directory if requested and not already done. */
rc = psmStage(psm, PSM_CHROOT_IN);
if (rc) break;
+#endif
rc = psmStage(psm, PSM_TRIGGERS);
if (rc) break;
}
}
- /* Open output package for writing. */
- { const char * bfmt = rpmGetPath("%{_repackage_name_fmt}", NULL);
- const char * pkgbn =
- headerSprintf(fi->h, bfmt, rpmTagTable, rpmHeaderFormats, NULL);
-
- bfmt = _free(bfmt);
- psm->pkgURL = rpmGenPath("%{?_repackage_root:%{_repackage_root}}",
- "%{?_repackage_dir:%{_repackage_dir}}",
- pkgbn);
- pkgbn = _free(pkgbn);
- (void) urlPath(psm->pkgURL, &psm->pkgfn);
- psm->fd = Fopen(psm->pkgfn, "w.ufdio");
- if (psm->fd == NULL || Ferror(psm->fd)) {
- rc = RPMRC_FAIL;
- break;
- }
- }
-
/* Retrieve type of payload compression. */
rc = psmStage(psm, PSM_RPMIO_FLAGS);
rc = headerWrite(psm->fd, psm->oh, HEADER_MAGIC_YES);
if (rc) break;
+#ifdef DYING
/* Change root directory if requested and not already done. */
rc = psmStage(psm, PSM_CHROOT_IN);
+#endif
}
break;
case PSM_PROCESS:
if (ts->transFlags & RPMTRANS_FLAG_TEST) break;
+
if (psm->goal == PSM_PKGINSTALL) {
struct availablePackage * alp = fi->ap;
break;
case PSM_POST:
if (ts->transFlags & RPMTRANS_FLAG_TEST) break;
+
if (psm->goal == PSM_PKGINSTALL) {
int_32 installTime = time(NULL);
+#ifdef DYING
/* Restore root directory if changed. */
(void) psmStage(psm, PSM_CHROOT_OUT);
+#endif
if (fi->fc > 0 && fi->fstates)
headerAddEntry(fi->h, RPMTAG_FILESTATES, RPM_CHAR_TYPE,
}
if (psm->goal == PSM_PKGSAVE) {
}
+
+ /* Restore root directory if changed. */
+ (void) psmStage(psm, PSM_CHROOT_OUT);
break;
case PSM_UNDO:
break;
case PSM_FINI:
+ /* Restore root directory if changed. */
+ (void) psmStage(psm, PSM_CHROOT_OUT);
+
if (psm->fd) {
saveerrno = errno; /* XXX FIXME: Fclose with libio destroys errno */
Fclose(psm->fd);
rpmMessage(RPMMESS_VERBOSE, _("Wrote: %s\n"), psm->pkgURL);
}
- /* Restore root directory if changed. */
- (void) psmStage(psm, PSM_CHROOT_OUT);
-
if (fi->h && (psm->goal == PSM_PKGERASE || psm->goal == PSM_PKGSAVE)) {
headerFree(fi->h);
fi->h = NULL;
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
-"POT-Creation-Date: 2001-03-02 14:26-0500\n"
+"POT-Creation-Date: 2001-03-03 15:26-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"
msgid "Could not open %s: %s\n"
msgstr ""
-#: build/pack.c:484 lib/psm.c:1512
+#: build/pack.c:484 lib/psm.c:1490
#, c-format
msgid "Unable to write package: %s\n"
msgstr ""
msgid "Unable to write payload to %s: %s\n"
msgstr ""
-#: build/pack.c:566 lib/psm.c:1706
+#: build/pack.c:566 lib/psm.c:1696
#, c-format
msgid "Wrote: %s\n"
msgstr ""
msgid "dataLength() RPM_STRING_TYPE count must be 1.\n"
msgstr ""
-#: lib/header.c:207 lib/header.c:1081 lib/psm.c:390
+#: lib/header.c:207 lib/header.c:1081 lib/psm.c:370
#, c-format
msgid "Data type %d not supported\n"
msgstr ""
msgid "unknown error %d encountered while manipulating package %s"
msgstr ""
-#: lib/psm.c:278
+#: lib/psm.c:258
#, c-format
msgid "user %s does not exist - using root\n"
msgstr ""
-#: lib/psm.c:286
+#: lib/psm.c:266
#, c-format
msgid "group %s does not exist - using root\n"
msgstr ""
-#: lib/psm.c:577
+#: lib/psm.c:557
#, c-format
msgid "cannot create %s %s\n"
msgstr ""
-#: lib/psm.c:583
+#: lib/psm.c:563
#, c-format
msgid "cannot write to %s\n"
msgstr ""
-#: lib/psm.c:605
+#: lib/psm.c:585
msgid "installing a source package\n"
msgstr ""
-#: lib/psm.c:655
+#: lib/psm.c:635
msgid "source package contains no .spec file\n"
msgstr ""
-#: lib/psm.c:744
+#: lib/psm.c:724
msgid "source package expected, binary found\n"
msgstr ""
-#: lib/psm.c:1014
+#: lib/psm.c:994
#, c-format
msgid "execution of %s scriptlet from %s-%s-%s failed, waitpid returned %s\n"
msgstr ""
-#: lib/psm.c:1021
+#: lib/psm.c:1001
#, c-format
msgid "execution of %s scriptlet from %s-%s-%s failed, exit status %d\n"
msgstr ""
-#: lib/psm.c:1328
+#: lib/psm.c:1305
#, c-format
msgid "%s: %s-%s-%s has %d files, test = %d\n"
msgstr ""
-#: lib/psm.c:1425
+#: lib/psm.c:1417
#, c-format
msgid "%s: %s scriptlet failed (%d), skipping %s-%s-%s\n"
msgstr ""
-#: lib/psm.c:1563
+#: lib/psm.c:1544
#, c-format
msgid "unpacking of archive failed%s%s: %s\n"
msgstr ""
-#: lib/psm.c:1564
+#: lib/psm.c:1545
msgid " on file "
msgstr ""
-#: lib/psm.c:1796
+#: lib/psm.c:1783
#, c-format
msgid "%s: running %s script(s) (if any)\n"
msgstr ""