From d795e1e296bc300ee6ae51f9b7037e6b9de82500 Mon Sep 17 00:00:00 2001 From: jbj Date: Wed, 14 Jul 1999 15:43:30 +0000 Subject: [PATCH] move install/erase major modes into rpmlib. CVS patchset: 3155 CVS date: 1999/07/14 15:43:30 --- CHANGES | 1 + Makefile.am | 5 +- install.c | 466 ------------------------------------------------------- install.h | 27 ---- lib/Makefile.am | 2 +- lib/rpminstall.c | 19 ++- lib/rpmlib.h | 27 ++++ po/POTFILES.in | 2 +- po/rpm.pot | 264 +++++++++++++++---------------- rpm.c | 6 +- 10 files changed, 178 insertions(+), 641 deletions(-) delete mode 100644 install.c delete mode 100644 install.h diff --git a/CHANGES b/CHANGES index 489b7d9..971e440 100644 --- a/CHANGES +++ b/CHANGES @@ -3,6 +3,7 @@ - add configure scaffolding to support rpm-4.0 packages. - include shared libs in rpm-devel (no versioning yet). - add epoch (as [0-9]*:version-release) to install dependency parse. + - move install/erase major modes into rpmlib. 3.0.1 -> 3.0.2 - eliminate armv4 entries from rpmrc (Andrew E. Mileski). diff --git a/Makefile.am b/Makefile.am index 577377f..e249ffe 100644 --- a/Makefile.am +++ b/Makefile.am @@ -40,10 +40,9 @@ pkglib_SCRIPTS = find-provides find-requires mkinstalldirs \ config.guess config.sub noinst_HEADERS = \ - acconfig.h build.h checksig.h install.h \ - system.h + acconfig.h build.h checksig.h system.h -rpm_SOURCES = build.c checksig.c install.c rpm.c +rpm_SOURCES = build.c checksig.c rpm.c rpm_LDADD = $(mylibs) @LIBMISC@ $(PROGRAMS): $(mylibs) @LIBMISC@ diff --git a/install.c b/install.c deleted file mode 100644 index 60aeeaa..0000000 --- a/install.c +++ /dev/null @@ -1,466 +0,0 @@ -#include "system.h" - -#include "build/rpmbuild.h" - -#include "install.h" -#include "rpmurl.h" - -static void printHash(const unsigned long amount, const unsigned long total); -static void * showProgress(const Header h, const rpmCallbackType what, - const unsigned long amount, - const unsigned long total, - const void * pkgKey, void * data); - -static int hashesPrinted = 0; - -static void printHash(const unsigned long amount, const unsigned long total) { - int hashesNeeded; - - if (hashesPrinted != 50) { - hashesNeeded = 50 * (total ? (((float) amount) / total) : 1); - while (hashesNeeded > hashesPrinted) { - printf("#"); - fflush(stdout); - hashesPrinted++; - } - fflush(stdout); - hashesPrinted = hashesNeeded; - - if (hashesPrinted == 50) - fprintf(stdout, "\n"); - } -} - -static void * showProgress(const Header h, const rpmCallbackType what, - const unsigned long amount, - const unsigned long total, - const void * pkgKey, void * data) { - char * s; - int flags = (int) data; - void * rc = NULL; - const char * filename = pkgKey; - static FD_t fd; - - switch (what) { - case RPMCALLBACK_INST_OPEN_FILE: - fd = fdOpen(filename, O_RDONLY, 0); - return fd; - - case RPMCALLBACK_INST_CLOSE_FILE: - fdClose(fd); - break; - - case RPMCALLBACK_INST_START: - hashesPrinted = 0; - if (flags & INSTALL_LABEL) { - if (flags & INSTALL_HASH) { - s = headerSprintf(h, "%{NAME}", - rpmTagTable, rpmHeaderFormats, NULL); - printf("%-28s", s); - fflush(stdout); - } else { - s = headerSprintf(h, "%{NAME}-%{VERSION}-%{RELEASE}", - rpmTagTable, rpmHeaderFormats, NULL); - printf("%s\n", s); - } - free(s); - } - break; - - case RPMCALLBACK_INST_PROGRESS: - if (flags & INSTALL_PERCENT) { - fprintf(stdout, "%%%% %f\n", (total - ? ((float) ((((float) amount) / total) * 100)) - : 100.0)); - } else if (flags & INSTALL_HASH) { - printHash(amount, total); - } - break; - - case RPMCALLBACK_TRANS_PROGRESS: - case RPMCALLBACK_TRANS_START: - case RPMCALLBACK_TRANS_STOP: - case RPMCALLBACK_UNINST_PROGRESS: - case RPMCALLBACK_UNINST_START: - case RPMCALLBACK_UNINST_STOP: - /* ignore */ - break; - } - - return rc; -} - -int doInstall(const char * rootdir, const char ** argv, int transFlags, - int interfaceFlags, int probFilter, - rpmRelocation * relocations) { - rpmdb db = NULL; - FD_t fd; - int i; - int mode, rc, major; - const char ** packages, ** tmpPackages; - const char ** filename; - int numPackages; - int numTmpPackages = 0, numBinaryPackages = 0, numSourcePackages = 0; - int numFailed = 0; - Header h; - int isSource; - rpmTransactionSet rpmdep = NULL; - struct rpmDependencyConflict * conflicts; - int numConflicts; - int stopInstall = 0; - size_t nb; - int notifyFlags = interfaceFlags | (rpmIsVerbose() ? INSTALL_LABEL : 0 ); - int dbIsOpen = 0; - const char ** sourcePackages; - rpmRelocation * defaultReloc; - - if (transFlags & RPMTRANS_FLAG_TEST) - mode = O_RDONLY; - else - mode = O_RDWR | O_CREAT; - - for (defaultReloc = relocations; defaultReloc && defaultReloc->oldPath; - defaultReloc++); - if (defaultReloc && !defaultReloc->newPath) defaultReloc = NULL; - - rpmMessage(RPMMESS_DEBUG, _("counting packages to install\n")); - for (filename = argv, numPackages = 0; *filename; filename++, numPackages++) - ; - - rpmMessage(RPMMESS_DEBUG, _("found %d packages\n"), numPackages); - - nb = (numPackages + 1) * sizeof(char *); - packages = alloca(nb); - memset(packages, 0, nb); - tmpPackages = alloca(nb); - memset(tmpPackages, 0, nb); - nb = (numPackages + 1) * sizeof(Header); - - rpmMessage(RPMMESS_DEBUG, _("looking for packages to download\n")); - for (filename = argv, i = 0; *filename; filename++) { - - switch (urlIsURL(*filename)) { - case URL_IS_FTP: - case URL_IS_HTTP: - case URL_IS_PATH: - { int myrc; - const char *tfn; - - if (rpmIsVerbose()) - fprintf(stdout, _("Retrieving %s\n"), *filename); - - { char tfnbuf[64]; - strcpy(tfnbuf, "rpm-xfer.XXXXXX"); - /* XXX watchout for rootdir = NULL */ - tfn = rpmGetPath( (rootdir ? rootdir : ""), - "%{_tmppath}/", mktemp(tfnbuf), NULL); - } - - rpmMessage(RPMMESS_DEBUG, _(" ... as %s\n"), tfn); - myrc = urlGetFile(*filename, tfn); - if (myrc < 0) { - rpmMessage(RPMMESS_ERROR, - _("skipping %s - transfer failed - %s\n"), - *filename, ftpStrerror(myrc)); - numFailed++; - packages[i] = NULL; - xfree(tfn); - } else { - tmpPackages[numTmpPackages++] = packages[i++] = tfn; - } - } break; - default: - packages[i++] = *filename; - break; - } - } - - sourcePackages = alloca(sizeof(*sourcePackages) * i); - - rpmMessage(RPMMESS_DEBUG, _("retrieved %d packages\n"), numTmpPackages); - - /* Build up the transaction set. As a special case, v1 source packages - are installed right here, only because they don't have headers and - would create all sorts of confusion later. */ - - for (filename = packages; *filename; filename++) { - fd = fdOpen(*filename, O_RDONLY, 0); - if (fdFileno(fd) < 0) { - rpmMessage(RPMMESS_ERROR, _("cannot open file %s\n"), *filename); - numFailed++; - packages[i] = NULL; - continue; - } - - rc = rpmReadPackageHeader(fd, &h, &isSource, &major, NULL); - - switch (rc) { - case 1: - fdClose(fd); - rpmMessage(RPMMESS_ERROR, - _("%s does not appear to be a RPM package\n"), - *filename); - break; - default: - rpmMessage(RPMMESS_ERROR, _("%s cannot be installed\n"), *filename); - numFailed++; - packages[i] = NULL; - break; - case 0: - if (isSource) { - sourcePackages[numSourcePackages++] = *filename; - fdClose(fd); - } else { - if (!dbIsOpen) { - if (rpmdbOpen(rootdir, &db, mode, 0644)) { - const char *dn; - dn = rpmGetPath( (rootdir ? rootdir : ""), - "%{_dbpath}", NULL); - rpmMessage(RPMMESS_ERROR, - _("cannot open %s/packages.rpm\n"), dn); - xfree(dn); - exit(EXIT_FAILURE); - } - rpmdep = rpmtransCreateSet(db, rootdir); - dbIsOpen = 1; - } - - if (defaultReloc) { - char ** paths; - char * name; - int c; - - if (headerGetEntry(h, RPMTAG_PREFIXES, NULL, - (void **) &paths, &c) && (c == 1)) { - defaultReloc->oldPath = strdup(paths[0]); - free(paths); - } else { - headerGetEntry(h, RPMTAG_NAME, NULL, (void **) &name, - NULL); - rpmMessage(RPMMESS_ERROR, - _("package %s is not relocateable\n"), name); - - return numPackages; - } - } - - rc = rpmtransAddPackage(rpmdep, h, NULL, *filename, - (interfaceFlags & INSTALL_UPGRADE) != 0, - relocations); - if (rc) { - if (rc == 1) - rpmMessage(RPMMESS_ERROR, - _("error reading from file %s\n"), *filename); - else if (rc == 2) - rpmMessage(RPMMESS_ERROR, - _("file %s requires a newer version of RPM\n"), - *filename); - return numPackages; - } - - if (defaultReloc) { - free(defaultReloc->oldPath); - defaultReloc->oldPath = NULL; - } - - fdClose(fd); - numBinaryPackages++; - } - break; - } - } - - rpmMessage(RPMMESS_DEBUG, _("found %d source and %d binary packages\n"), - numSourcePackages, numBinaryPackages); - - if (numBinaryPackages && !(interfaceFlags & INSTALL_NODEPS)) { - if (rpmdepCheck(rpmdep, &conflicts, &numConflicts)) { - numFailed = numPackages; - stopInstall = 1; - } - - if (!stopInstall && conflicts) { - rpmMessage(RPMMESS_ERROR, _("failed dependencies:\n")); - printDepProblems(stderr, conflicts, numConflicts); - rpmdepFreeConflicts(conflicts, numConflicts); - numFailed = numPackages; - stopInstall = 1; - } - } - - if (numBinaryPackages && !(interfaceFlags & INSTALL_NOORDER)) { - if (rpmdepOrder(rpmdep)) { - numFailed = numPackages; - stopInstall = 1; - } - } - - if (numBinaryPackages && !stopInstall) { - rpmProblemSet probs = NULL; -; - rpmMessage(RPMMESS_DEBUG, _("installing binary packages\n")); - rc = rpmRunTransactions(rpmdep, showProgress, (void *) notifyFlags, - NULL, &probs, transFlags, probFilter); - - if (rc < 0) { - numFailed += numBinaryPackages; - } else if (rc) { - numFailed += rc; - rpmProblemSetPrint(stderr, probs); - } - - if (probs) rpmProblemSetFree(probs); - } - - if (numBinaryPackages) rpmtransFree(rpmdep); - - if (numSourcePackages && !stopInstall) { - for (i = 0; i < numSourcePackages; i++) { - fd = fdOpen(sourcePackages[i], O_RDONLY, 0); - if (fdFileno(fd) < 0) { - rpmMessage(RPMMESS_ERROR, _("cannot open file %s\n"), - sourcePackages[i]); - continue; - } - - if (!(transFlags & RPMTRANS_FLAG_TEST)) - numFailed += rpmInstallSourcePackage(rootdir, fd, NULL, - showProgress, (void *) notifyFlags, NULL); - - fdClose(fd); - } - } - - for (i = 0; i < numTmpPackages; i++) { - unlink(tmpPackages[i]); - xfree(tmpPackages[i]); - } - - /* FIXME how do we close our various fd's? */ - - if (dbIsOpen) rpmdbClose(db); - - return numFailed; -} - -int doUninstall(const char * rootdir, const char ** argv, int transFlags, - int interfaceFlags) { - rpmdb db; - dbiIndexSet matches; - int i, j; - int mode; - int rc; - int count; - const char ** arg; - int numFailed = 0; - rpmTransactionSet rpmdep; - struct rpmDependencyConflict * conflicts; - int numConflicts; - int stopUninstall = 0; - int numPackages = 0; - rpmProblemSet probs; - - if (transFlags & RPMTRANS_FLAG_TEST) - mode = O_RDONLY; - else - mode = O_RDWR | O_EXCL; - - if (rpmdbOpen(rootdir, &db, mode, 0644)) { - const char *dn; - dn = rpmGetPath( (rootdir ? rootdir : ""), "%{_dbpath}", NULL); - rpmMessage(RPMMESS_ERROR, _("cannot open %s/packages.rpm\n"), dn); - xfree(dn); - exit(EXIT_FAILURE); - } - - j = 0; - rpmdep = rpmtransCreateSet(db, rootdir); - for (arg = argv; *arg; arg++) { - rc = rpmdbFindByLabel(db, *arg, &matches); - switch (rc) { - case 1: - rpmMessage(RPMMESS_ERROR, _("package %s is not installed\n"), *arg); - numFailed++; - break; - case 2: - rpmMessage(RPMMESS_ERROR, _("searching for package %s\n"), *arg); - numFailed++; - break; - default: - count = 0; - for (i = 0; i < dbiIndexSetCount(matches); i++) - if (dbiIndexRecordOffset(matches, i)) count++; - - if (count > 1 && !(interfaceFlags & UNINSTALL_ALLMATCHES)) { - rpmMessage(RPMMESS_ERROR, _("\"%s\" specifies multiple packages\n"), - *arg); - numFailed++; - } - else { - for (i = 0; i < dbiIndexSetCount(matches); i++) { - unsigned int recOffset = dbiIndexRecordOffset(matches, i); - if (recOffset) { - rpmtransRemovePackage(rpmdep, recOffset); - numPackages++; - } - } - } - - dbiFreeIndexRecord(matches); - break; - } - } - - if (!(interfaceFlags & UNINSTALL_NODEPS)) { - if (rpmdepCheck(rpmdep, &conflicts, &numConflicts)) { - numFailed = numPackages; - stopUninstall = 1; - } - - if (!stopUninstall && conflicts) { - rpmMessage(RPMMESS_ERROR, _("removing these packages would break " - "dependencies:\n")); - printDepProblems(stderr, conflicts, numConflicts); - rpmdepFreeConflicts(conflicts, numConflicts); - numFailed += numPackages; - stopUninstall = 1; - } - } - - if (!stopUninstall) { - numFailed += rpmRunTransactions(rpmdep, NULL, NULL, NULL, &probs, - transFlags, 0); - } - - rpmtransFree(rpmdep); - rpmdbClose(db); - - return numFailed; -} - -int doSourceInstall(const char * rootdir, const char * arg, const char ** specFile, - char ** cookie) { - FD_t fd; - int rc; - - fd = fdOpen(arg, O_RDONLY, 0); - if (fdFileno(fd) < 0) { - rpmMessage(RPMMESS_ERROR, _("cannot open %s\n"), arg); - return 1; - } - - if (rpmIsVerbose()) - fprintf(stdout, _("Installing %s\n"), arg); - - rc = rpmInstallSourcePackage(rootdir, fd, specFile, NULL, NULL, - cookie); - if (rc == 1) { - rpmMessage(RPMMESS_ERROR, _("%s cannot be installed\n"), arg); - if (specFile) FREE(*specFile); - if (cookie) FREE(*cookie); - } - - fdClose(fd); - - return rc; -} diff --git a/install.h b/install.h deleted file mode 100644 index 761a8c5..0000000 --- a/install.h +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef _H_INSTALL -#define _H_INSTALL - -#include "lib/rpmlib.h" - -#define INSTALL_PERCENT (1 << 0) -#define INSTALL_HASH (1 << 1) -#define INSTALL_NODEPS (1 << 2) -#define INSTALL_NOORDER (1 << 3) -#define INSTALL_LABEL (1 << 4) /* set if we're being verbose */ -#define INSTALL_UPGRADE (1 << 5) - -#define UNINSTALL_NODEPS (1 << 0) -#define UNINSTALL_ALLMATCHES (1 << 1) - -int doInstall(const char * rootdir, const char ** argv, int installFlags, - int interfaceFlags, int probFilter, rpmRelocation * relocations); -int doSourceInstall(const char * prefix, const char * arg, const char ** specFile, - char ** cookie); -int doUninstall(const char * rootdir, const char ** argv, int uninstallFlags, - int interfaceFlags); -void printDepFlags(FILE * f, const char * version, int flags); -void printDepProblems(FILE * f, struct rpmDependencyConflict * conflicts, - int numConflicts); - -#endif - diff --git a/lib/Makefile.am b/lib/Makefile.am index 35f9713..711e18c 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -22,7 +22,7 @@ librpm_la_SOURCES = \ formats.c fprint.c fs.c ftp.c hash.c header.c install.c \ lookup.c macro.c md5.c md5sum.c \ messages.c misc.c oldheader.c package.c problems.c query.c \ - rebuilddb.c rpmdb.c rpmerr.c rpmio.c rpmbzio.c rpmlead.c \ + rebuilddb.c rpmbzio.c rpmdb.c rpmerr.c rpminstall.c rpmio.c rpmlead.c \ rpmrc.c signature.c stringbuf.c tagName.c tagtable.c transaction.c \ tread.c uninstall.c url.c verify.c diff --git a/lib/rpminstall.c b/lib/rpminstall.c index 60aeeaa..276b2bc 100644 --- a/lib/rpminstall.c +++ b/lib/rpminstall.c @@ -1,15 +1,18 @@ #include "system.h" -#include "build/rpmbuild.h" +#include +#include +#include -#include "install.h" -#include "rpmurl.h" +#ifdef DYING +#include "build/rpmbuild.h" static void printHash(const unsigned long amount, const unsigned long total); static void * showProgress(const Header h, const rpmCallbackType what, const unsigned long amount, const unsigned long total, const void * pkgKey, void * data); +#endif static int hashesPrinted = 0; @@ -90,7 +93,7 @@ static void * showProgress(const Header h, const rpmCallbackType what, return rc; } -int doInstall(const char * rootdir, const char ** argv, int transFlags, +int rpmInstall(const char * rootdir, const char ** argv, int transFlags, int interfaceFlags, int probFilter, rpmRelocation * relocations) { rpmdb db = NULL; @@ -343,7 +346,7 @@ int doInstall(const char * rootdir, const char ** argv, int transFlags, return numFailed; } -int doUninstall(const char * rootdir, const char ** argv, int transFlags, +int rpmErase(const char * rootdir, const char ** argv, int transFlags, int interfaceFlags) { rpmdb db; dbiIndexSet matches; @@ -438,7 +441,7 @@ int doUninstall(const char * rootdir, const char ** argv, int transFlags, return numFailed; } -int doSourceInstall(const char * rootdir, const char * arg, const char ** specFile, +int rpmInstallSource(const char * rootdir, const char * arg, const char ** specFile, char ** cookie) { FD_t fd; int rc; @@ -456,8 +459,8 @@ int doSourceInstall(const char * rootdir, const char * arg, const char ** specFi cookie); if (rc == 1) { rpmMessage(RPMMESS_ERROR, _("%s cannot be installed\n"), arg); - if (specFile) FREE(*specFile); - if (cookie) FREE(*cookie); + if (specFile && *specFile) xfree(*specFile); + if (cookie && *cookie) free(*cookie); } fdClose(fd); diff --git a/lib/rpmlib.h b/lib/rpmlib.h index a4ac39d..60f1503 100644 --- a/lib/rpmlib.h +++ b/lib/rpmlib.h @@ -602,6 +602,9 @@ int rpmGetFilesystemList(const char *** listptr, int * num); int rpmGetFilesystemUsage(const char ** filelist, int_32 * fssizes, int numFiles, uint_32 ** usagesPtr, int flags); +/* ==================================================================== */ +/* --- query/verify */ + /* XXX SPECFILE is not verify sources */ enum rpmQVSources { RPMQV_PACKAGE = 0, RPMQV_PATH, RPMQV_ALL, RPMQV_RPM, RPMQV_GROUP, RPMQV_WHATPROVIDES, RPMQV_WHATREQUIRES, @@ -649,6 +652,30 @@ extern struct poptOption rpmVerifyPoptTable[]; int showVerifyPackage(QVA_t *qva, rpmdb db, Header h); int rpmVerify(QVA_t *qva, enum rpmQVSources source, const char *arg); +/* ==================================================================== */ +/* --- install/upgrade/erase */ + +#define INSTALL_PERCENT (1 << 0) +#define INSTALL_HASH (1 << 1) +#define INSTALL_NODEPS (1 << 2) +#define INSTALL_NOORDER (1 << 3) +#define INSTALL_LABEL (1 << 4) /* set if we're being verbose */ +#define INSTALL_UPGRADE (1 << 5) + +#define UNINSTALL_NODEPS (1 << 0) +#define UNINSTALL_ALLMATCHES (1 << 1) + +int rpmInstall(const char * rootdir, const char ** argv, int installFlags, + int interfaceFlags, int probFilter, rpmRelocation * relocations); +int rpmInstallSource(const char * prefix, const char * arg, const char ** specFile, + char ** cookie); +int rpmErase(const char * rootdir, const char ** argv, int uninstallFlags, + int interfaceFlags); + +void printDepFlags(FILE * f, const char * version, int flags); +void printDepProblems(FILE * f, struct rpmDependencyConflict * conflicts, + int numConflicts); + #ifdef __cplusplus } #endif diff --git a/po/POTFILES.in b/po/POTFILES.in index f8e3ad5..0207300 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -5,7 +5,6 @@ build.c checksig.c convertdb.c -install.c oldrpmdb.c rpm.c rpm2cpio.c @@ -52,6 +51,7 @@ lib/rebuilddb.c lib/rpmbzio.c lib/rpmdb.c lib/rpmerr.c +lib/rpminstall.c lib/rpmio.c lib/rpmlead.c lib/rpmrc.c diff --git a/po/rpm.pot b/po/rpm.pot index d45eccc..820a6fb 100644 --- a/po/rpm.pot +++ b/po/rpm.pot @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 1999-07-13 19:29-0400\n" +"POT-Creation-Date: 1999-07-14 11:36-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -14,7 +14,7 @@ msgstr "" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: ENCODING\n" -#: ../build.c:24 ../install.c:220 ../install.c:371 +#: ../build.c:24 ../lib/rpminstall.c:223 ../lib/rpminstall.c:374 #, c-format msgid "cannot open %s/packages.rpm\n" msgstr "" @@ -235,111 +235,6 @@ msgstr "" msgid "rpmconvert 1.0 - converting database in /var/lib/rpm\n" msgstr "" -#: ../install.c:126 -msgid "counting packages to install\n" -msgstr "" - -#: ../install.c:130 -#, c-format -msgid "found %d packages\n" -msgstr "" - -#: ../install.c:139 -msgid "looking for packages to download\n" -msgstr "" - -#: ../install.c:150 -#, c-format -msgid "Retrieving %s\n" -msgstr "" - -#: ../install.c:159 -#, c-format -msgid " ... as %s\n" -msgstr "" - -#: ../install.c:163 -#, c-format -msgid "skipping %s - transfer failed - %s\n" -msgstr "" - -#: ../install.c:180 -#, c-format -msgid "retrieved %d packages\n" -msgstr "" - -#: ../install.c:189 ../install.c:321 -#, c-format -msgid "cannot open file %s\n" -msgstr "" - -#: ../install.c:201 ../lib/query.c:574 -#, c-format -msgid "%s does not appear to be a RPM package\n" -msgstr "" - -#: ../install.c:205 ../install.c:458 -#, c-format -msgid "%s cannot be installed\n" -msgstr "" - -#: ../install.c:241 -#, c-format -msgid "package %s is not relocateable\n" -msgstr "" - -#: ../install.c:253 -#, c-format -msgid "error reading from file %s\n" -msgstr "" - -#: ../install.c:256 -#, c-format -msgid "file %s requires a newer version of RPM\n" -msgstr "" - -#: ../install.c:273 -#, c-format -msgid "found %d source and %d binary packages\n" -msgstr "" - -#: ../install.c:283 -msgid "failed dependencies:\n" -msgstr "" - -#: ../install.c:301 -msgid "installing binary packages\n" -msgstr "" - -#: ../install.c:382 ../lib/query.c:728 -#, c-format -msgid "package %s is not installed\n" -msgstr "" - -#: ../install.c:386 -#, c-format -msgid "searching for package %s\n" -msgstr "" - -#: ../install.c:395 -#, c-format -msgid "\"%s\" specifies multiple packages\n" -msgstr "" - -#: ../install.c:421 -msgid "removing these packages would break dependencies:\n" -msgstr "" - -#: ../install.c:448 -#, c-format -msgid "cannot open %s\n" -msgstr "" - -#: ../install.c:453 -#, c-format -msgid "Installing %s\n" -msgstr "" - #: ../oldrpmdb.c:454 #, c-format msgid "pulling %s from database\n" @@ -2360,7 +2255,7 @@ msgstr "" msgid "(unknown type)" msgstr "" -#: ../lib/install.c:118 ../lib/uninstall.c:111 +#: ../lib/install.c:118 ../lib/uninstall.c:160 #, c-format msgid " file: %s action: %s\n" msgstr "" @@ -2423,7 +2318,7 @@ msgstr "" msgid "renaming %s to %s\n" msgstr "" -#: ../lib/install.c:513 ../lib/install.c:802 ../lib/uninstall.c:337 +#: ../lib/install.c:513 ../lib/install.c:802 ../lib/uninstall.c:26 #, c-format msgid "rename of %s to %s failed: %s" msgstr "" @@ -2765,6 +2660,11 @@ msgstr "" msgid "old format source packages cannot be queried\n" msgstr "" +#: ../lib/query.c:574 ../lib/rpminstall.c:204 +#, c-format +msgid "%s does not appear to be a RPM package\n" +msgstr "" + #: ../lib/query.c:577 #, c-format msgid "query of %s failed\n" @@ -2824,6 +2724,11 @@ msgstr "" msgid "record %d could not be read\n" msgstr "" +#: ../lib/query.c:728 ../lib/rpminstall.c:385 +#, c-format +msgid "package %s is not installed\n" +msgstr "" + #: ../lib/query.c:731 #, c-format msgid "error looking for package %s\n" @@ -2933,7 +2838,7 @@ msgstr "" msgid "package %s not found in %s" msgstr "" -#: ../lib/rpmdb.c:412 ../lib/uninstall.c:40 +#: ../lib/rpmdb.c:412 ../lib/uninstall.c:89 #, c-format msgid "cannot read header at %d for uninstall" msgstr "" @@ -2996,6 +2901,101 @@ msgstr "" msgid "header changed size!" msgstr "" +#: ../lib/rpminstall.c:129 +msgid "counting packages to install\n" +msgstr "" + +#: ../lib/rpminstall.c:133 +#, c-format +msgid "found %d packages\n" +msgstr "" + +#: ../lib/rpminstall.c:142 +msgid "looking for packages to download\n" +msgstr "" + +#: ../lib/rpminstall.c:153 +#, c-format +msgid "Retrieving %s\n" +msgstr "" + +#: ../lib/rpminstall.c:162 +#, c-format +msgid " ... as %s\n" +msgstr "" + +#: ../lib/rpminstall.c:166 +#, c-format +msgid "skipping %s - transfer failed - %s\n" +msgstr "" + +#: ../lib/rpminstall.c:183 +#, c-format +msgid "retrieved %d packages\n" +msgstr "" + +#: ../lib/rpminstall.c:192 ../lib/rpminstall.c:324 +#, c-format +msgid "cannot open file %s\n" +msgstr "" + +#: ../lib/rpminstall.c:208 ../lib/rpminstall.c:461 +#, c-format +msgid "%s cannot be installed\n" +msgstr "" + +#: ../lib/rpminstall.c:244 +#, c-format +msgid "package %s is not relocateable\n" +msgstr "" + +#: ../lib/rpminstall.c:256 +#, c-format +msgid "error reading from file %s\n" +msgstr "" + +#: ../lib/rpminstall.c:259 +#, c-format +msgid "file %s requires a newer version of RPM\n" +msgstr "" + +#: ../lib/rpminstall.c:276 +#, c-format +msgid "found %d source and %d binary packages\n" +msgstr "" + +#: ../lib/rpminstall.c:286 +msgid "failed dependencies:\n" +msgstr "" + +#: ../lib/rpminstall.c:304 +msgid "installing binary packages\n" +msgstr "" + +#: ../lib/rpminstall.c:389 +#, c-format +msgid "searching for package %s\n" +msgstr "" + +#: ../lib/rpminstall.c:398 +#, c-format +msgid "\"%s\" specifies multiple packages\n" +msgstr "" + +#: ../lib/rpminstall.c:424 +msgid "removing these packages would break dependencies:\n" +msgstr "" + +#: ../lib/rpminstall.c:451 +#, c-format +msgid "cannot open %s\n" +msgstr "" + +#: ../lib/rpminstall.c:456 +#, c-format +msgid "Installing %s\n" +msgstr "" + #: ../lib/rpmlead.c:41 #, c-format msgid "read failed: %s (%d)" @@ -3213,56 +3213,56 @@ msgstr "" msgid "You must set \"%%_pgp_name\" in your macro file" msgstr "" -#: ../lib/transaction.c:793 +#: ../lib/transaction.c:345 #, c-format msgid "relocating %s to %s\n" msgstr "" -#: ../lib/transaction.c:799 +#: ../lib/transaction.c:351 #, c-format msgid "excluding %s\n" msgstr "" -#: ../lib/transaction.c:887 +#: ../lib/transaction.c:464 #, c-format msgid "%s skipped due to missingok flag\n" msgstr "" -#: ../lib/uninstall.c:51 +#: ../lib/uninstall.c:37 #, c-format -msgid "cannot read packages named %s for uninstall" +msgid "cannot remove %s - directory not empty" msgstr "" -#: ../lib/uninstall.c:79 +#: ../lib/uninstall.c:40 #, c-format -msgid "will remove files test = %d\n" +msgid "rmdir of %s failed: %s" msgstr "" -#: ../lib/uninstall.c:124 -msgid "running postuninstall script (if any)\n" +#: ../lib/uninstall.c:48 +#, c-format +msgid "removal of %s failed: %s" msgstr "" -#: ../lib/uninstall.c:138 -msgid "removing database entry\n" +#: ../lib/uninstall.c:100 +#, c-format +msgid "cannot read packages named %s for uninstall" msgstr "" -#: ../lib/uninstall.c:289 -msgid "execution of script failed" +#: ../lib/uninstall.c:128 +#, c-format +msgid "will remove files test = %d\n" msgstr "" -#: ../lib/uninstall.c:348 -#, c-format -msgid "cannot remove %s - directory not empty" +#: ../lib/uninstall.c:173 +msgid "running postuninstall script (if any)\n" msgstr "" -#: ../lib/uninstall.c:351 -#, c-format -msgid "rmdir of %s failed: %s" +#: ../lib/uninstall.c:187 +msgid "removing database entry\n" msgstr "" -#: ../lib/uninstall.c:359 -#, c-format -msgid "removal of %s failed: %s" +#: ../lib/uninstall.c:339 +msgid "execution of script failed" msgstr "" #: ../lib/url.c:135 diff --git a/rpm.c b/rpm.c index b9288ef..d5c6cc4 100755 --- a/rpm.c +++ b/rpm.c @@ -1194,7 +1194,7 @@ int main(int argc, char ** argv) } while ((pkg = poptGetArg(optCon))) { - if (doSourceInstall("/", pkg, &specFile, &cookie)) + if (rpmInstallSource("/", pkg, &specFile, &cookie)) exit(EXIT_FAILURE); if (build(specFile, &buildArgs, passPhrase, 0, cookie, rcfile, force, noDeps)) { @@ -1262,7 +1262,7 @@ int main(int argc, char ** argv) if (noDeps) interfaceFlags |= UNINSTALL_NODEPS; if (allMatches) interfaceFlags |= UNINSTALL_ALLMATCHES; - ec = doUninstall(rootdir, (const char **)poptGetArgs(optCon), + ec = rpmErase(rootdir, (const char **)poptGetArgs(optCon), uninstallFlags, interfaceFlags); break; @@ -1317,7 +1317,7 @@ int main(int argc, char ** argv) relocations[numRelocations].newPath = NULL; } - ec += doInstall(rootdir, (const char **)poptGetArgs(optCon), + ec += rpmInstall(rootdir, (const char **)poptGetArgs(optCon), installFlags, interfaceFlags, probFilter, relocations); break; -- 2.7.4