More functionality in psmStage.
authorjbj <devnull@localhost>
Thu, 1 Mar 2001 18:28:11 +0000 (18:28 +0000)
committerjbj <devnull@localhost>
Thu, 1 Mar 2001 18:28:11 +0000 (18:28 +0000)
CVS patchset: 4591
CVS date: 2001/03/01 18:28:11

lib/fsm.c
lib/fsm.h
lib/psm.c
po/rpm.pot

index 207f6c2..0fd18e4 100644 (file)
--- a/lib/fsm.c
+++ b/lib/fsm.c
@@ -1153,7 +1153,6 @@ int fsmStage(FSM_t fsm, fileStage stage)
                break;
        }
        break;
-    case FSM_PKGSAVE:
     case FSM_PKGBUILD:
        while (1) {
 
@@ -1915,7 +1914,6 @@ 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";
index 6cf75ff..85c0d2d 100644 (file)
--- a/lib/fsm.h
+++ b/lib/fsm.h
@@ -31,7 +31,6 @@ 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),
index f475240..5b5ae7d 100644 (file)
--- a/lib/psm.c
+++ b/lib/psm.c
@@ -591,24 +591,6 @@ static int installArchive(PSM_t psm, int allFiles)
     rc = psmStage(psm, PSM_RPMIO_FLAGS);
 #endif
 
-#ifdef DYING
-    {
-       psm->cfd = Fdopen(fdDup(Fileno(alp->fd)), psm->rpmio_flags);
-
-       rc = fsmSetup(fi->fsm, FSM_PKGINSTALL, ts, fi,
-                       psm->cfd, NULL, &psm->failedFile);
-       saveerrno = errno; /* XXX FIXME: Fclose with libio destroys errno */
-       Fclose(psm->cfd);
-       psm->cfd = NULL;
-       (void) fsmTeardown(fi->fsm);
-
-       if (!rc && ts->transFlags & RPMTRANS_FLAG_PKGCOMMIT) {
-           rc = fsmSetup(fi->fsm, FSM_PKGCOMMIT, ts, fi,
-                       NULL, NULL, &psm->failedFile);
-           (void) fsmTeardown(fi->fsm);
-       }
-    }
-#else
     psm->cfd = Fdopen(fdDup(Fileno(alp->fd)), psm->rpmio_flags);
     rc = psmStage(psm, PSM_PKGINSTALL);
     saveerrno = errno; /* XXX FIXME: Fclose with libio destroys errno */
@@ -616,7 +598,6 @@ static int installArchive(PSM_t psm, int allFiles)
     psm->cfd = NULL;
     if (!rc)
        rc = psmStage(psm, PSM_PKGCOMMIT);
-#endif
 
     if (rc) {
        /*
@@ -1422,7 +1403,7 @@ int psmStage(PSM_t psm, pkgStage stage)
        fi->actions = NULL;
 
        /* XXX failedFile? */
-       rc = fsmSetup(fi->fsm, FSM_PKGSAVE, ts, fi, psm->cfd, NULL, NULL);
+       rc = fsmSetup(fi->fsm, FSM_PKGBUILD, ts, fi, psm->cfd, NULL, NULL);
        (void) fsmTeardown(fi->fsm);
 
        fi->action = action;
@@ -1672,14 +1653,9 @@ psm->stepName = " install";
            goto exit;
     }
 
-#ifdef DYING
-    if (rpmdbAdd(ts->rpmdb, ts->id, fi->h))
-       goto exit;
-#else
     rc = psmStage(psm, PSM_RPMDB_ADD);
     if (rc)
        goto exit;
-#endif
 
     psm->scriptTag = RPMTAG_POSTIN;
     psm->progTag = RPMTAG_POSTINPROG;
@@ -1734,29 +1710,11 @@ assert(fi->type == TR_REMOVED);
        goto exit;
     }
 
-#ifndef        DYING
-    {  rpmdbMatchIterator mi = NULL;
-       Header h;
-
-       mi = rpmdbInitIterator(ts->rpmdb, RPMDBI_PACKAGES,
-                               &fi->record, sizeof(fi->record));
-
-       h = rpmdbNextIterator(mi);
-       if (h == NULL) {
-           rpmdbFreeIterator(mi);
-           rc = 2;
-           goto exit;
-       }
-       fi->h = headerLink(h);
-       rpmdbFreeIterator(mi);
-    }
-#else
     rc = psmStage(psm, PSM_RPMDB_LOAD);
     if (rc) {
        rc = 2;
        goto exit;
     }
-#endif
 
     psm->scriptTag = RPMTAG_PREUN;
     psm->progTag = RPMTAG_PREUNPROG;
@@ -1823,13 +1781,8 @@ exit:
     /* Restore root directory if changed. */
     (void) psmStage(psm, PSM_CHROOT_OUT);
 
-#ifndef        DYING
-    if (!rc && !(ts->transFlags & RPMTRANS_FLAG_TEST))
-       rpmdbRemove(ts->rpmdb, ts->id, fi->record);
-#else
     if (!rc)
        (void) psmStage(psm, PSM_RPMDB_REMOVE);
