From: ewt Date: Sun, 7 Feb 1999 20:09:27 +0000 (+0000) Subject: need to chroot() a bit sooner X-Git-Tag: rpm-4.4-release~3129 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=177b2215a967e09b4aaf9e92d4dd56b556e510a9;p=platform%2Fupstream%2Frpm.git need to chroot() a bit sooner CVS patchset: 2781 CVS date: 1999/02/07 20:09:27 --- diff --git a/lib/transaction.c b/lib/transaction.c index 705ce97..14ce899 100644 --- a/lib/transaction.c +++ b/lib/transaction.c @@ -197,13 +197,6 @@ int rpmRunTransactions(rpmTransactionSet ts, rpmCallbackFunction notify, fi->fps = alloca(fi->fc * sizeof(*fi->fps)); } - for (fi = flList; (fi - flList) < flEntries; fi++) { - fpLookupList(fi->fl, fi->fps, fi->fc, 1); - for (i = 0; i < fi->fc; i++) { - htAddEntry(ht, fi->fps + i, fi); - } - } - chptr = currentDirectory(); currDir = alloca(strlen(chptr) + 1); strcpy(currDir, chptr); @@ -212,6 +205,13 @@ int rpmRunTransactions(rpmTransactionSet ts, rpmCallbackFunction notify, chroot(ts->root); for (fi = flList; (fi - flList) < flEntries; fi++) { + fpLookupList(fi->fl, fi->fps, fi->fc, 1); + for (i = 0; i < fi->fc; i++) { + htAddEntry(ht, fi->fps + i, fi); + } + } + + for (fi = flList; (fi - flList) < flEntries; fi++) { matches = malloc(sizeof(*matches) * fi->fc); if (rpmdbFindFpList(ts->db, fi->fps, matches, fi->fc)) return 1; @@ -321,7 +321,8 @@ int rpmRunTransactions(rpmTransactionSet ts, rpmCallbackFunction notify, if (installBinaryPackage(ts->root, ts->db, fd, hdrs[alp - al->list], instFlags, notify, notifyData, alp->key, fi->actions, - fi->fc ? fi->replaced : NULL)) + fi->fc ? fi->replaced : NULL, + ts->scriptFd)) ourrc++; } else { ourrc++; @@ -340,7 +341,7 @@ int rpmRunTransactions(rpmTransactionSet ts, rpmCallbackFunction notify, /* fi is left at the first package which is to be removed */ for (i = 0; i < ts->numRemovedPackages; i++, fi++) { if (removeBinaryPackage(ts->root, ts->db, ts->removedPackages[i], - rmFlags, fi->actions)) + rmFlags, fi->actions, ts->scriptFd)) ourrc++; } @@ -350,6 +351,10 @@ int rpmRunTransactions(rpmTransactionSet ts, rpmCallbackFunction notify, return 0; } +void rpmtransSetScriptFd(rpmTransactionSet ts, FD_t fd) { + ts->scriptFd = fd; +} + static rpmProblemSet psCreate(void) { rpmProblemSet probs;