-#endif
 
     if (fi->h) {
        headerFree(fi->h);
@@ -1857,29 +1810,11 @@ psm->stepName = "    save";
 
 assert(fi->type == TR_REMOVED);
     /* Retrieve installed header. */
-#ifdef DYING
-    {  rpmdbMatchIterator mi = NULL;
-       Header h;
-
-       mi = rpmdbInitIterator(ts->rpmdb, RPMDBI_PACKAGES,
-                               &fi->record, sizeof(fi->record));
-
-       h = rpmdbNextIterator(mi);
-       if (h == NULL) {
-           rpmdbFreeIterator(mi);
-           rc = 2;
-           goto exit;
-       }
-       fi->h = headerLink(h);
-       rpmdbFreeIterator(mi);
-    }
-#else
     rc = psmStage(psm, PSM_RPMDB_LOAD);
     if (rc) {
        rc = 2;
        goto exit;
     }
-#endif
 
     /* Regenerate original header. */
     {  void * uh = NULL;
@@ -1979,29 +1914,6 @@ assert(fi->type == TR_REMOVED);
     (void) psmStage(psm, PSM_CHROOT_IN);
 
     /* Write the payload into the package. */
-#ifdef DYING
-    {
-       fileAction * actions = fi->actions;
-       fileAction action = fi->action;
-
-       fi->action = FA_COPYOUT;
-       fi->actions = NULL;
-
-       Fflush(fd);
-       psm->cfd = Fdopen(fdDup(Fileno(fd)), psm->rpmio_flags);
-
-       /* XXX failedFile? */
-       rc = fsmSetup(fi->fsm, FSM_PKGSAVE, ts, fi, psm->cfd, NULL, NULL);
-       (void) fsmTeardown(fi->fsm);
-
-       saveerrno = errno; /* XXX FIXME: Fclose with libio destroys errno */
-       Fclose(psm->cfd);
-       psm->cfd = NULL;
-       errno = saveerrno;
-       fi->action = action;
-       fi->actions = actions;
-    }
-#else
     Fflush(fd);
     psm->cfd = Fdopen(fdDup(Fileno(fd)), psm->rpmio_flags);
     rc = psmStage(psm, PSM_PKGSAVE);
@@ -2009,7 +1921,6 @@ assert(fi->type == TR_REMOVED);
     Fclose(psm->cfd);
     errno = saveerrno;
     psm->cfd = NULL;
-#endif
 
 exit:
     /* Restore root directory if changed. */
index ad52f3e..c0c27a3 100644 (file)
@@ -6,7 +6,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
-"POT-Creation-Date: 2001-03-01 11:57-0500\n"
+"POT-Creation-Date: 2001-03-01 13:01-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:1960
+#: build/pack.c:484 lib/psm.c:1913
 #, 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:2030
+#: build/pack.c:566 lib/psm.c:1959
 #, c-format
 msgid "Wrote: %s\n"
 msgstr ""
@@ -2481,27 +2481,27 @@ msgstr ""
 msgid "%s directory created with perms %04o.\n"
 msgstr ""
 
-#: lib/fsm.c:1345 lib/fsm.c:1462
+#: lib/fsm.c:1344 lib/fsm.c:1461
 #, c-format
 msgid "%s saved as %s\n"
 msgstr ""
 
-#: lib/fsm.c:1487
+#: lib/fsm.c:1486
 #, c-format
 msgid "%s rmdir of %s failed: Directory not empty\n"
 msgstr ""
 
-#: lib/fsm.c:1492
+#: lib/fsm.c:1491
 #, c-format
 msgid "%s rmdir of %s failed: %s\n"
 msgstr ""
 
-#: lib/fsm.c:1501
+#: lib/fsm.c:1500
 #, c-format
 msgid "%s unlink of %s failed: %s\n"
 msgstr ""
 
-#: lib/fsm.c:1518
+#: lib/fsm.c:1517
 #, c-format
 msgid "%s created as %s\n"
 msgstr ""
@@ -2894,58 +2894,58 @@ msgstr ""
 #. * was used up - if so, we should return a different error.
 #.
 #. XXX FIXME: Fclose with libio destroys errno
-#: lib/psm.c:627
+#: lib/psm.c:608
 #, c-format
 msgid "unpacking of archive failed%s%s: %s\n"
 msgstr ""
 
-#: lib/psm.c:628
+#: lib/psm.c:609
 msgid " on file "
 msgstr ""
 
-#: lib/psm.c:671
+#: lib/psm.c:652
 #, c-format
 msgid "cannot create %s %s\n"
 msgstr ""
 
-#: lib/psm.c:677
+#: lib/psm.c:658
 #, c-format
 msgid "cannot write to %s\n"
 msgstr ""
 
-#: lib/psm.c:699
+#: lib/psm.c:680
 msgid "installing a source package\n"
 msgstr ""
 
-#: lib/psm.c:749
+#: lib/psm.c:730
 msgid "source package contains no .spec file\n"
 msgstr ""
 
-#: lib/psm.c:836
+#: lib/psm.c:817
 msgid "source package expected, binary found\n"
 msgstr ""
 
-#: lib/psm.c:1106
+#: lib/psm.c:1087
 #, c-format
 msgid "execution of %s scriptlet from %s-%s-%s failed, waitpid returned %s\n"
 msgstr ""
 
-#: lib/psm.c:1113
+#: lib/psm.c:1094
 #, c-format
 msgid "execution of %s scriptlet from %s-%s-%s failed, exit status %d\n"
 msgstr ""
 
-#: lib/psm.c:1474
+#: lib/psm.c:1455
 #, c-format
 msgid "%s: running %s script(s) (if any)\n"
 msgstr ""
 
-#: lib/psm.c:1548 lib/psm.c:1722
+#: lib/psm.c:1529 lib/psm.c:1698
 #, c-format
 msgid "%s: %s-%s-%s has %d files, test = %d\n"
 msgstr ""
 
-#: lib/psm.c:1617
+#: lib/psm.c:1598
 msgid "skipping %s-%s-%s install, %%pre scriptlet failed rc %d\n"
 msgstr ""