-# Makefile.in generated automatically by automake 1.3b from Makefile.am
+# Makefile.in generated automatically by automake 1.3 from Makefile.am
# Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
includedir = @includedir@
oldincludedir = /usr/include
-DESTDIR =
+DISTDIR =
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
SCRIPTS = $(bin_SCRIPTS) $(config_SCRIPTS)
CFLAGS = @CFLAGS@
-COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LINK = $(CC) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
+COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
+LINK = $(CC) $(CFLAGS) $(LDFLAGS) -o $@
man8dir = $(mandir)/man8
MANS = $(man_MANS)
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
-TAR = gtar
+TAR = tar
GZIP = --best
DEP_FILES = .deps/build.P .deps/checksig.P .deps/convertdb.P \
.deps/ftp.P .deps/install.P .deps/oldrpmdb.P .deps/rpm.P \
$(ACLOCAL_M4): configure.in
cd $(srcdir) && $(ACLOCAL)
-config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+config.status: $(srcdir)/configure
$(SHELL) ./config.status --recheck
$(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
cd $(srcdir) && $(AUTOCONF)
maintainer-clean-hdr:
Makefile.inc: $(top_builddir)/config.status Makefile.inc.in
- cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
+ cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= ./config.status
lib-rpmrc: $(top_builddir)/config.status lib-rpmrc.in
- cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
+ cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= ./config.status
macros: $(top_builddir)/config.status macros.in
- cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
+ cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= ./config.status
mostlyclean-binPROGRAMS:
$(mkinstalldirs) $(DESTDIR)$(bindir)
@list='$(bin_PROGRAMS)'; for p in $$list; do \
if test -f $$p; then \
- echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \
- $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
+ echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`"; \
+ $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \
else :; fi; \
done
uninstall-binPROGRAMS:
@$(NORMAL_UNINSTALL)
list='$(bin_PROGRAMS)'; for p in $$list; do \
- rm -f $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
+ rm -f $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \
done
mostlyclean-noinstPROGRAMS:
$(mkinstalldirs) $(DESTDIR)$(rpmbindir)
@list='$(rpmbin_PROGRAMS)'; for p in $$list; do \
if test -f $$p; then \
- echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(rpmbindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \
- $(INSTALL_PROGRAM) $$p $(DESTDIR)$(rpmbindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
+ echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(rpmbindir)/`echo $$p|sed '$(transform)'`"; \
+ $(INSTALL_PROGRAM) $$p $(DESTDIR)$(rpmbindir)/`echo $$p|sed '$(transform)'`; \
else :; fi; \
done
uninstall-rpmbinPROGRAMS:
@$(NORMAL_UNINSTALL)
list='$(rpmbin_PROGRAMS)'; for p in $$list; do \
- rm -f $(DESTDIR)$(rpmbindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
+ rm -f $(DESTDIR)$(rpmbindir)/`echo $$p|sed '$(transform)'`; \
done
.s.o:
done
install-man: $(MANS)
@$(NORMAL_INSTALL)
- $(MAKE) $(AM_MAKEFLAGS) install-man8
+ $(MAKE) install-man8
uninstall-man:
@$(NORMAL_UNINSTALL)
- $(MAKE) $(AM_MAKEFLAGS) uninstall-man8
+ $(MAKE) uninstall-man8
install-configDATA: $(config_DATA)
@$(NORMAL_INSTALL)
list='$(SUBDIRS)'; for subdir in $$list; do \
target=`echo $@ | sed s/-recursive//`; \
echo "Making $$target in $$subdir"; \
- (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$target) \
+ (cd $$subdir && $(MAKE) $$target) \
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
done && test -z "$$fail"
for subdir in $$rev; do \
target=`echo $@ | sed s/-recursive//`; \
echo "Making $$target in $$subdir"; \
- (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$target) \
+ (cd $$subdir && $(MAKE) $$target) \
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
done && test -z "$$fail"
tags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
- (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+ (cd $$subdir && $(MAKE) tags); \
done
tags: TAGS
dc_install_base=`cd $(distdir)/=inst && pwd`; \
cd $(distdir)/=build \
&& ../configure --with-included-gettext --srcdir=.. --prefix=$$dc_install_base \
- && $(MAKE) $(AM_MAKEFLAGS) \
- && $(MAKE) $(AM_MAKEFLAGS) dvi \
- && $(MAKE) $(AM_MAKEFLAGS) check \
- && $(MAKE) $(AM_MAKEFLAGS) install \
- && $(MAKE) $(AM_MAKEFLAGS) installcheck \
- && $(MAKE) $(AM_MAKEFLAGS) dist
+ && $(MAKE) \
+ && $(MAKE) dvi \
+ && $(MAKE) check \
+ && $(MAKE) install \
+ && $(MAKE) installcheck \
+ && $(MAKE) dist
-rm -rf $(distdir)
@echo "========================"; \
echo "$(distdir).tar.gz is ready for distribution"; \
|| mkdir $(distdir)/$$subdir \
|| exit 1; \
chmod 777 $(distdir)/$$subdir; \
- (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(distdir) distdir=../$(distdir)/$$subdir distdir) \
+ (cd $$subdir && $(MAKE) top_distdir=../$(distdir) distdir=../$(distdir)/$$subdir distdir) \
|| exit 1; \
done
info: info-recursive
dvi: dvi-recursive
check: all-am
- $(MAKE) $(AM_MAKEFLAGS) check-recursive
+ $(MAKE) check-recursive
installcheck: installcheck-recursive
all-recursive-am: config.h
- $(MAKE) $(AM_MAKEFLAGS) all-recursive
+ $(MAKE) all-recursive
all-am: Makefile $(PROGRAMS) $(SCRIPTS) $(MANS) $(DATA) $(HEADERS) config.h
uninstall: uninstall-recursive uninstall-am
install-strip:
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
+ $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
installdirs: installdirs-recursive
- $(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(rpmbindir) \
- $(DESTDIR)$(bindir) $(DESTDIR)$(configdir) \
- $(DESTDIR)$(mandir)/man8 $(DESTDIR)$(configdir)
+ $(mkinstalldirs) $(DATADIR)$(bindir) $(DATADIR)$(rpmbindir) \
+ $(DATADIR)$(bindir) $(DATADIR)$(configdir) \
+ $(DESTDIR)$(mandir)/man8 $(DATADIR)$(configdir)
mostlyclean-generic:
+ -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
clean-generic:
+ -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
- -rm -f Makefile $(CONFIG_CLEAN_FILES)
+ -rm -f Makefile $(DISTCLEANFILES)
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
+ -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
+ -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
mostlyclean-am: mostlyclean-hdr mostlyclean-binPROGRAMS \
mostlyclean-noinstPROGRAMS mostlyclean-rpmbinPROGRAMS \
mostlyclean-compile mostlyclean-tags mostlyclean-depend \
-# Makefile.in generated automatically by automake 1.3b from Makefile.am
+# Makefile.in generated automatically by automake 1.3 from Makefile.am
# Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
includedir = @includedir@
oldincludedir = /usr/include
-DESTDIR =
+DISTDIR =
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
parseDescription.o parseFiles.o parsePreamble.o parsePrep.o parseReqs.o \
parseScript.o parseSpec.o reqprov.o spec.o
CFLAGS = @CFLAGS@
-COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LINK = $(CC) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
+COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
+LINK = $(CC) $(CFLAGS) $(LDFLAGS) -o $@
HEADERS = $(noinst_HEADERS) $(rpminc_HEADERS)
DIST_COMMON = Makefile.am Makefile.in TODO
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
-TAR = gtar
+TAR = tar
GZIP = --best
DEP_FILES = .deps/build.P .deps/expression.P .deps/files.P .deps/misc.P \
.deps/myftw.P .deps/names.P .deps/pack.P .deps/parseBuildInstallClean.P \
install-libLIBRARIES: $(lib_LIBRARIES)
@$(NORMAL_INSTALL)
$(mkinstalldirs) $(DESTDIR)$(libdir)
- @list='$(lib_LIBRARIES)'; for p in $$list; do \
+ list='$(lib_LIBRARIES)'; for p in $$list; do \
if test -f $$p; then \
echo " $(INSTALL_DATA) $$p $(DESTDIR)$(libdir)/$$p"; \
$(INSTALL_DATA) $$p $(DESTDIR)$(libdir)/$$p; \
info:
dvi:
check: all
+ $(MAKE)
installcheck:
install-exec: install-libLIBRARIES
@$(NORMAL_INSTALL)
uninstall: uninstall-libLIBRARIES uninstall-rpmincHEADERS
install-strip:
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
+ $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
installdirs:
- $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(rpmincdir)
+ $(mkinstalldirs) $(DATADIR)$(libdir) $(DATADIR)$(rpmincdir)
mostlyclean-generic:
+ -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
clean-generic:
+ -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
- -rm -f Makefile $(CONFIG_CLEAN_FILES)
+ -rm -f Makefile $(DISTCLEANFILES)
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
+ -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
+ -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
mostlyclean: mostlyclean-libLIBRARIES mostlyclean-compile \
mostlyclean-tags mostlyclean-depend mostlyclean-generic
#include "url.h"
#include "ftp.h"
-static int hashesPrinted = 0;
-
static void printHash(const unsigned long amount, const unsigned long total);
-static void printPercent(const unsigned long amount, const unsigned long total);
static void printDepProblems(FILE * f, struct rpmDependencyConflict * conflicts,
int numConflicts);
+static void showProgress(const Header h, const rpmNotifyType what,
+ const unsigned long amount,
+ const unsigned long total,
+ void * data);
+
+static int hashesPrinted = 0;
static void printHash(const unsigned long amount, const unsigned long total) {
int hashesNeeded;
}
}
-static void printPercent(const unsigned long amount, const unsigned long total)
-{
- fprintf(stdout, "%%%% %f\n", (total
- ? ((float) ((((float) amount) / total) * 100))
- : 100.0));
- fflush(stdout);
-}
-
-static int installPackages(char * rootdir, char ** packages,
- int numPackages, int installFlags,
- int interfaceFlags, rpmdb db,
- struct rpmRelocation * relocations) {
- FD_t fd;
- int i;
- int numFailed = 0;
- char ** filename;
- char * printFormat = NULL;
- char * chptr;
- int rc;
- rpmNotifyFunction fn;
-
- if (interfaceFlags & INSTALL_PERCENT)
- fn = printPercent;
- else if (interfaceFlags & INSTALL_HASH)
- fn = printHash;
- else
- fn = NULL;
-
- for (i = 0, filename = packages; i < numPackages; i++, filename++) {
- if (!*filename) continue;
+static void showProgress(const Header h, const rpmNotifyType what,
+ const unsigned long amount,
+ const unsigned long total,
+ void * data) {
+ char * s;
+ int flags = (int) data;
+ switch (what) {
+ case RPMNOTIFY_INST_START:
hashesPrinted = 0;
-
- fd = fdOpen(*filename, O_RDONLY, 0);
- if (fdFileno(fd) < 0) {
- rpmMessage(RPMMESS_ERROR, _("cannot open file %s\n"), *filename);
- numFailed++;
- *filename = NULL;
- continue;
- }
-
- if (interfaceFlags & INSTALL_PERCENT)
- printFormat = "%%f %s:%s:%s\n";
- else if (rpmIsVerbose() && (interfaceFlags & INSTALL_HASH)) {
- chptr = strrchr(*filename, '/');
- if (!chptr)
- chptr = *filename;
- else
- chptr++;
-
- printFormat = "%-28s";
- } else if (rpmIsVerbose())
- fprintf(stdout, _("Installing %s\n"), *filename);
-
- if (db != NULL) {
- rc = rpmInstallPackage(rootdir, db, fd, relocations, installFlags,
- fn, printFormat);
- } else {
- if (installFlags &= RPMINSTALL_TEST) {
- rpmMessage(RPMMESS_DEBUG, _("stopping source install as we're "
- "just testing\n"));
- rc = 0;
- } else {
- rc = rpmInstallSourcePackage(rootdir, fd, NULL, fn,
- printFormat, NULL);
- }
- }
-
- if (rc == 1) {
- rpmMessage(RPMMESS_ERROR,
- _("%s does not appear to be a RPM package\n"),
- *filename);
+ if (flags & INSTALL_LABEL) {
+ s = headerSprintf(h, "%s-%s-%s", rpmTagTable, rpmHeaderFormats,
+ NULL);
+ printf("%-28s", s);
+ free(s);
}
-
- if (rc) {
- rpmMessage(RPMMESS_ERROR, _("%s cannot be installed\n"), *filename);
- numFailed++;
+ break;
+
+ case RPMNOTIFY_INST_PROGRESS:
+ if (flags & INSTALL_PERCENT) {
+ fprintf(stdout, "%%%% %f\n", (total
+ ? ((float) ((((float) amount) / total) * 100))
+ : 100.0));
+ } else if (flags & INSTALL_PERCENT) {
+ printHash(amount, total);
}
-
- fdClose(fd);
+ break;
}
-
- return numFailed;
-}
+}
int doInstall(char * rootdir, char ** argv, int installFlags,
- int interfaceFlags, struct rpmRelocation * relocations) {
- rpmdb db;
+ int interfaceFlags, int probFilter,
+ rpmRelocation * relocations) {
+ rpmdb db = NULL;
FD_t fd;
int i;
- int mode, rc;
+ int mode, rc, major;
char ** packages, ** tmpPackages;
char ** filename;
int numPackages;
int numTmpPackages = 0, numBinaryPackages = 0, numSourcePackages = 0;
int numFailed = 0;
- Header * binaryHeaders;
+ Header h;
int isSource;
int tmpnum = 0;
- rpmDependencies rpmdep;
+ rpmTransactionSet rpmdep;
struct rpmDependencyConflict * conflicts;
int numConflicts;
int stopInstall = 0;
size_t nb;
const char *tmppath = rpmGetVar(RPMVAR_TMPPATH);
const char *myroot;
+ int notifyFlags = interfaceFlags | (rpmIsVerbose ? INSTALL_HASH : 0 );
+ int transFlags = 0;
+ rpmProblemSet probs, finalProbs;
if (installFlags & RPMINSTALL_TEST)
mode = O_RDONLY;
else
mode = O_RDWR | O_CREAT;
+ if (installFlags & RPMINSTALL_TEST)
+ transFlags |= RPMTRANS_FLAG_TEST;
+
rpmMessage(RPMMESS_DEBUG, _("counting packages to install\n"));
for (filename = argv, numPackages = 0; *filename; filename++, numPackages++)
;
tmpPackages = alloca(nb);
memset(tmpPackages, 0, nb);
nb = (numPackages + 1) * sizeof(Header);
- binaryHeaders = alloca(nb);
- memset(binaryHeaders, 0, nb);
myroot = rootdir;
if (myroot[0] == '/' && myroot[1] == '\0' && tmppath[0] == '/')
rpmMessage(RPMMESS_DEBUG, _("retrieved %d packages\n"), numTmpPackages);
- rpmMessage(RPMMESS_DEBUG, _("finding source and binary packages\n"));
- for (filename = packages, i = 0; *filename; filename++, i++) {
+ /* 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. */
+ rpmMessage(RPMMESS_DEBUG, _("opening database mode: 0%o\n"), mode);
+ if (rpmdbOpen(rootdir, &db, mode, 0644)) {
+ fprintf(stderr, _("error: cannot open %s%s/packages.rpm\n"),
+ rootdir, rpmGetVar(RPMVAR_DBPATH));
+ exit(EXIT_FAILURE);
+ }
+
+ rpmdep = rpmtransCreateSet(db, rootdir);
+
+ for (filename = packages; *filename; filename++) {
fd = fdOpen(*filename, O_RDONLY, 0);
if (fdFileno(fd) < 0) {
rpmMessage(RPMMESS_ERROR, _("cannot open file %s\n"), *filename);
continue;
}
- rc = rpmReadPackageHeader(fd, &binaryHeaders[numBinaryPackages],
- &isSource, NULL, NULL);
+ rc = rpmReadPackageHeader(fd, &h, &isSource, &major, NULL);
- fdClose(fd);
-
if (rc == 1) {
- rpmMessage(RPMMESS_ERROR,
- _("%s does not appear to be a RPM package\n"),
- *filename);
- }
-
- if (rc) {
- rpmMessage(RPMMESS_ERROR, _("%s cannot be installed\n"), *filename);
+ fdClose(fd);
+ fprintf(stderr,
+ _("error: %s does not appear to be a RPM package\n"),
+ *filename);
+ } else if (rc) {
+ fprintf(stderr, _("error: %s cannot be installed\n"), *filename);
numFailed++;
packages[i] = NULL;
- } else if (isSource) {
- /* the header will be NULL if this is a v1 source package */
- if (binaryHeaders[numBinaryPackages] != NULL)
- headerFree(binaryHeaders[numBinaryPackages]);
-
- numSourcePackages++;
+ } else if (isSource && major == 1) {
+ printf("XXX FIXME I can't install v1 source packages!!!\n");
} else {
- numBinaryPackages++;
+ rpmtransAddPackage(rpmdep, h, fd,
+ packages[i],
+ (interfaceFlags & INSTALL_UPGRADE) != 0,
+ relocations);
}
}
rpmMessage(RPMMESS_DEBUG, _("found %d source and %d binary packages\n"),
numSourcePackages, numBinaryPackages);
- if (numBinaryPackages) {
- rpmMessage(RPMMESS_DEBUG, _("opening database mode: 0%o\n"), mode);
- if (rpmdbOpen(rootdir, &db, mode, 0644)) {
- rpmMessage(RPMMESS_ERROR, _("cannot open %s%s/packages.rpm\n"),
- rootdir, rpmGetVar(RPMVAR_DBPATH));
- exit(EXIT_FAILURE);
+ if (!(interfaceFlags & INSTALL_NODEPS)) {
+ if (rpmdepCheck(rpmdep, &conflicts, &numConflicts)) {
+ numFailed = numPackages;
+ stopInstall = 1;
}
- rpmdep = rpmdepDependencies(db);
- for (i = 0; i < numBinaryPackages; i++)
- if (installFlags & RPMINSTALL_UPGRADE)
- rpmdepUpgradePackage(rpmdep, binaryHeaders[i],
- packages[i]);
- else
- rpmdepAddPackage(rpmdep, binaryHeaders[i],
- packages[i]);
-
- if (!(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 (!stopInstall && conflicts) {
+ rpmMessage(RPMMESS_ERROR, _("failed dependencies:\n"));
+ printDepProblems(stderr, conflicts, numConflicts);
+ rpmdepFreeConflicts(conflicts, numConflicts);
+ numFailed = numPackages;
+ stopInstall = 1;
}
+ }
- if (!(interfaceFlags & INSTALL_NOORDER)) {
- if (rpmdepOrder(rpmdep, (void ***) &packages)) {
- numFailed = numPackages;
- stopInstall = 1;
- }
+ if (!(interfaceFlags & INSTALL_NOORDER)) {
+ if (rpmdepOrder(rpmdep, (void ***) &packages)) {
+ numFailed = numPackages;
+ stopInstall = 1;
}
-
- rpmdepDone(rpmdep);
}
- else
- db = NULL;
if (!stopInstall) {
rpmMessage(RPMMESS_DEBUG, _("installing binary packages\n"));
- numFailed += installPackages(rootdir, packages, numPackages,
- installFlags, interfaceFlags, db,
- relocations);
+ rc = rpmRunTransactions(rpmdep, showProgress, (void *) notifyFlags,
+ NULL, &probs, transFlags);
+ if (rc < 0) {
+ numFailed += numPackages;
+ } else if (rc) {
+ rpmProblemSetFilter(probs, probFilter);
+
+ rc = rpmRunTransactions(rpmdep, showProgress, (void *) notifyFlags,
+ probs, &finalProbs, transFlags);
+ rpmProblemSetFree(probs);
+
+ if (rc < 0) {
+ numFailed += numPackages;
+ } else if (rc) {
+ numFailed += rc;
+ for (i = 0; i < finalProbs->numProblems; i++)
+ if (!finalProbs->probs[i].ignoreProblem)
+ fprintf(stderr, "error: %s\n",
+ rpmProblemString(finalProbs->probs[i]));
+
+ rpmProblemSetFree(finalProbs);
+ }
+ }
}
+ rpmtransFree(rpmdep);
+
for (i = 0; i < numTmpPackages; i++) {
unlink(tmpPackages[i]);
free(tmpPackages[i]);
}
- for (i = 0; i < numBinaryPackages; i++)
- headerFree(binaryHeaders[i]);
+ /* FIXME how do we close our various fd's? */
if (db != NULL) rpmdbClose(db);
int mode;
int rc;
int count;
- int numPackages, packageOffsetsAlloced;
- int * packageOffsets;
char ** arg;
int numFailed = 0;
- rpmDependencies rpmdep;
+ rpmTransactionSet rpmdep;
struct rpmDependencyConflict * conflicts;
int numConflicts;
int stopUninstall = 0;
+ int transFlags = 0;
+ int numPackages = 0;
+ rpmProblemSet probs;
- rpmMessage(RPMMESS_DEBUG, _("counting packages to uninstall\n"));
- for (arg = argv, numPackages = 0; *arg; arg++, numPackages++)
- ;
-
- packageOffsetsAlloced = numPackages;
- packageOffsets = malloc(sizeof(int *) * packageOffsetsAlloced);
+ if (uninstallFlags & RPMUNINSTALL_TEST)
+ transFlags |= RPMTRANS_FLAG_TEST;
if (uninstallFlags & RPMUNINSTALL_TEST)
mode = O_RDONLY;
}
j = 0;
- numPackages = 0;
+ rpmdep = rpmtransCreateSet(db, rootdir);
for (arg = argv; *arg; arg++) {
rc = rpmdbFindByLabel(db, *arg, &matches);
if (rc == 1) {
numFailed++;
}
else {
- numPackages += count;
- if (numPackages > packageOffsetsAlloced) {
- packageOffsetsAlloced = numPackages + 5;
- packageOffsets = realloc(packageOffsets,
- sizeof(int *) * packageOffsetsAlloced);
- }
for (i = 0; i < dbiIndexSetCount(matches); i++) {
unsigned int recOffset = dbiIndexRecordOffset(matches, i);
if (recOffset) {
- packageOffsets[j++] = recOffset;
+ rpmtransRemovePackage(rpmdep, recOffset);
+ numPackages++;
}
}
}
}
}
- rpmMessage(RPMMESS_DEBUG, _("found %d packages to uninstall\n"), numPackages);
-
if (!(interfaceFlags & UNINSTALL_NODEPS)) {
- rpmdep = rpmdepDependencies(db);
- for (i = 0; i < numPackages; i++)
- rpmdepRemovePackage(rpmdep, packageOffsets[i]);
-
if (rpmdepCheck(rpmdep, &conflicts, &numConflicts)) {
numFailed = numPackages;
stopUninstall = 1;
}
- rpmdepDone(rpmdep);
-
if (!stopUninstall && conflicts) {
rpmMessage(RPMMESS_ERROR, _("removing these packages would break "
"dependencies:\n"));
}
if (!stopUninstall) {
- for (i = 0; i < numPackages; i++) {
- rpmMessage(RPMMESS_DEBUG, _("uninstalling record number %d\n"),
- packageOffsets[i]);
- if (rpmRemovePackage(rootdir, db, packageOffsets[i],
- uninstallFlags))
- numFailed++;
- }
+ numFailed += rpmRunTransactions(rpmdep, NULL, NULL, NULL, &probs,
+ transFlags);
}
+ rpmtransFree(rpmdep);
rpmdbClose(db);
- free(packageOffsets);
-
return numFailed;
}
if (rpmIsVerbose())
fprintf(stdout, _("Installing %s\n"), arg);
- rc = rpmInstallSourcePackage(rootdir, fd, specFile, NULL, NULL, cookie);
+ rc = rpmInstallSourcePackage(rootdir, fd, specFile, NULL, NULL, NULL,
+ cookie);
if (rc == 1) {
rpmMessage(RPMMESS_ERROR, _("%s cannot be installed\n"), arg);
if (specFile) FREE(*specFile);
#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(char * rootdir, char ** argv, int installFlags,
- int interfaceFlags, struct rpmRelocation * relocations);
+ int interfaceFlags, int probFilter, rpmRelocation * relocations);
int doSourceInstall(char * prefix, char * arg, char ** specFile,
char ** cookie);
int doUninstall(char * rootdir, char ** argv, int uninstallFlags,
messages.c misc.c oldheader.c package.c query.c \
rebuilddb.c rpmdb.c rpmerr.c rpmio.c rpmlead.c \
rpmrc.c signature.c stringbuf.c tagtable.c \
- tread.c uninstall.c verify.c
+ tread.c uninstall.c verify.c transaction.c problems.c
include ../Makefile.inc
-# Makefile.in generated automatically by automake 1.3b from Makefile.am
+# Makefile.in generated automatically by automake 1.3 from Makefile.am
# Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
includedir = @includedir@
oldincludedir = /usr/include
-DESTDIR =
+DISTDIR =
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
messages.c misc.c oldheader.c package.c query.c \
rebuilddb.c rpmdb.c rpmerr.c rpmio.c rpmlead.c \
rpmrc.c signature.c stringbuf.c tagtable.c \
- tread.c uninstall.c verify.c
+ tread.c uninstall.c verify.c transaction.c problems.c
BUILT_SOURCES = tagtable.c
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
header.o install.o lookup.o macro.o md5.o md5sum.o messages.o misc.o \
oldheader.o package.o query.o rebuilddb.o rpmdb.o rpmerr.o rpmio.o \
rpmlead.o rpmrc.o signature.o stringbuf.o tagtable.o tread.o \
-uninstall.o verify.o
+uninstall.o verify.o transaction.o problems.o
CFLAGS = @CFLAGS@
-COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LINK = $(CC) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
+COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
+LINK = $(CC) $(CFLAGS) $(LDFLAGS) -o $@
HEADERS = $(noinst_HEADERS) $(rpminc_HEADERS)
DIST_COMMON = Makefile.am Makefile.in
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
-TAR = gtar
+TAR = tar
GZIP = --best
DEP_FILES = .deps/cpio.P .deps/dbindex.P .deps/depends.P .deps/falloc.P \
.deps/formats.P .deps/fs.P .deps/header.P .deps/install.P \
.deps/lookup.P .deps/macro.P .deps/md5.P .deps/md5sum.P \
.deps/messages.P .deps/misc.P .deps/oldheader.P .deps/package.P \
-.deps/query.P .deps/rebuilddb.P .deps/rpmdb.P .deps/rpmerr.P \
-.deps/rpmio.P .deps/rpmlead.P .deps/rpmrc.P .deps/signature.P \
-.deps/stringbuf.P .deps/tagtable .deps/tagtable.P .deps/tread.P \
-.deps/uninstall.P .deps/verify.P
+.deps/problems.P .deps/query.P .deps/rebuilddb.P .deps/rpmdb.P \
+.deps/rpmerr.P .deps/rpmio.P .deps/rpmlead.P .deps/rpmrc.P \
+.deps/signature.P .deps/stringbuf.P .deps/tagtable .deps/tagtable.P \
+.deps/transaction.P .deps/tread.P .deps/uninstall.P .deps/verify.P
SOURCES = $(librpm_a_SOURCES)
OBJECTS = $(librpm_a_OBJECTS)
install-libLIBRARIES: $(lib_LIBRARIES)
@$(NORMAL_INSTALL)
$(mkinstalldirs) $(DESTDIR)$(libdir)
- @list='$(lib_LIBRARIES)'; for p in $$list; do \
+ list='$(lib_LIBRARIES)'; for p in $$list; do \
if test -f $$p; then \
echo " $(INSTALL_DATA) $$p $(DESTDIR)$(libdir)/$$p"; \
$(INSTALL_DATA) $$p $(DESTDIR)$(libdir)/$$p; \
info:
dvi:
check: all
+ $(MAKE)
installcheck:
install-exec: install-libLIBRARIES
@$(NORMAL_INSTALL)
uninstall: uninstall-libLIBRARIES uninstall-rpmincHEADERS
install-strip:
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
+ $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
installdirs:
- $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(rpmincdir)
+ $(mkinstalldirs) $(DATADIR)$(libdir) $(DATADIR)$(rpmincdir)
mostlyclean-generic:
+ -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
clean-generic:
+ -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
- -rm -f Makefile $(CONFIG_CLEAN_FILES)
+ -rm -f Makefile $(DISTCLEANFILES)
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
+ -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
mostlyclean: mostlyclean-libLIBRARIES mostlyclean-compile \
mostlyclean-tags mostlyclean-depend mostlyclean-generic
#include "depends.h"
#include "misc.h"
-struct availablePackage {
- Header h;
- char ** provides;
- char ** files;
- char * name, * version, * release;
- int epoch, hasEpoch, providesCount, filesCount;
- void * key;
-} ;
-
-enum indexEntryType { IET_NAME, IET_PROVIDES, IET_FILE };
-
-struct availableIndexEntry {
- struct availablePackage * package;
- char * entry;
- enum indexEntryType type;
-} ;
-
-struct availableIndex {
- struct availableIndexEntry * index ;
- int size;
-} ;
-
-struct availableList {
- struct availablePackage * list;
- struct availableIndex index;
- int size, alloced;
-};
-
-struct rpmDependencyCheck {
- rpmdb db; /* may be NULL */
- int * removedPackages;
- int numRemovedPackages, allocedRemovedPackages;
- struct availableList addedPackages, availablePackages;
-};
-
-struct problemsSet {
- struct rpmDependencyConflict * problems;
- int num;
- int alloced;
-};
-
static void alMakeIndex(struct availableList * al);
static void alCreate(struct availableList * al);
static void alFreeIndex(struct availableList * al);
static void alFree(struct availableList * al);
-static void alAddPackage(struct availableList * al, Header h, void * key);
+static void alAddPackage(struct availableList * al, Header h, void * key,
+ FD_t fd, rpmRelocation * relocs);
static int intcmp(const void * a, const void *b);
static int indexcmp(const void * a, const void *b);
-static int unsatisfiedDepend(rpmDependencies rpmdep, char * reqName,
+static int unsatisfiedDepend(rpmTransactionSet rpmdep, char * reqName,
char * reqVersion, int reqFlags,
struct availablePackage ** suggestion);
-static int checkDependentPackages(rpmDependencies rpmdep,
+static int checkDependentPackages(rpmTransactionSet rpmdep,
struct problemsSet * psp, char * key);
-static int checkPackageDeps(rpmDependencies rpmdep, struct problemsSet * psp,
+static int checkPackageDeps(rpmTransactionSet rpmdep, struct problemsSet * psp,
Header h, const char * requirement);
-static int dbrecMatchesDepFlags(rpmDependencies rpmdep, int recOffset,
+static int dbrecMatchesDepFlags(rpmTransactionSet rpmdep, int recOffset,
char * reqVersion, int reqFlags);
struct availablePackage * alSatisfiesDepend(struct availableList * al,
char * reqName, char * reqVersion,
int reqFlags);
-static int checkDependentConflicts(rpmDependencies rpmdep,
+static int checkDependentConflicts(rpmTransactionSet rpmdep,
struct problemsSet * psp, char * package);
-static int checkPackageSet(rpmDependencies rpmdep, struct problemsSet * psp,
+static int checkPackageSet(rpmTransactionSet rpmdep, struct problemsSet * psp,
char * package, dbiIndexSet * matches);
-static int addOrderedPack(rpmDependencies rpmdep,
+static int addOrderedPack(rpmTransactionSet rpmdep,
struct availablePackage * package,
void ** ordering, int * orderNumPtr,
int * selected, int selectionClass,
free(al->list[i].provides);
if (al->list[i].files)
free(al->list[i].files);
+ free(al->list[i].h);
}
if (al->alloced) free(al->list);
alFreeIndex(al);
}
-static void alAddPackage(struct availableList * al, Header h, void * key) {
+static void alAddPackage(struct availableList * al, Header h, void * key,
+ FD_t fd, rpmRelocation * relocs) {
struct availablePackage * p;
if (al->size == al->alloced) {
}
p = al->list + al->size++;
- p->h = h;
+ p->h = headerLink(h);
headerGetEntry(p->h, RPMTAG_NAME, NULL, (void **) &p->name, NULL);
headerGetEntry(p->h, RPMTAG_VERSION, NULL, (void **) &p->version, NULL);
p->files = NULL;
}
+ /* We don't use these entries (and rpm >= 2 never have) and they are
+ pretty misleading. Let's just get rid of them so they don't confuse
+ anyone. */
+ if (headerIsEntry(h, RPMTAG_FILEUSERNAME))
+ headerRemoveEntry(h, RPMTAG_FILEUIDS);
+ if (headerIsEntry(h, RPMTAG_FILEGROUPNAME))
+ headerRemoveEntry(h, RPMTAG_FILEGIDS);
+
p->key = key;
+ p->relocs = relocs;
+ p->fd = fd;
alFreeIndex(al);
}
return 1;
}
-rpmDependencies rpmdepDependencies(rpmdb db) {
- rpmDependencies rpmdep;
+rpmTransactionSet rpmtransCreateSet(rpmdb db, char * root) {
+ rpmTransactionSet rpmdep;
rpmdep = malloc(sizeof(*rpmdep));
rpmdep->db = db;
rpmdep->allocedRemovedPackages = 5;
rpmdep->removedPackages = malloc(sizeof(int) *
rpmdep->allocedRemovedPackages);
+ rpmdep->root = strdup(root);
alCreate(&rpmdep->addedPackages);
alCreate(&rpmdep->availablePackages);
return rpmdep;
}
-void rpmdepUpgradePackage(rpmDependencies rpmdep, Header h, void * key) {
+void rpmtransAddPackage(rpmTransactionSet rpmdep, Header h, FD_t fd,
+ void * key, int upgrade, rpmRelocation * relocs) {
/* this is an install followed by uninstalls */
dbiIndexSet matches;
char * name;
int count, i, j;
char ** obsoletes;
- alAddPackage(&rpmdep->addedPackages, h, key);
+ /* FIXME: handling upgrades like this is *almost* okay. It doesn't
+ check to make sure we're upgrading to a newer version, and it
+ makes it difficult to generate a return code based on the number of
+ packages which failed. */
+
+ alAddPackage(&rpmdep->addedPackages, h, key, fd, relocs);
- if (rpmdep->db == NULL) return;
+ if (!upgrade || rpmdep->db == NULL) return;
headerGetEntry(h, RPMTAG_NAME, NULL, (void *) &name, &count);
if (!rpmdbFindPackage(rpmdep->db, name, &matches)) {
for (i = 0; i < dbiIndexSetCount(matches); i++) {
- rpmdepRemovePackage(rpmdep, dbiIndexRecordOffset(matches, i));
+ rpmtransRemovePackage(rpmdep, dbiIndexRecordOffset(matches, i));
}
dbiFreeIndexRecord(matches);
for (j = 0; j < count; j++) {
if (!rpmdbFindPackage(rpmdep->db, obsoletes[j], &matches)) {
for (i = 0; i < dbiIndexSetCount(matches); i++) {
- rpmdepRemovePackage(rpmdep, dbiIndexRecordOffset(matches, i));
+ rpmtransRemovePackage(rpmdep, dbiIndexRecordOffset(matches, i));
}
dbiFreeIndexRecord(matches);
}
}
-void rpmdepAddPackage(rpmDependencies rpmdep, Header h, void * key) {
- alAddPackage(&rpmdep->addedPackages, h, key);
-}
-
-void rpmdepAvailablePackage(rpmDependencies rpmdep, Header h, void * key) {
- alAddPackage(&rpmdep->availablePackages, h, key);
+void rpmtransAvailablePackage(rpmTransactionSet rpmdep, Header h, void * key) {
+ alAddPackage(&rpmdep->availablePackages, h, key, NULL, NULL);
}
-void rpmdepRemovePackage(rpmDependencies rpmdep, int dboffset) {
+void rpmtransRemovePackage(rpmTransactionSet rpmdep, int dboffset) {
if (rpmdep->numRemovedPackages == rpmdep->allocedRemovedPackages) {
rpmdep->allocedRemovedPackages += 5;
rpmdep->removedPackages = realloc(rpmdep->removedPackages,
rpmdep->removedPackages[rpmdep->numRemovedPackages++] = dboffset;
}
-void rpmdepDone(rpmDependencies rpmdep) {
+void rpmtransFree(rpmTransactionSet rpmdep) {
alFree(&rpmdep->addedPackages);
alFree(&rpmdep->availablePackages);
free(rpmdep->removedPackages);
+ free(rpmdep->root);
free(rpmdep);
}
free(conflicts);
}
-int rpmdepCheck(rpmDependencies rpmdep,
+int rpmdepCheck(rpmTransactionSet rpmdep,
struct rpmDependencyConflict ** conflicts, int * numConflicts) {
struct availablePackage * p;
int i, j;
/* 2 == error */
/* 1 == dependency not satisfied */
-static int unsatisfiedDepend(rpmDependencies rpmdep, char * reqName,
+static int unsatisfiedDepend(rpmTransactionSet rpmdep, char * reqName,
char * reqVersion, int reqFlags,
struct availablePackage ** suggestion) {
dbiIndexSet matches;
return 1;
}
-static int checkPackageSet(rpmDependencies rpmdep, struct problemsSet * psp,
+static int checkPackageSet(rpmTransactionSet rpmdep, struct problemsSet * psp,
char * package, dbiIndexSet * matches) {
int i;
Header h;
return 0;
}
-static int checkDependentPackages(rpmDependencies rpmdep,
+static int checkDependentPackages(rpmTransactionSet rpmdep,
struct problemsSet * psp, char * key) {
dbiIndexSet matches;
int rc;
return rc;
}
-static int checkDependentConflicts(rpmDependencies rpmdep,
+static int checkDependentConflicts(rpmTransactionSet rpmdep,
struct problemsSet * psp, char * package) {
dbiIndexSet matches;
int rc;
return rc;
}
-static int checkPackageDeps(rpmDependencies rpmdep, struct problemsSet * psp,
+static int checkPackageDeps(rpmTransactionSet rpmdep, struct problemsSet * psp,
Header h, const char * requirement) {
char ** requires, ** requiresVersion;
char * name, * version, * release;
psp->problems = realloc(psp->problems, sizeof(*psp->problems) *
psp->alloced);
}
- psp->problems[psp->num].byHeader = headerCopy(h);
+ psp->problems[psp->num].byHeader = headerLink(h);
psp->problems[psp->num].byName = strdup(name);
psp->problems[psp->num].byVersion = strdup(version);
psp->problems[psp->num].byRelease = strdup(release);
psp->problems = realloc(psp->problems, sizeof(*psp->problems) *
psp->alloced);
}
- psp->problems[psp->num].byHeader = headerCopy(h);
+ psp->problems[psp->num].byHeader = headerLink(h);
psp->problems[psp->num].byName = strdup(name);
psp->problems[psp->num].byVersion = strdup(version);
psp->problems[psp->num].byRelease = strdup(release);
return result;
}
-static int dbrecMatchesDepFlags(rpmDependencies rpmdep, int recOffset,
+static int dbrecMatchesDepFlags(rpmTransactionSet rpmdep, int recOffset,
char * reqVersion, int reqFlags) {
Header h;
int rc;
the current selection pass is included as a separate parameter, and is
incremented when satisfying a prerequisite */
-static int addOrderedPack(rpmDependencies rpmdep,
+static int addOrderedPack(rpmTransactionSet rpmdep,
struct availablePackage * package,
void ** ordering, int * orderNumPtr,
int * selected, int selectionClass,
return 0;
}
-int rpmdepOrder(rpmDependencies rpmdep, void *** keysListPtr) {
+int rpmdepOrder(rpmTransactionSet rpmdep, void *** keysListPtr) {
int i;
int * selected;
void ** order;
int headerMatchesDepFlags(Header h, char * reqInfo, int reqFlags);
+struct availablePackage {
+ Header h;
+ char ** provides;
+ char ** files;
+ char * name, * version, * release;
+ int epoch, hasEpoch, providesCount, filesCount;
+ void * key;
+ rpmRelocation * relocs;
+ FD_t fd;
+} ;
+
+enum indexEntryType { IET_NAME, IET_PROVIDES, IET_FILE };
+
+struct availableIndexEntry {
+ struct availablePackage * package;
+ char * entry;
+ enum indexEntryType type;
+} ;
+
+struct availableIndex {
+ struct availableIndexEntry * index ;
+ int size;
+} ;
+
+struct availableList {
+ struct availablePackage * list;
+ struct availableIndex index;
+ int size, alloced;
+};
+
+struct rpmTransactionSet_s {
+ rpmdb db; /* may be NULL */
+ int * removedPackages;
+ int numRemovedPackages, allocedRemovedPackages;
+ struct availableList addedPackages, availablePackages;
+ char * root;
+};
+
+struct problemsSet {
+ struct rpmDependencyConflict * problems;
+ int num;
+ int alloced;
+};
+
+
#endif /* H_DEPENDS */
int sorted;
int langNum;
+ int usageCount;
};
struct entryInfo {
h->sorted = 0;
h->langNum = -1;
+ h->usageCount = 1;
return (Header) h;
}
{
int i;
+ if (--h->usageCount) return;
for (i = 0; i < h->indexUsed; i++)
free(h->index[i].data);
free(h);
}
+Header headerLink(Header h)
+{
+ h->usageCount++;
+ return h;
+}
+
unsigned int headerSizeof(Header h, int magicp)
{
unsigned int size;
Header headerCopy(Header h);
void headerSort(Header h);
+Header headerLink(Header h);
void headerCopyTags(Header headerFrom, Header headerTo, int *tagstocopy);
unsigned long archiveSize;
rpmNotifyFunction notify;
char ** specFilePtr;
+ Header h;
+ void * notifyData;
};
struct fileMemory {
int instFlags, int brokenMd5);
static int installArchive(FD_t fd, struct fileInfo * files,
int fileCount, rpmNotifyFunction notify,
+ void * notifydb, Header h,
char ** specFile, int archiveSize);
-static int packageAlreadyInstalled(rpmdb db, char * name, char * version,
- char * release, int * recOffset, int flags);
static int instHandleSharedFiles(rpmdb db, int ignoreOffset,
struct fileInfo * files,
int fileCount, int * notErrors,
struct replacedFile ** repListPtr, int flags);
static int installSources(Header h, char * rootdir, FD_t fd,
char ** specFilePtr, rpmNotifyFunction notify,
- char * labelFormat);
+ void * notifyData, char * labelFormat);
static int markReplacedFiles(rpmdb db, struct replacedFile * replList);
-static int archOkay(Header h);
-static int osOkay(Header h);
static int ensureOlder(rpmdb db, Header new, int dbOffset);
static int assembleFileList(Header h, struct fileMemory * mem,
int * fileCountPtr, struct fileInfo ** filesPtr,
- int stripPrefixLength,
- struct rpmRelocation * rawRelocations,
- int allowRandomRelocations);
+ int stripPrefixLength);
static void setFileOwners(Header h, struct fileInfo * files, int fileCount);
static void freeFileMemory(struct fileMemory fileMem);
static void trimChangelog(Header h);
/* 1 bad magic */
/* 2 error */
int rpmInstallSourcePackage(char * rootdir, FD_t fd, char ** specFile,
- rpmNotifyFunction notify, char * labelFormat,
- char ** cookie) {
+ rpmNotifyFunction notify, void * notifyData,
+ char * labelFormat, char ** cookie) {
int rc, isSource;
Header h;
int major, minor;
}
}
- rc = installSources(h, rootdir, fd, specFile, notify, labelFormat);
+ rc = installSources(h, rootdir, fd, specFile, notify, notifyData,
+ labelFormat);
if (h != NULL) headerFree(h);
return rc;
/* files should not be preallocated */
static int assembleFileList(Header h, struct fileMemory * mem,
int * fileCountPtr, struct fileInfo ** filesPtr,
- int stripPrefixLength,
- struct rpmRelocation * rawRelocations,
- int allowRandomRelocations) {
+ int stripPrefixLength) {
uint_32 * fileFlags;
uint_32 * fileSizes;
uint_16 * fileModes;
struct fileInfo * files;
struct fileInfo * file;
int fileCount;
- int i, j, numRelocations = 0, madeSwap, len, newLen;
- struct rpmRelocation * relocations = NULL;
- struct rpmRelocation tmpReloc;
- struct rpmRelocation * nextReloc;
- char ** validRelocations = NULL, ** actualRelocations;
+ int i;
char ** fileLangs;
- char * newName, * chptr;
- int rc;
- int numValid;
+ char * chptr;
char ** languages, ** lang;
- if (rawRelocations) {
- if (!headerGetEntry(h, RPMTAG_PREFIXES, NULL,
- (void **) &validRelocations, &numValid)) {
- numValid = 0;
- }
-
- for (i = 0; rawRelocations[i].newPath; i++) ;
- numRelocations = i;
- relocations = alloca(sizeof(*relocations) * numRelocations);
-
-/* XXX this code assumes the validRelocations array won't
- have trailing /'s in it */
-
- for (i = 0; i < numRelocations; i++) {
- if (!rawRelocations[i].oldPath) {
- if (!numValid) {
- rpmError(RPMERR_NORELOCATE,
- _("package is not relocatable"));
- return 1;
- } else if (numValid != 1){
- rpmError(RPMERR_NORELOCATE,
- _("package has multiple relocatable components"));
- return 1;
- }
- relocations[i].oldPath =
- alloca(strlen(validRelocations[0]) + 1);
- strcpy(relocations[i].oldPath, validRelocations[0]);
- } else {
- relocations[i].oldPath =
- alloca(strlen(rawRelocations[i].oldPath) + 1);
- strcpy(relocations[i].oldPath, rawRelocations[i].oldPath);
- stripTrailingSlashes(relocations[i].oldPath);
- }
-
- relocations[i].newPath =
- alloca(strlen(rawRelocations[i].newPath) + 1);
- strcpy(relocations[i].newPath, rawRelocations[i].newPath);
- stripTrailingSlashes(relocations[i].newPath);
-
- if (!allowRandomRelocations) {
- for (j = 0; j < numValid; j++)
- if (!strcmp(validRelocations[j],
- relocations[i].oldPath)) break;
- if (j == numValid) {
- rpmError(RPMERR_BADRELOCATE, _("path %s is not relocatable"),
- relocations[i].oldPath);
- return 1;
- }
- }
- }
-
- /* stupid bubble sort, but it's probably faster here */
- for (i = 0; i < numRelocations; i++) {
- madeSwap = 0;
- for (j = 1; j < numRelocations; j++) {
- if (strcmp(relocations[j - 1].oldPath,
- relocations[j].oldPath) > 0) {
- tmpReloc = relocations[j - 1];
- relocations[j - 1] = relocations[j];
- relocations[j] = tmpReloc;
- madeSwap = 1;
- }
- }
- if (!madeSwap) break;
- }
-
- if (validRelocations) free(validRelocations);
- }
-
- if (headerGetEntry(h, RPMTAG_PREFIXES, NULL,
- (void **) &validRelocations, &numValid)) {
- actualRelocations = malloc(sizeof(*actualRelocations) * numValid);
-
- /* handle the special case of oldPath == NULL, which can only happen
- when numValid == 1 (which we've tested for when we build the
- relocation table above */
- for (i = 0; i < numValid; i++) {
- for (j = 0; j < numRelocations; j++) {
- if (!strcmp(validRelocations[i], relocations[j].oldPath)) {
- actualRelocations[i] = relocations[j].newPath;
- break;
- }
- }
-
- if (j == numRelocations)
- actualRelocations[i] = validRelocations[i];
- }
-
- headerAddEntry(h, RPMTAG_INSTPREFIXES, RPM_STRING_ARRAY_TYPE,
- (void **) actualRelocations, numValid);
-
- free(validRelocations);
- free(actualRelocations);
- }
+ if (!headerGetEntry(h, RPMTAG_ORIGFILENAMES, NULL, (void **) &mem->names,
+ fileCountPtr))
+ headerGetEntry(h, RPMTAG_FILENAMES, NULL, (void **) &mem->names,
+ fileCountPtr);
- headerGetEntry(h, RPMTAG_FILENAMES, NULL, (void **) &mem->names,
- fileCountPtr);
- /* get this before we start mucking with this info */
headerGetEntry(h, RPMTAG_FILENAMES, NULL, (void **) &mem->cpioNames,
fileCountPtr);
fileCount = *fileCountPtr;
- if (relocations) {
- /* go through things backwards so that /usr/local relocations take
- precedence over /usr ones */
- nextReloc = relocations + numRelocations - 1;
- len = strlen(nextReloc->oldPath);
- newLen = strlen(nextReloc->newPath);
- for (i = fileCount - 1; i >= 0 && nextReloc; i--) {
- do {
- rc = strncmp(nextReloc->oldPath, mem->names[i], len);
- if (rc > 0) {
- if (nextReloc == relocations) {
- nextReloc = 0;
- } else {
- nextReloc--;
- len = strlen(nextReloc->oldPath);
- newLen = strlen(nextReloc->newPath);
- }
- }
- } while (rc > 0 && nextReloc);
-
- if (!rc) {
- newName = alloca(newLen + strlen(mem->names[i]) + 1);
- strcpy(newName, nextReloc->newPath);
- strcat(newName, mem->names[i] + len);
- rpmMessage(RPMMESS_DEBUG, _("relocating %s to %s\n"),
- mem->names[i], newName);
- mem->names[i] = newName;
- }
- }
-
- headerModifyEntry(h, RPMTAG_FILENAMES, RPM_STRING_ARRAY_TYPE,
- mem->names, fileCount);
- /* make mem->names point to the new data in the header rather
- then the old (now modified) data */
- free(mem->names);
- headerGetEntry(h, RPMTAG_FILENAMES, NULL, (void **) &mem->names,
- fileCountPtr);
- }
-
files = *filesPtr = mem->files = malloc(sizeof(*mem->files) * fileCount);
headerGetEntry(h, RPMTAG_FILEMD5S, NULL, (void **) &mem->md5s, NULL);
/* 0 success */
/* 1 bad magic */
/* 2 error */
-int rpmInstallPackage(char * rootdir, rpmdb db, FD_t fd,
- struct rpmRelocation * relocations,
- int flags, rpmNotifyFunction notify, char * labelFormat)
-{
- int rc, isSource, major, minor;
+int installBinaryPackage(char * rootdir, rpmdb db, FD_t fd, Header h,
+ rpmRelocation * relocations,
+ int flags, rpmNotifyFunction notify,
+ void * notifyData) {
+ int rc;
char * name, * version, * release;
- Header h;
int fileCount, type, count;
struct fileInfo * files;
int_32 installTime;
char * fileStates;
int i, j;
- int remFlags;
int installFile = 0;
int otherOffset = 0;
char * ext = NULL, * newpath;
struct replacedFile * replacedList = NULL;
char * defaultPrefix;
dbiIndexSet matches;
- int * toRemove = NULL;
- int toRemoveAlloced = 1;
- int * intptr = NULL;
char * tmpPath;
int scriptArg;
int hasOthers = 0;
int freeFileMem = 0;
char * currDir = NULL, * tmpptr;
int currDirLen;
- char ** obsoletes;
if (flags & RPMINSTALL_JUSTDB)
flags |= RPMINSTALL_NOSCRIPTS;
- rc = rpmReadPackageHeader(fd, &h, &isSource, &major, &minor);
- if (rc) return rc;
-
- if (isSource) {
- if (flags & RPMINSTALL_TEST) {
- rpmMessage(RPMMESS_DEBUG,
- _("stopping install as we're running --test\n"));
- return 0;
- }
-
- if (major == 1) {
- notify = NULL;
- labelFormat = NULL;
- h = NULL;
- }
-
- if (flags & RPMINSTALL_JUSTDB) return 0;
-
- rc = installSources(h, rootdir, fd, NULL, notify, labelFormat);
- if (h != NULL) headerFree(h);
-
- return rc;
- }
-
headerGetEntry(h, RPMTAG_NAME, &type, (void **) &name, &fileCount);
headerGetEntry(h, RPMTAG_VERSION, &type, (void **) &version, &fileCount);
headerGetEntry(h, RPMTAG_RELEASE, &type, (void **) &release, &fileCount);
- /* We don't use these entries (and never have) and they are pretty
- misleading. Let's just get rid of them so they don't confuse
- anyone. */
- if (headerIsEntry(h, RPMTAG_FILEUSERNAME))
- headerRemoveEntry(h, RPMTAG_FILEUIDS);
- if (headerIsEntry(h, RPMTAG_FILEGROUPNAME))
- headerRemoveEntry(h, RPMTAG_FILEGIDS);
-
- if (!(flags & RPMINSTALL_NOARCH) && !archOkay(h)) {
- rpmError(RPMERR_BADARCH, _("package %s-%s-%s is for a different "
- "architecture"), name, version, release);
- headerFree(h);
- return 2;
- }
-
- if (!(flags & RPMINSTALL_NOOS) && !osOkay(h)) {
- rpmError(RPMERR_BADOS, _("package %s-%s-%s is for a different "
- "operating system"), name, version, release);
- headerFree(h);
- return 2;
- }
-
- if (packageAlreadyInstalled(db, name, version, release, &otherOffset,
- flags)) {
- headerFree(h);
- return 2;
- }
rpmMessage(RPMMESS_DEBUG, _("package: %s-%s-%s files test = %d\n"),
name, version, release, flags & RPMINSTALL_TEST);
scriptArg = dbiIndexSetCount(matches) + 1;
}
- if (flags & RPMINSTALL_UPGRADE) {
- /*
- We need to get a list of all old version of this package. We let
- this install procede normally then, but:
-
- 1) we don't report conflicts between the new package and
- the old versions installed
- 2) when we're done, we uninstall the old versions
-
- Note if the version being installed is already installed, we don't
- put that in the list -- that situation is handled normally.
-
- We also need to handle packages which were made oboslete.
- */
-
- if (hasOthers) {
- toRemoveAlloced = dbiIndexSetCount(matches) + 1;
- intptr = toRemove = malloc(toRemoveAlloced * sizeof(int));
- for (i = 0; i < dbiIndexSetCount(matches); i++) {
- unsigned int recOffset = dbiIndexRecordOffset(matches, i);
- if (recOffset != otherOffset) {
- if (!(flags & RPMINSTALL_UPGRADETOOLD))
- if (ensureOlder(db, h, recOffset)) {
- headerFree(h);
- dbiFreeIndexRecord(matches);
- return 2;
- }
- *intptr++ = recOffset;
- }
- }
-
- dbiFreeIndexRecord(matches);
- }
-
- if (!(flags & RPMINSTALL_KEEPOBSOLETE) &&
- headerGetEntry(h, RPMTAG_OBSOLETES, NULL, (void **) &obsoletes,
- &count)) {
- for (i = 0; i < count; i++) {
- rc = rpmdbFindPackage(db, obsoletes[i], &matches);
- if (rc == -1) return 2;
- if (rc == 1) continue; /* no matches */
-
- rpmMessage(RPMMESS_DEBUG, _("package %s is now obsolete and will"
- " be removed\n"), obsoletes[i]);
-
- toRemoveAlloced += dbiIndexSetCount(matches);
- j = toRemove ? intptr - toRemove : 0;
- toRemove = realloc(toRemove, toRemoveAlloced * sizeof(int));
- intptr = toRemove + j;
-
- for (j = 0; j < dbiIndexSetCount(matches); j++)
- *intptr++ = dbiIndexRecordOffset(matches, j);
-
- dbiFreeIndexRecord(matches);
- }
-
- free(obsoletes);
- }
-
- if (toRemove) {
- *intptr++ = 0;
-
- /* this means we don't have to free the list */
- intptr = alloca(toRemoveAlloced * sizeof(int));
- memcpy(intptr, toRemove, toRemoveAlloced * sizeof(int));
- free(toRemove);
- toRemove = intptr;
- }
- } else if (hasOthers) {
- dbiFreeIndexRecord(matches);
- }
-
if (rootdir) {
currDirLen = 50;
currDir = malloc(currDirLen);
defaultPrefix = NULL;
}
- if (assembleFileList(h, &fileMem, &fileCount, &files, stripSize,
- relocations, flags & RPMINSTALL_FORCERELOCATE)) {
+ if (assembleFileList(h, &fileMem, &fileCount, &files, stripSize)) {
if (rootdir) {
chroot(".");
chdir(currDir);
if (netsharedPaths) freeSplitString(netsharedPaths);
rc = instHandleSharedFiles(db, otherOffset, files, fileCount,
- toRemove, &replacedList, flags);
+ NULL, &replacedList, flags);
if (rc) {
if (rootdir) {
(void *) &archiveSizePtr, &count))
archiveSizePtr = NULL;
- if (labelFormat) {
- fprintf(stdout, labelFormat, name, version, release);
- fflush(stdout);
+ if (notify) {
+ notify(h, RPMNOTIFY_INST_START, 0, 0, notifyData);
}
/* the file pointer for fd is pointing at the cpio archive */
- if (installArchive(fd, files, fileCount, notify,
+ if (installArchive(fd, files, fileCount, notify, notifyData, h,
NULL, archiveSizePtr ? *archiveSizePtr : 0)) {
headerFree(h);
if (replacedList) free(replacedList);
}
}
- if (toRemove && flags & RPMINSTALL_UPGRADE) {
- rpmMessage(RPMMESS_DEBUG, _("removing old versions of package\n"));
- intptr = toRemove;
-
- if (flags & RPMINSTALL_NOSCRIPTS)
- remFlags = RPMUNINSTALL_NOSCRIPTS;
- else
- remFlags = 0;
-
- while (*intptr) {
- rpmRemovePackage(rootdir, db, *intptr, remFlags);
- intptr++;
- }
- }
-
headerFree(h);
return 0;
char * chptr;
if (ourInfo->notify)
- ourInfo->notify(cpioInfo->bytesProcessed, ourInfo->archiveSize);
+ ourInfo->notify(ourInfo->h, RPMNOTIFY_INST_PROGRESS,
+ cpioInfo->bytesProcessed,
+ ourInfo->archiveSize, ourInfo->notifyData);
if (ourInfo->specFilePtr) {
chptr = cpioInfo->file + strlen(cpioInfo->file) - 5;
/* NULL files means install all files */
static int installArchive(FD_t fd, struct fileInfo * files,
int fileCount, rpmNotifyFunction notify,
+ void * notifyData, Header h,
char ** specFile, int archiveSize) {
int rc, i;
struct cpioFileMapping * map = NULL;
info.archiveSize = archiveSize;
info.notify = notify;
+ info.notifyData = notifyData;
info.specFilePtr = specFile;
+ info.h = h;
if (specFile) *specFile = NULL;
}
if (notify)
- notify(0, archiveSize);
+ notify(h, RPMNOTIFY_INST_PROGRESS, 0, archiveSize, notifyData);
{ CFD_t cfdbuf, *cfd = &cfdbuf;
cfd->cpioIoType = cpioIoTypeGzFd;
}
if (notify && archiveSize)
- notify(archiveSize, archiveSize);
+ notify(h, RPMNOTIFY_INST_PROGRESS, archiveSize, archiveSize,
+ notifyData);
else if (notify) {
- notify(100, 100);
+ notify(h, RPMNOTIFY_INST_PROGRESS, 100, 100, notifyData);
}
return 0;
}
-static int packageAlreadyInstalled(rpmdb db, char * name, char * version,
- char * release, int * offset, int flags) {
- char * secVersion, * secRelease;
- Header sech;
- int i;
- dbiIndexSet matches;
- int type, count;
-
- if (!rpmdbFindPackage(db, name, &matches)) {
- for (i = 0; i < dbiIndexSetCount(matches); i++) {
- unsigned int recOffset = dbiIndexRecordOffset(matches, i);
- sech = rpmdbGetRecord(db, recOffset);
- if (sech == NULL) {
- return 1;
- }
-
- headerGetEntry(sech, RPMTAG_VERSION, &type, (void **) &secVersion,
- &count);
- headerGetEntry(sech, RPMTAG_RELEASE, &type, (void **) &secRelease,
- &count);
-
- if (!strcmp(secVersion, version) && !strcmp(secRelease, release)) {
- *offset = recOffset;
- if (!(flags & RPMINSTALL_REPLACEPKG)) {
- rpmError(RPMERR_PKGINSTALLED,
- _("package %s-%s-%s is already installed"),
- name, version, release);
- headerFree(sech);
- return 1;
- }
- }
-
- headerFree(sech);
- }
-
- dbiFreeIndexRecord(matches);
- }
-
- return 0;
-}
static int filecmp(short mode1, char * md51, char * link1,
short mode2, char * md52, char * link2) {
/* 2 error */
static int installSources(Header h, char * rootdir, FD_t fd,
char ** specFilePtr, rpmNotifyFunction notify,
+ void * notifyData,
char * labelFormat) {
char * specFile;
char * sourceDir, * specDir;
if (h && headerIsEntry(h, RPMTAG_FILENAMES)) {
/* we can't remap v1 packages */
- assembleFileList(h, &fileMem, &fileCount, &files, 0, NULL, 0);
+ assembleFileList(h, &fileMem, &fileCount, &files, 0);
for (i = 0; i < fileCount; i++) {
files[i].relativePath = files[i].relativePath;
chdir(realSourceDir);
if (installArchive(fd, fileCount > 0 ? files : NULL,
- fileCount, notify,
+ fileCount, notify, notifyData, h,
specFileIndex >=0 ? NULL : &specFile,
archiveSizePtr ? *archiveSizePtr : 0)) {
if (fileCount > 0) freeFileMemory(fileMem);
return result;
}
-static int archOkay(Header h) {
- int_8 * pkgArchNum;
- void * pkgArch;
- int type, count, archNum;
-
- /* make sure we're trying to install this on the proper architecture */
- headerGetEntry(h, RPMTAG_ARCH, &type, (void **) &pkgArch, &count);
- if (type == RPM_INT8_TYPE) {
- /* old arch handling */
- rpmGetArchInfo(NULL, &archNum);
- pkgArchNum = pkgArch;
- if (archNum != *pkgArchNum) {
- return 0;
- }
- } else {
- /* new arch handling */
- if (!rpmMachineScore(RPM_MACHTABLE_INSTARCH, pkgArch)) {
- return 0;
- }
- }
-
- return 1;
-}
-
-static int osOkay(Header h) {
- void * pkgOs;
- int type, count;
-
- /* make sure we're trying to install this on the proper os */
- headerGetEntry(h, RPMTAG_OS, &type, (void **) &pkgOs, &count);
- if (type == RPM_INT8_TYPE) {
- /* v1 packages and v2 packages both used improper OS numbers, so just
- deal with it hope things work */
- return 1;
- } else {
- /* new os handling */
- if (!rpmMachineScore(RPM_MACHTABLE_INSTOS, pkgOs)) {
- return 0;
- }
- }
-
- return 1;
-}
database to calculate arguments to the trigger */
int runImmedTriggers(char * root, rpmdb db, int sense, Header h,
int countCorrection);
+int installBinaryPackage(char * rootdir, rpmdb db, FD_t fd, Header h,
+ rpmRelocation * relocations,
+ int flags, rpmNotifyFunction notify,
+ void * notifyData);
#endif /* H_INSTALL */
#include "rpmlib.h"
-static int findMatches(rpmdb db, char * name, char * version, char * release,
- dbiIndexSet * matches);
-
/* 0 found matches */
/* 1 no matches */
/* 2 error */
/* 0 found matches */
/* 1 no matches */
/* 2 error */
-static int findMatches(rpmdb db, char * name, char * version, char * release,
+int findMatches(rpmdb db, char * name, char * version, char * release,
dbiIndexSet * matches) {
int gotMatches;
int rc;
int rpmfileexists(char * filespec);
int rpmvercmp(char * one, char * two);
+int findMatches(rpmdb db, char * name, char * version, char * release,
+ dbiIndexSet * matches);
/* these are like the normal functions, but they malloc() the space which
is needed */
int isSource;
char * defaultPrefix;
struct stat sb;
+ int_32 true = 1;
hdr = hdrPtr ? hdrPtr : &hdrBlock;
lead = leadPtr ? leadPtr : &leadBlock;
headerAddEntry(*hdr, RPMTAG_PREFIXES, RPM_STRING_ARRAY_TYPE,
&defaultPrefix, 1);
}
+
+ if (lead->type == RPMLEAD_SOURCE) {
+ if (!headerIsEntry(*hdr, RPMTAG_SOURCEPACKAGE))
+ headerAddEntry(*hdr, RPMTAG_SOURCEPACKAGE, RPM_INT32_TYPE,
+ &true, 1);
+ }
} else {
rpmError(RPMERR_NEWPACKAGE, _("only packages with major numbers <= 3 "
"are supported by this version of RPM"));
}
i++;
- } while ((i == 0) || (allMatches.recs[i].recOffset ==
- allMatches.recs[i - 1].recOffset));
+ } while ((i < allMatches.count) &&
+ ((i == 0) || (allMatches.recs[i].recOffset ==
+ allMatches.recs[i - 1].recOffset)));
free(fileList);
char ** fileList, ** providesList, ** requiredbyList;
char ** conflictList, ** triggerList;
int i;
+ char * basename;
/* structure assignment */
rec = dbiReturnIndexRecordInstance(offset, 0);
if (headerGetEntry(h, RPMTAG_FILENAMES, &type, (void **) &fileList,
&count)) {
for (i = 0; i < count; i++) {
- rpmMessage(RPMMESS_DEBUG, _("removing file index for %s\n"), fileList[i]);
+ basename = strrchr(fileList[i], '/');
+ if (!basename)
+ basename = fileList[i];
+ else
+ basename++;
+
+ rpmMessage(RPMMESS_DEBUG, _("removing file index for %s\n"),
+ basename);
/* structure assignment */
rec = dbiReturnIndexRecordInstance(offset, i);
- removeIndexEntry(db->fileIndex, fileList[i], rec, tolerant,
+ removeIndexEntry(db->fileIndex, basename, rec, tolerant,
"file index");
}
free(fileList);
#define RPMTAG_AUTOREQ 1103 /* internal */
#define RPMTAG_AUTOPROV 1104 /* internal */
#define RPMTAG_CAPABILITY 1105
+#define RPMTAG_SOURCEPACKAGE 1106 /* internal */
+#define RPMTAG_ORIGFILENAMES 1107
#define RPMTAG_EXTERNAL_TAG 1000000
#define RPMFILE_LICENSE (1 << 7)
#define RPMFILE_README (1 << 8)
-#define RPMINSTALL_REPLACEPKG (1 << 0)
#define RPMINSTALL_REPLACEFILES (1 << 1)
#define RPMINSTALL_TEST (1 << 2)
-#define RPMINSTALL_UPGRADE (1 << 3)
#define RPMINSTALL_UPGRADETOOLD (1 << 4)
#define RPMINSTALL_NODOCS (1 << 5)
#define RPMINSTALL_NOSCRIPTS (1 << 6)
-#define RPMINSTALL_NOARCH (1 << 7)
-#define RPMINSTALL_NOOS (1 << 8)
#define RPMINSTALL_ALLFILES (1 << 9)
#define RPMINSTALL_JUSTDB (1 << 10)
#define RPMINSTALL_KEEPOBSOLETE (1 << 11)
-#define RPMINSTALL_FORCERELOCATE (1 << 12)
#define RPMINSTALL_NOTRIGGERS (1 << 13)
#define RPMUNINSTALL_TEST (1 << 0)
typedef /*@abstract@*/ struct rpmdb_s * rpmdb;
-typedef void (*rpmNotifyFunction)(const unsigned long amount,
- const unsigned long total);
+typedef enum rpmNotifyType_e
+ { RPMNOTIFY_INST_PROGRESS, RPMNOTIFY_INST_START } rpmNotifyType;
+typedef void (*rpmNotifyFunction)(const Header h, const rpmNotifyType what,
+ const unsigned long amount,
+ const unsigned long total,
+ void * data);
int rpmdbOpen (char * root, rpmdb * dbp, int mode, int perms);
/* 0 on error */
int rpmdbFindByHeader(rpmdb db, Header h, dbiIndexSet * matches);
/* we pass these around as an array with a sentinel */
-struct rpmRelocation {
+typedef struct rpmRelocation_s {
char * oldPath; /* NULL here evals to RPMTAG_DEFAULTPREFIX, this */
char * newPath; /* odd behavior is only for backwards compatibility */
-};
+} rpmRelocation;
int rpmInstallSourcePackage(char * root, FD_t fd, char ** specFile,
- rpmNotifyFunction notify, char * labelFormat,
- char ** cookie);
-int rpmInstallPackage(char * rootdir, rpmdb db, FD_t fd,
- struct rpmRelocation * relocations,
- int flags, rpmNotifyFunction notify, char * labelFormat);
+ rpmNotifyFunction notify, void * notifyData,
+ char * labelFormat, char ** cookie);
int rpmVersionCompare(Header first, Header second);
-int rpmRemovePackage(char * root, rpmdb db, unsigned int offset, int flags);
+int removeBinaryPackage(char * root, rpmdb db, unsigned int offset, int flags);
int rpmdbRebuild(char * root);
int rpmVerifyFile(char * root, Header h, int filenum, int * result,
int omitMask);
int rpmVerifyScript(char * root, Header h, FD_t err);
-typedef struct rpmDependencyCheck * rpmDependencies;
+/* Transaction sets are inherently unordered! RPM may reorder transaction
+ sets to reduce errors. In general, installs/upgrades are done before
+ strict removals, and prerequisite ordering is done on installs/upgrades. */
+typedef struct rpmTransactionSet_s * rpmTransactionSet;
struct rpmDependencyConflict {
char * byName, * byVersion, * byRelease;
enum { RPMDEP_SENSE_REQUIRES, RPMDEP_SENSE_CONFLICTS } sense;
} ;
-/*@only@*/ rpmDependencies rpmdepDependencies(rpmdb db); /* db may be NULL */
-void rpmdepAddPackage(rpmDependencies rpmdep, Header h, void * key);
-void rpmdepAvailablePackage(rpmDependencies rpmdep, Header h, void * key);
-void rpmdepUpgradePackage(rpmDependencies rpmdep, Header h, void * key);
-void rpmdepRemovePackage(rpmDependencies rpmdep, int dboffset);
+/* db may be NULL, but don't do things which require the database! */
+/*@only@*/ rpmTransactionSet rpmtransCreateSet(rpmdb db, char * rootdir);
+
+/* if fd is NULL, the callback specified in rpmtransCreateSet() is used to
+ open and close the file descriptor. If Header is NULL, the fd is always
+ used, otherwise fd is only needed (and only opened) for actual package
+ installation */
+void rpmtransAddPackage(rpmTransactionSet rpmdep, Header h, FD_t fd,
+ void * key, int update, rpmRelocation * relocs);
+void rpmtransAvailablePackage(rpmTransactionSet rpmdep, Header h, void * key);
+void rpmtransRemovePackage(rpmTransactionSet rpmdep, int dboffset);
+void rpmtransFree(/*@only@*/ rpmTransactionSet rpmdep);
/* this checks for dependency satisfaction, but *not* ordering */
-int rpmdepCheck(rpmDependencies rpmdep,
+int rpmdepCheck(rpmTransactionSet rpmdep,
struct rpmDependencyConflict ** conflicts, int * numConflicts);
/* Orders items, returns error on circle, finals keys[] is NULL. No dependency
check is done, use rpmdepCheck() for that. If dependencies are not
satisfied a "best-try" ordering is returned. */
-int rpmdepOrder(rpmDependencies order, void *** keysListPtr);
-
-void rpmdepDone(/*@only@*/ rpmDependencies rpmdep);
+int rpmdepOrder(rpmTransactionSet order, void *** keysListPtr);
void rpmdepFreeConflicts(struct rpmDependencyConflict * conflicts, int
numConflicts);
+#define RPMTRANS_FLAG_TEST (1 << 0)
+
+typedef enum rpmProblemType_e { RPMPROB_BADARCH,
+ RPMPROB_BADOS,
+ RPMPROB_PKG_INSTALLED,
+ RPMPROB_BADRELOCATE,
+ } rpmProblemType;
+
+typedef struct rpmProblem_s {
+ Header h;
+ void * key;
+ rpmProblemType type;
+ int ignoreProblem;
+ char * str1;
+} rpmProblem;
+
+typedef struct rpmProblemSet_s {
+ int numProblems;
+ int numProblemsAlloced;
+ rpmProblem * probs;
+} * rpmProblemSet;
+
+char * rpmProblemString(rpmProblem prob);
+void rpmProblemSetFree(rpmProblemSet probs);
+void rpmProblemSetFilter(rpmProblemSet ps, int flags);
+int rpmRunTransactions(rpmTransactionSet ts, rpmNotifyFunction notify,
+ void * notifyData, rpmProblemSet okProbs,
+ rpmProblemSet * newProbs, int flags);
+
+#define RPMPROB_FILTER_IGNOREOS (1 << 0)
+#define RPMPROB_FILTER_IGNOREARCH (1 << 1)
+#define RPMPROB_FILTER_REPLACEPKG (1 << 2)
+#define RPMPROB_FILTER_FORCERELOCATE (1 << 3)
+
/** messages.c **/
#define RPMMESS_DEBUG 1
#define RPMERR_NOTSRPM -26 /* a source rpm was expected */
#define RPMERR_FLOCK -27 /* locking the database failed */
#define RPMERR_OLDPACKAGE -28 /* trying upgrading to old version */
-#define RPMERR_BADARCH -29 /* bad architecture or arch mismatch */
+/*#define RPMERR_BADARCH -29 bad architecture or arch mismatch */
#define RPMERR_CREATE -30 /* failed to create a file */
#define RPMERR_NOSPACE -31 /* out of disk space */
#define RPMERR_NORELOCATE -32 /* tried to do improper relocatation */
-#define RPMERR_BADOS -33 /* bad architecture or arch mismatch */
+/*#define RPMERR_BADOS -33 bad architecture or arch mismatch */
#define RPMMESS_BACKUP -34 /* backup made during [un]install */
#define RPMERR_MTAB -35 /* failed to read mount table */
#define RPMERR_STAT -36 /* failed to stat something */
#define RPMMESS_ALTNAME -38 /* file written as .rpmnew */
#define RPMMESS_PREREQLOOP -39 /* loop in prerequisites */
#define RPMERR_BADRELOCATE -40 /* bad relocation was specified */
+#define RPMERR_OLDDB -41 /* old format database */
/* spec.c build.c pack.c */
#define RPMERR_UNMATCHEDIF -107 /* unclosed %ifarch or %ifos */
return rc;
}
-int rpmRemovePackage(char * prefix, rpmdb db, unsigned int offset, int flags) {
+int removeBinaryPackage(char * prefix, rpmdb db, unsigned int offset,
+ int flags) {
Header h;
int i, j;
int fileCount;
-# Makefile.in generated automatically by automake 1.3b from Makefile.am
+# Makefile.in generated automatically by automake 1.3 from Makefile.am
# Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
includedir = @includedir@
oldincludedir = /usr/include
-DESTDIR =
+DISTDIR =
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
LDFLAGS = @LDFLAGS@
libmisc_a_OBJECTS =
CFLAGS = @CFLAGS@
-COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LINK = $(CC) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
+COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
+LINK = $(CC) $(CFLAGS) $(LDFLAGS) -o $@
HEADERS = $(noinst_HEADERS)
DIST_COMMON = Makefile.am Makefile.in alloca.c error.c error.h \
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
-TAR = gtar
+TAR = tar
GZIP = --best
DEP_FILES = .deps/alloca.P .deps/error.P .deps/fnmatch.P .deps/getcwd.P \
.deps/getmntent.P .deps/getwd.P .deps/glob.P .deps/inet_aton.P \
info:
dvi:
check: all
+ $(MAKE)
installcheck:
install-exec:
@$(NORMAL_INSTALL)
uninstall:
install-strip:
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
+ $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
installdirs:
mostlyclean-generic:
+ -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
clean-generic:
+ -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
- -rm -f Makefile $(CONFIG_CLEAN_FILES)
+ -rm -f Makefile $(DISTCLEANFILES)
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
+ -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
+ -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
mostlyclean: mostlyclean-noinstLIBRARIES mostlyclean-compile \
mostlyclean-tags mostlyclean-depend mostlyclean-generic
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
-"POT-Creation-Date: 1998-12-14 16:12-0500\n"
+"POT-Creation-Date: 1998-12-16 08:56-0800\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 "Unknown or unexpected error"
msgstr ""
-#: ../install.c:67 ../install.c:207
-#, c-format
-msgid "cannot open file %s\n"
-msgstr ""
-
-#: ../install.c:84 ../install.c:433
-#, c-format
-msgid "Installing %s\n"
-msgstr ""
-
-#: ../install.c:91
-msgid "stopping source install as we're just testing\n"
-msgstr ""
-
-#: ../install.c:102 ../install.c:220 ../lib/query.c:479
-#, c-format
-msgid "%s does not appear to be a RPM package\n"
-msgstr ""
-
-#: ../install.c:107 ../install.c:225 ../install.c:437
-#, c-format
-msgid "%s cannot be installed\n"
-msgstr ""
-
-#: ../install.c:144
+#: ../install.c:100
msgid "counting packages to install\n"
msgstr ""
-#: ../install.c:148
+#: ../install.c:104
#, c-format
msgid "found %d packages\n"
msgstr ""
-#: ../install.c:163
+#: ../install.c:117
msgid "looking for packages to download\n"
msgstr ""
-#: ../install.c:173
+#: ../install.c:127
#, c-format
msgid "Retrieving %s\n"
msgstr ""
-#: ../install.c:182
+#: ../install.c:136
#, c-format
msgid " ... as %s\n"
msgstr ""
-#: ../install.c:186
+#: ../install.c:140
#, c-format
msgid "skipping %s - transfer failed - %s\n"
msgstr ""
-#: ../install.c:201
+#: ../install.c:155
#, c-format
msgid "retrieved %d packages\n"
msgstr ""
-#: ../install.c:203
-msgid "finding source and binary packages\n"
+#. 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.
+#: ../install.c:160
+#, c-format
+msgid "opening database mode: 0%o\n"
msgstr ""
-#: ../install.c:239
+#: ../install.c:162
#, c-format
-msgid "found %d source and %d binary packages\n"
+msgid "error: cannot open %s%s/packages.rpm\n"
msgstr ""
-#: ../install.c:243
+#: ../install.c:172
#, c-format
-msgid "opening database mode: 0%o\n"
+msgid "cannot open file %s\n"
msgstr ""
-#: ../install.c:245 ../install.c:336
+#: ../install.c:183
#, c-format
-msgid "cannot open %s%s/packages.rpm\n"
+msgid "error: %s does not appear to be a RPM package\n"
+msgstr ""
+
+#: ../install.c:186
+#, c-format
+msgid "error: %s cannot be installed\n"
msgstr ""
-#: ../install.c:266
+#: ../install.c:199
+#, c-format
+msgid "found %d source and %d binary packages\n"
+msgstr ""
+
+#: ../install.c:209
msgid "failed dependencies:\n"
msgstr ""
-#: ../install.c:287
+#: ../install.c:225
msgid "installing binary packages\n"
msgstr ""
-#: ../install.c:323
-msgid "counting packages to uninstall\n"
+#: ../install.c:292
+#, c-format
+msgid "cannot open %s%s/packages.rpm\n"
msgstr ""
-#: ../install.c:346 ../lib/query.c:636 ../verify.c:266
+#: ../install.c:302 ../lib/query.c:615 ../verify.c:243
#, c-format
msgid "package %s is not installed\n"
msgstr ""
-#: ../install.c:349
+#: ../install.c:305
#, c-format
msgid "searching for package %s\n"
msgstr ""
-#: ../install.c:357
+#: ../install.c:313
#, c-format
msgid "\"%s\" specifies multiple packages\n"
msgstr ""
-#: ../install.c:380
-#, c-format
-msgid "found %d packages to uninstall\n"
+#: ../install.c:338
+msgid "removing these packages would break dependencies:\n"
msgstr ""
-#: ../install.c:395
-msgid "removing these packages would break dependencies:\n"
+#: ../install.c:365
+#, c-format
+msgid "cannot open %s\n"
msgstr ""
-#: ../install.c:406
+#: ../install.c:370
#, c-format
-msgid "uninstalling record number %d\n"
+msgid "Installing %s\n"
msgstr ""
-#: ../install.c:428
+#: ../install.c:375
#, c-format
-msgid "cannot open %s\n"
+msgid "%s cannot be installed\n"
msgstr ""
-#: ../install.c:476
+#: ../install.c:414
#, c-format
msgid " is needed by %s-%s-%s\n"
msgstr ""
-#: ../install.c:479
+#: ../install.c:417
#, c-format
msgid " conflicts with %s-%s-%s\n"
msgstr ""
msgid "rebuild database from existing database"
msgstr ""
-#: ../rpm.c:591 ../rpm.c:597 ../rpm.c:604 ../rpm.c:610 ../rpm.c:619
-#: ../rpm.c:626 ../rpm.c:673 ../rpm.c:679 ../rpm.c:743 ../rpm.c:751
-#: ../rpm.c:758 ../rpm.c:767 ../rpm.c:774 ../rpm.c:782 ../rpm.c:809
-#: ../rpm.c:851 ../rpm.c:858
+#: ../rpm.c:593 ../rpm.c:599 ../rpm.c:606 ../rpm.c:612 ../rpm.c:621
+#: ../rpm.c:628 ../rpm.c:675 ../rpm.c:681 ../rpm.c:745 ../rpm.c:753
+#: ../rpm.c:760 ../rpm.c:769 ../rpm.c:776 ../rpm.c:784 ../rpm.c:811
+#: ../rpm.c:853 ../rpm.c:860
msgid "only one major mode may be specified"
msgstr ""
-#: ../rpm.c:612
+#: ../rpm.c:614
msgid "-u and --uninstall are deprecated and no longer work.\n"
msgstr ""
-#: ../rpm.c:614
+#: ../rpm.c:616
msgid "Use -e or --erase instead.\n"
msgstr ""
-#: ../rpm.c:630
+#: ../rpm.c:632
msgid "--build (-b) requires one of a,b,i,c,p,l as its sole argument"
msgstr ""
-#: ../rpm.c:634
+#: ../rpm.c:636
msgid "--tarbuild (-t) requires one of a,b,i,c,p,l as its sole argument"
msgstr ""
-#: ../rpm.c:686 ../rpm.c:693 ../rpm.c:701 ../rpm.c:709 ../rpm.c:719
-#: ../rpm.c:727 ../rpm.c:735 ../rpm.c:865
+#: ../rpm.c:688 ../rpm.c:695 ../rpm.c:703 ../rpm.c:711 ../rpm.c:721
+#: ../rpm.c:729 ../rpm.c:737 ../rpm.c:867
msgid "one type of query/verify may be performed at a time"
msgstr ""
-#: ../rpm.c:790
+#: ../rpm.c:792
msgid "arguments to --dbpath must begin with a /"
msgstr ""
-#: ../rpm.c:815
+#: ../rpm.c:817
msgid "relocations must begin with a /"
msgstr ""
-#: ../rpm.c:817
+#: ../rpm.c:819
msgid "relocations must contain a ="
msgstr ""
-#: ../rpm.c:820
+#: ../rpm.c:822
msgid "relocations must have a / following the ="
msgstr ""
-#: ../rpm.c:828
+#: ../rpm.c:830
#, c-format
msgid "Internal error in argument processing (%d) :-(\n"
msgstr ""
-#: ../rpm.c:878
+#: ../rpm.c:880
msgid "--dbpath given for operation that does not use a database"
msgstr ""
-#: ../rpm.c:883
+#: ../rpm.c:885
msgid "--timecheck may only be used during package builds"
msgstr ""
-#: ../rpm.c:886 ../rpm.c:889
+#: ../rpm.c:888 ../rpm.c:891
msgid "unexpected query specifiers"
msgstr ""
-#: ../rpm.c:893
+#: ../rpm.c:895
msgid "unexpected query source"
msgstr ""
-#: ../rpm.c:898
+#: ../rpm.c:900
msgid "only installation, upgrading and rmsource may be forced"
msgstr ""
-#: ../rpm.c:901
+#: ../rpm.c:903
msgid "files may only be relocated during package installation"
msgstr ""
-#: ../rpm.c:904
+#: ../rpm.c:906
msgid "only one of --prefix or --relocate may be used"
msgstr ""
-#: ../rpm.c:907
+#: ../rpm.c:909
msgid "--relocate may only be used when installing new packages"
msgstr ""
-#: ../rpm.c:910
+#: ../rpm.c:912
msgid "--prefix may only be used when installing new packages"
msgstr ""
-#: ../rpm.c:913
+#: ../rpm.c:915
msgid "arguments to --prefix must begin with a /"
msgstr ""
-#: ../rpm.c:916
+#: ../rpm.c:918
msgid "--hash (-h) may only be specified during package installation"
msgstr ""
-#: ../rpm.c:920
+#: ../rpm.c:922
msgid "--percent may only be specified during package installation"
msgstr ""
-#: ../rpm.c:924
+#: ../rpm.c:926
msgid "--replacefiles may only be specified during package installation"
msgstr ""
-#: ../rpm.c:928
+#: ../rpm.c:930
msgid "--replacepkgs may only be specified during package installation"
msgstr ""
-#: ../rpm.c:932
+#: ../rpm.c:934
msgid "--excludedocs may only be specified during package installation"
msgstr ""
-#: ../rpm.c:936
+#: ../rpm.c:938
msgid "--includedocs may only be specified during package installation"
msgstr ""
-#: ../rpm.c:940
+#: ../rpm.c:942
msgid "only one of --excludedocs and --includedocs may be specified"
msgstr ""
-#: ../rpm.c:944
+#: ../rpm.c:946
msgid "--ignorearch may only be specified during package installation"
msgstr ""
-#: ../rpm.c:948
+#: ../rpm.c:950
msgid "--ignoreos may only be specified during package installation"
msgstr ""
-#: ../rpm.c:952
+#: ../rpm.c:954
msgid "--allmatches may only be specified during package erasure"
msgstr ""
-#: ../rpm.c:956
+#: ../rpm.c:958
msgid "--allfiles may only be specified during package installation"
msgstr ""
-#: ../rpm.c:960
+#: ../rpm.c:962
msgid "--justdb may only be specified during package installation and erasure"
msgstr ""
-#: ../rpm.c:965
+#: ../rpm.c:967
msgid ""
"--noscripts may only be specified during package installation, erasure, and "
"verification"
msgstr ""
-#: ../rpm.c:969
+#: ../rpm.c:971
msgid ""
"--notriggers may only be specified during package installation, erasure, and "
"verification"
msgstr ""
-#: ../rpm.c:974
+#: ../rpm.c:976
msgid ""
"--nodeps may only be specified during package installation, erasure, and "
"verification"
msgstr ""
-#: ../rpm.c:978
+#: ../rpm.c:980
msgid "--nofiles may only be specified during package verification"
msgstr ""
-#: ../rpm.c:983
+#: ../rpm.c:985
msgid ""
"--test may only be specified during package installation, erasure, and "
"building"
msgstr ""
-#: ../rpm.c:988
+#: ../rpm.c:990
msgid ""
"--root (-r) may only be specified during installation, erasure, querying, "
"and database rebuilds"
msgstr ""
-#: ../rpm.c:993
+#: ../rpm.c:995
msgid "arguments to --root (-r) must begin with a /"
msgstr ""
-#: ../rpm.c:997
+#: ../rpm.c:999
msgid "--clean may only be used with -b and -t"
msgstr ""
-#: ../rpm.c:1000
+#: ../rpm.c:1002
msgid "--rmsource may only be used with -b and -t"
msgstr ""
-#: ../rpm.c:1003
+#: ../rpm.c:1005
msgid "--short-circuit may only be used during package building"
msgstr ""
-#: ../rpm.c:1007
+#: ../rpm.c:1009
msgid "--short-circuit may only be used with -bc, -bi, -bs, -tc -ti, or -ts"
msgstr ""
-#: ../rpm.c:1013
+#: ../rpm.c:1015
msgid "--oldpackage may only be used during upgrades"
msgstr ""
-#: ../rpm.c:1018
+#: ../rpm.c:1020
msgid ""
"ftp options can only be used during package queries, installs, and upgrades"
msgstr ""
-#: ../rpm.c:1025
+#: ../rpm.c:1027
msgid "--nopgp may only be used during signature checking"
msgstr ""
-#: ../rpm.c:1028
+#: ../rpm.c:1030
msgid ""
"--nopgp may only be used during signature checking and package verification"
msgstr ""
-#: ../rpm.c:1047
+#: ../rpm.c:1049
msgid "Pass phrase check failed\n"
msgstr ""
-#: ../rpm.c:1050
+#: ../rpm.c:1052
msgid "Pass phrase is good.\n"
msgstr ""
-#: ../rpm.c:1062
+#: ../rpm.c:1064
msgid "--sign may only be used during package building"
msgstr ""
-#: ../rpm.c:1078
+#: ../rpm.c:1080
msgid "exec failed\n"
msgstr ""
-#: ../rpm.c:1097
+#: ../rpm.c:1099
msgid "unexpected arguments to --querytags "
msgstr ""
-#: ../rpm.c:1108
+#: ../rpm.c:1110
msgid "no packages given for signature check"
msgstr ""
-#: ../rpm.c:1115
+#: ../rpm.c:1117
msgid "no packages given for signing"
msgstr ""
-#: ../rpm.c:1124
+#: ../rpm.c:1126
msgid "no packages files given for rebuild"
msgstr ""
-#: ../rpm.c:1181
+#: ../rpm.c:1183
msgid "no spec files given for build"
msgstr ""
-#: ../rpm.c:1183
+#: ../rpm.c:1185
msgid "no tar files given for build"
msgstr ""
-#: ../rpm.c:1196
+#: ../rpm.c:1198
msgid "no packages given for uninstall"
msgstr ""
-#: ../rpm.c:1236
+#: ../rpm.c:1241
msgid "no packages given for install"
msgstr ""
-#: ../rpm.c:1258
+#: ../rpm.c:1263
msgid "extra arguments given for query of all packages"
msgstr ""
-#: ../rpm.c:1264
+#: ../rpm.c:1269
msgid "no arguments given for query"
msgstr ""
-#: ../rpm.c:1282
+#: ../rpm.c:1287
msgid "no arguments given for verify"
msgstr ""
msgid "error: ftpport must be a number\n"
msgstr ""
-#: ../lib/rpmdb.c:124 ../url.c:333
+#: ../lib/rpmdb.c:125 ../url.c:333
#, c-format
msgid "failed to open %s\n"
msgstr ""
msgid "error: could not read database record\n"
msgstr ""
-#: ../lib/query.c:525 ../verify.c:181
+#: ../lib/query.c:525 ../verify.c:180
msgid "could not read database record!\n"
msgstr ""
-#: ../lib/query.c:458 ../verify.c:199
+#: ../lib/query.c:458 ../verify.c:198
#, c-format
msgid "open of %s failed\n"
msgstr ""
-#: ../verify.c:215
+#: ../verify.c:214
#, c-format
msgid "%s is not an RPM\n"
msgstr ""
-#: ../lib/query.c:536 ../verify.c:223
+#: ../lib/query.c:536 ../verify.c:222
#, c-format
msgid "group %s does not contain any packages\n"
msgstr ""
-#: ../lib/query.c:584 ../lib/query.c:590 ../verify.c:241 ../verify.c:247
-msgid "maximum path length exceeded\n"
-msgstr ""
-
-#: ../lib/query.c:605 ../verify.c:255
+#: ../lib/query.c:584 ../verify.c:232
#, c-format
msgid "file %s is not owned by any package\n"
msgstr ""
-#: ../lib/query.c:639 ../verify.c:268
+#: ../lib/query.c:618 ../verify.c:245
#, c-format
msgid "error looking for package %s\n"
msgstr ""
msgid "cannot open file %s: "
msgstr ""
-#: ../lib/dbindex.c:41
+#: ../lib/dbindex.c:57
#, c-format
msgid "error getting record %s from %s"
msgstr ""
-#: ../lib/dbindex.c:69
+#: ../lib/dbindex.c:85
#, c-format
msgid "error storing record %s into %s"
msgstr ""
-#: ../lib/dbindex.c:76
+#: ../lib/dbindex.c:92
#, c-format
msgid "error removing record %s into %s"
msgstr ""
-#: ../lib/depends.c:373 ../lib/depends.c:532
+#: ../lib/depends.c:349 ../lib/depends.c:508
#, c-format
msgid "cannot read header at %d for dependency check"
msgstr ""
-#: ../lib/depends.c:438
+#: ../lib/depends.c:414
#, c-format
msgid "dependencies: looking for %s\n"
msgstr ""
-#: ../lib/depends.c:625
+#: ../lib/depends.c:601
#, c-format
msgid "package %s require not satisfied: %s\n"
msgstr ""
-#: ../lib/depends.c:668
+#: ../lib/depends.c:644
#, c-format
msgid "package %s conflicts: %s\n"
msgstr ""
-#: ../lib/depends.c:767
+#: ../lib/depends.c:743
msgid "dbrecMatchesDepFlags() failed to read header"
msgstr ""
-#: ../lib/depends.c:819
+#: ../lib/depends.c:795
#, c-format
msgid "loop in prerequisite chain: %s"
msgstr ""
msgstr ""
#: ../lib/formats.c:97 ../lib/formats.c:114 ../lib/formats.c:134
-#: ../lib/formats.c:166 ../lib/header.c:1946 ../lib/header.c:1962
-#: ../lib/header.c:1982
+#: ../lib/formats.c:166 ../lib/header.c:1955 ../lib/header.c:1971
+#: ../lib/header.c:1991
msgid "(not a number)"
msgstr ""
msgid "file %s is on an unknown device"
msgstr ""
-#: ../lib/header.c:666
+#: ../lib/header.c:667
#, c-format
msgid "Data type %d not supprted\n"
msgstr ""
#. This should not be allowed
-#: ../lib/header.c:879
+#: ../lib/header.c:888
msgid "grabData() RPM_STRING_TYPE count must be 1.\n"
msgstr ""
-#: ../lib/header.c:909
+#: ../lib/header.c:918
#, c-format
msgid "Data type %d not supported\n"
msgstr ""
-#: ../lib/header.c:968
+#: ../lib/header.c:977
#, c-format
msgid "Bad count for headerAddEntry(): %d\n"
msgstr ""
-#: ../lib/header.c:1302
+#: ../lib/header.c:1311
msgid "? expected in expression"
msgstr ""
-#: ../lib/header.c:1309
+#: ../lib/header.c:1318
msgid "{ expected after ? in expression"
msgstr ""
-#: ../lib/header.c:1319 ../lib/header.c:1351
+#: ../lib/header.c:1328 ../lib/header.c:1360
msgid "} expected in expression"
msgstr ""
-#: ../lib/header.c:1326
+#: ../lib/header.c:1335
msgid ": expected following ? subexpression"
msgstr ""
-#: ../lib/header.c:1339
+#: ../lib/header.c:1348
msgid "{ expected after : in expression"
msgstr ""
-#: ../lib/header.c:1358
+#: ../lib/header.c:1367
msgid "| expected at end of expression"
msgstr ""
-#: ../lib/header.c:1452
+#: ../lib/header.c:1461
#, c-format
msgid "missing { after %"
msgstr ""
-#: ../lib/header.c:1480
+#: ../lib/header.c:1489
msgid "missing } after %{"
msgstr ""
-#: ../lib/header.c:1492
+#: ../lib/header.c:1501
msgid "empty tag format"
msgstr ""
-#: ../lib/header.c:1502
+#: ../lib/header.c:1511
msgid "empty tag name"
msgstr ""
-#: ../lib/header.c:1517
+#: ../lib/header.c:1526
msgid "unknown tag"
msgstr ""
-#: ../lib/header.c:1543
+#: ../lib/header.c:1552
msgid "] expected at end of array"
msgstr ""
-#: ../lib/header.c:1559
+#: ../lib/header.c:1568
msgid "unexpected ]"
msgstr ""
-#: ../lib/header.c:1561
+#: ../lib/header.c:1570
msgid "unexpected }"
msgstr ""
-#: ../lib/header.c:1736
+#: ../lib/header.c:1745
msgid "(unknown type)"
msgstr ""
-#: ../lib/install.c:95
+#: ../lib/install.c:92
msgid "source package expected, binary found"
msgstr ""
-#: ../lib/install.c:167
-msgid "package is not relocatable"
-msgstr ""
-
-#: ../lib/install.c:171
-msgid "package has multiple relocatable components"
-msgstr ""
-
-#: ../lib/install.c:194
-#, c-format
-msgid "path %s is not relocatable"
-msgstr ""
-
-#: ../lib/install.c:276
-#, c-format
-msgid "relocating %s to %s\n"
-msgstr ""
-
-#: ../lib/install.c:324
+#: ../lib/install.c:182
#, c-format
msgid "not installing %s -- linguas\n"
msgstr ""
-#: ../lib/install.c:346
+#: ../lib/install.c:204
#, c-format
msgid "user %s does not exist - using root"
msgstr ""
-#: ../lib/install.c:354
+#: ../lib/install.c:212
#, c-format
msgid "group %s does not exist - using root"
msgstr ""
-#: ../lib/install.c:378
+#: ../lib/install.c:236
msgid "instchangelog value in rpmrc should be a number, but isn't"
msgstr ""
-#: ../lib/install.c:455 ../lib/install.c:736
-msgid "stopping install as we're running --test\n"
-msgstr ""
-
-#: ../lib/install.c:486
-#, c-format
-msgid "package %s-%s-%s is for a different architecture"
-msgstr ""
-
-#: ../lib/install.c:493
-#, c-format
-msgid "package %s-%s-%s is for a different operating system"
-msgstr ""
-
-#: ../lib/install.c:505
+#: ../lib/install.c:306
#, c-format
msgid "package: %s-%s-%s files test = %d\n"
msgstr ""
-#. no matches
-#: ../lib/install.c:570
-#, c-format
-msgid "package %s is now obsolete and will be removed\n"
-msgstr ""
-
-#: ../lib/install.c:681
+#: ../lib/install.c:409
#, c-format
msgid "file %s in netshared path\n"
msgstr ""
-#: ../lib/install.c:698
+#: ../lib/install.c:426
#, c-format
msgid "%s exists - creating with alternate name\n"
msgstr ""
-#: ../lib/install.c:703
+#: ../lib/install.c:431
#, c-format
msgid "%s exists - backing up\n"
msgstr ""
-#: ../lib/install.c:742
+#: ../lib/install.c:464
+msgid "stopping install as we're running --test\n"
+msgstr ""
+
+#: ../lib/install.c:470
msgid "running preinstall script (if any)\n"
msgstr ""
-#: ../lib/install.c:773
+#: ../lib/install.c:501
#, c-format
msgid "warning: %s created as %s"
msgstr ""
-#: ../lib/install.c:807
+#: ../lib/install.c:535
#, c-format
msgid "warning: %s saved as %s"
msgstr ""
-#: ../lib/install.c:811 ../lib/install.c:1522 ../lib/uninstall.c:598
+#: ../lib/install.c:539 ../lib/install.c:1201 ../lib/uninstall.c:599
#, c-format
msgid "rename of %s to %s failed: %s"
msgstr ""
-#: ../lib/install.c:912
+#: ../lib/install.c:639
msgid "running postinstall script (if any)\n"
msgstr ""
-#: ../lib/install.c:933
-msgid "removing old versions of package\n"
-msgstr ""
-
#. this would probably be a good place to check if disk space
#. was used up - if so, we should return a different error
-#: ../lib/install.c:1024
+#: ../lib/install.c:741
#, c-format
msgid "unpacking of archive failed on file %s: %s"
msgstr ""
-#: ../lib/install.c:1063
-#, c-format
-msgid "package %s-%s-%s is already installed"
-msgstr ""
-
-#: ../lib/install.c:1111
+#: ../lib/install.c:789
#, c-format
msgid "%s skipped due to missingok flag\n"
msgstr ""
-#: ../lib/install.c:1129
+#: ../lib/install.c:807
msgid "\tfile type on disk is different then package - saving\n"
msgstr ""
-#: ../lib/install.c:1132
+#: ../lib/install.c:810
msgid ""
"\tfile type in database is different then disk and package file - saving\n"
msgstr ""
-#: ../lib/install.c:1136
+#: ../lib/install.c:814
msgid "\tfile type changed - replacing\n"
msgstr ""
-#: ../lib/install.c:1140
+#: ../lib/install.c:818
msgid "\tcan't check file for changes - replacing\n"
msgstr ""
#. assume the file has been removed, don't freak
-#: ../lib/install.c:1152 ../lib/install.c:1162
+#: ../lib/install.c:830 ../lib/install.c:840
msgid "\tfile not present - creating"
msgstr ""
#. this config file has never been modified, so
#. just replace it
-#: ../lib/install.c:1175
+#: ../lib/install.c:853
msgid "\told == current, replacing with new version\n"
msgstr ""
#. this file is the same in all versions of this package
-#: ../lib/install.c:1182
+#: ../lib/install.c:860
msgid "\told == new, keeping\n"
msgstr ""
#. the ones in the two packages are different. It would
#. be nice if RPM was smart enough to at least try and
#. merge the difference ala CVS, but...
-#: ../lib/install.c:1190
+#: ../lib/install.c:868
msgid "\tfiles changed too much - backing up\n"
msgstr ""
-#: ../lib/install.c:1252 ../lib/rpmdb.c:318 ../lib/uninstall.c:118
-#: ../lib/uninstall.c:218
+#: ../lib/install.c:930 ../lib/rpmdb.c:407 ../lib/uninstall.c:118
+#: ../lib/uninstall.c:219
#, c-format
msgid "cannot read header at %d for uninstall"
msgstr ""
-#: ../lib/install.c:1265 ../lib/uninstall.c:131
+#: ../lib/install.c:943 ../lib/uninstall.c:131
#, c-format
msgid "package %s-%s-%s contain shared files\n"
msgstr ""
-#: ../lib/install.c:1270 ../lib/uninstall.c:136
+#: ../lib/install.c:948 ../lib/uninstall.c:136
#, c-format
msgid "package %s contains no files"
msgstr ""
-#: ../lib/install.c:1292 ../lib/uninstall.c:159
+#: ../lib/install.c:970 ../lib/uninstall.c:159
#, c-format
msgid "file %s is shared\n"
msgstr ""
-#: ../lib/install.c:1308
+#: ../lib/install.c:986
msgid "\told version already replaced\n"
msgstr ""
-#: ../lib/install.c:1311
+#: ../lib/install.c:989
msgid "\tother version never installed\n"
msgstr ""
-#: ../lib/install.c:1319
+#: ../lib/install.c:997
#, c-format
msgid "%s conflicts with file from %s-%s-%s"
msgstr ""
-#: ../lib/install.c:1338
+#: ../lib/install.c:1016
#, c-format
msgid "%s from %s-%s-%s will be replaced\n"
msgstr ""
-#: ../lib/install.c:1402
+#: ../lib/install.c:1081
msgid "installing a source package\n"
msgstr ""
-#: ../lib/install.c:1418 ../lib/install.c:1423
+#: ../lib/install.c:1097 ../lib/install.c:1102
#, c-format
msgid "cannot write to %s"
msgstr ""
-#: ../lib/install.c:1427
+#: ../lib/install.c:1106
#, c-format
msgid "sources in: %s\n"
msgstr ""
-#: ../lib/install.c:1428
+#: ../lib/install.c:1107
#, c-format
msgid "spec file in: %s\n"
msgstr ""
-#: ../lib/install.c:1461 ../lib/install.c:1500
+#: ../lib/install.c:1140 ../lib/install.c:1179
msgid "source package contains no .spec file"
msgstr ""
-#: ../lib/install.c:1520
+#: ../lib/install.c:1199
#, c-format
msgid "renaming %s to %s\n"
msgstr ""
-#: ../lib/install.c:1636
+#: ../lib/install.c:1315
#, c-format
msgid "package %s-%s-%s (which is newer) is already installed"
msgstr ""
-#: ../lib/lookup.c:84
+#: ../lib/lookup.c:81
#, c-format
msgid "cannot read header at %d for lookup"
msgstr ""
msgid "bad file state: "
msgstr ""
-#: ../lib/package.c:50
+#: ../lib/package.c:51
msgid "package is a version one package!\n"
msgstr ""
-#: ../lib/package.c:53
+#: ../lib/package.c:54
msgid "old style source package -- I'll do my best\n"
msgstr ""
-#: ../lib/package.c:56
+#: ../lib/package.c:57
#, c-format
msgid "archive offset is %d\n"
msgstr ""
-#: ../lib/package.c:66
+#: ../lib/package.c:67
msgid "old style binary package\n"
msgstr ""
-#: ../lib/package.c:97
+#: ../lib/package.c:104
msgid ""
"only packages with major numbers <= 3 are supported by this version of RPM"
msgstr ""
msgid "old format source packages cannot be queried\n"
msgstr ""
+#: ../lib/query.c:479
+#, c-format
+msgid "%s does not appear to be a RPM package\n"
+msgstr ""
+
#: ../lib/query.c:482
#, c-format
msgid "query of %s failed\n"
msgid "no package requires %s\n"
msgstr ""
-#: ../lib/query.c:602
+#: ../lib/query.c:581
#, c-format
msgid "file %s: %s\n"
msgstr ""
-#: ../lib/query.c:618
+#: ../lib/query.c:597
#, c-format
msgid "invalid package number: %s\n"
msgstr ""
-#: ../lib/query.c:621
+#: ../lib/query.c:600
#, c-format
msgid "showing package: %d\n"
msgstr ""
-#: ../lib/query.c:624
+#: ../lib/query.c:603
#, c-format
msgid "record %d could not be read\n"
msgstr ""
msgid "failed to remove directory %s: %s\n"
msgstr ""
-#: ../lib/rpmdb.c:115
+#: ../lib/rpmdb.c:116
#, c-format
msgid "opening database in %s\n"
msgstr ""
-#: ../lib/rpmdb.c:137 ../lib/rpmdb.c:144
+#: ../lib/rpmdb.c:138 ../lib/rpmdb.c:145
#, c-format
msgid "cannot get %s lock on database"
msgstr ""
-#: ../lib/rpmdb.c:138
+#: ../lib/rpmdb.c:139
msgid "exclusive"
msgstr ""
-#: ../lib/rpmdb.c:145
+#: ../lib/rpmdb.c:146
msgid "shared"
msgstr ""
-#: ../lib/rpmdb.c:284
+#: ../lib/rpmdb.c:168
+msgid ""
+"old format database is present; use --rebuilddb to generate a new format "
+"database"
+msgstr ""
+
+#: ../lib/rpmdb.c:372
#, c-format
msgid "package %s not listed in %s"
msgstr ""
-#: ../lib/rpmdb.c:295
+#: ../lib/rpmdb.c:383
#, c-format
msgid "package %s not found in %s"
msgstr ""
-#: ../lib/rpmdb.c:326
+#: ../lib/rpmdb.c:415
msgid "package has no name"
msgstr ""
-#: ../lib/rpmdb.c:328
+#: ../lib/rpmdb.c:417
msgid "removing name index\n"
msgstr ""
-#: ../lib/rpmdb.c:333
+#: ../lib/rpmdb.c:422
msgid "package has no group\n"
msgstr ""
-#: ../lib/rpmdb.c:335
+#: ../lib/rpmdb.c:424
msgid "removing group index\n"
msgstr ""
-#: ../lib/rpmdb.c:342
+#: ../lib/rpmdb.c:431
#, c-format
msgid "removing provides index for %s\n"
msgstr ""
-#: ../lib/rpmdb.c:357
+#: ../lib/rpmdb.c:446
#, c-format
msgid "removing requiredby index for %s\n"
msgstr ""
-#: ../lib/rpmdb.c:369
+#: ../lib/rpmdb.c:458
#, c-format
msgid "removing trigger index for %s\n"
msgstr ""
-#: ../lib/rpmdb.c:380
+#: ../lib/rpmdb.c:469
#, c-format
msgid "removing conflict index for %s\n"
msgstr ""
-#: ../lib/rpmdb.c:391
+#: ../lib/rpmdb.c:486
#, c-format
msgid "removing file index for %s\n"
msgstr ""
-#: ../lib/rpmdb.c:399
+#: ../lib/rpmdb.c:495
msgid "package has no files\n"
msgstr ""
-#: ../lib/rpmdb.c:471
+#: ../lib/rpmdb.c:568
msgid "cannot allocate space for database"
msgstr ""
-#: ../lib/rpmdb.c:535
+#: ../lib/rpmdb.c:639
#, c-format
msgid "cannot read header at %d for update"
msgstr ""
-#: ../lib/rpmdb.c:544
+#: ../lib/rpmdb.c:648
msgid "header changed size!"
msgstr ""
#. This shouldn't happen, but some versions of RPM didn't
#. implement --justdb properly, and chose to leave this stuff
#. out.
-#: ../lib/uninstall.c:149 ../lib/uninstall.c:279
+#: ../lib/uninstall.c:149 ../lib/uninstall.c:280
msgid "package is missing FILESTATES\n"
msgstr ""
msgid " file is truely shared - saving\n"
msgstr ""
-#: ../lib/uninstall.c:229
+#: ../lib/uninstall.c:230
#, c-format
msgid "cannot read packages named %s for uninstall"
msgstr ""
-#: ../lib/uninstall.c:257
+#: ../lib/uninstall.c:258
#, c-format
msgid "will remove files test = %d\n"
msgstr ""
-#: ../lib/uninstall.c:305
+#: ../lib/uninstall.c:306
#, c-format
msgid "%s has a netshared override\n"
msgstr ""
-#: ../lib/uninstall.c:343
+#: ../lib/uninstall.c:344
msgid "running postuninstall script (if any)\n"
msgstr ""
-#: ../lib/uninstall.c:357
+#: ../lib/uninstall.c:358
msgid "removing database entry\n"
msgstr ""
-#: ../lib/uninstall.c:512
+#: ../lib/uninstall.c:513
msgid "execution of script failed"
msgstr ""
-#: ../lib/uninstall.c:557
+#: ../lib/uninstall.c:558
#, c-format
msgid "%s has already been replaced\n"
msgstr ""
#. if it's a config file, we may not want to remove it
-#: ../lib/uninstall.c:564
+#: ../lib/uninstall.c:565
#, c-format
msgid "finding md5sum of %s\n"
msgstr ""
-#: ../lib/uninstall.c:573
+#: ../lib/uninstall.c:574
msgid " failed - assuming file removed\n"
msgstr ""
-#: ../lib/uninstall.c:576
+#: ../lib/uninstall.c:577
msgid " file changed - will save\n"
msgstr ""
-#: ../lib/uninstall.c:580
+#: ../lib/uninstall.c:581
msgid " file unchanged - will remove\n"
msgstr ""
-#: ../lib/uninstall.c:588
+#: ../lib/uninstall.c:589
#, c-format
msgid "keeping %s\n"
msgstr ""
-#: ../lib/uninstall.c:592
+#: ../lib/uninstall.c:593
#, c-format
msgid "saving %s as %s.rpmsave\n"
msgstr ""
-#: ../lib/uninstall.c:606
+#: ../lib/uninstall.c:607
#, c-format
msgid "%s - removing\n"
msgstr ""
-#: ../lib/uninstall.c:612
+#: ../lib/uninstall.c:613
#, c-format
msgid "cannot remove %s - directory not empty"
msgstr ""
-#: ../lib/uninstall.c:615
+#: ../lib/uninstall.c:616
#, c-format
msgid "rmdir of %s failed: %s"
msgstr ""
-#: ../lib/uninstall.c:625
+#: ../lib/uninstall.c:626
#, c-format
msgid "removal of %s failed: %s"
msgstr ""
int ec = 0;
int status;
int p[2];
- struct rpmRelocation * relocations = NULL;
+ rpmRelocation * relocations = NULL;
int numRelocations = 0;
+ int upgrade = 0;
+ int probFilter = 0;
/* set the defaults for the various command line options */
allFiles = 0;
if (bigMode != MODE_UNKNOWN && bigMode != MODE_INSTALL)
argerror(_("only one major mode may be specified"));
bigMode = MODE_INSTALL;
- installFlags |= RPMINSTALL_UPGRADE;
+ upgrade = 1;
break;
case 'p':
}
#endif
- if (oldPackage && !(installFlags & RPMINSTALL_UPGRADE))
+ if (oldPackage && upgrade)
argerror(_("--oldpackage may only be used during upgrades"));
if ((ftpProxy || ftpPort) && !(bigMode == MODE_INSTALL ||
argerror(_("ftp options can only be used during package queries, "
"installs, and upgrades"));
- if (oldPackage || (force && (installFlags & RPMINSTALL_UPGRADE)))
+ if (oldPackage || (force && upgrade))
installFlags |= RPMINSTALL_UPGRADETOOLD;
if (noPgp && bigMode != MODE_CHECKSIG)
break;
case MODE_INSTALL:
- if (force)
- installFlags |= (RPMINSTALL_REPLACEPKG | RPMINSTALL_REPLACEFILES);
+ if (force) {
+ probFilter |= RPMPROB_FILTER_REPLACEPKG;
+ installFlags |= RPMINSTALL_REPLACEFILES;
+ }
if (replaceFiles) installFlags |= RPMINSTALL_REPLACEFILES;
- if (badReloc) installFlags |= RPMINSTALL_FORCERELOCATE;
- if (replacePackages) installFlags |= RPMINSTALL_REPLACEPKG;
+ if (badReloc) probFilter |= RPMPROB_FILTER_FORCERELOCATE;
+ if (replacePackages) probFilter |= RPMPROB_FILTER_REPLACEPKG;
if (test) installFlags |= RPMINSTALL_TEST;
if (noScripts) installFlags |= RPMINSTALL_NOSCRIPTS;
if (noTriggers) installFlags |= RPMINSTALL_NOTRIGGERS;
- if (ignoreArch) installFlags |= RPMINSTALL_NOARCH;
- if (ignoreOs) installFlags |= RPMINSTALL_NOOS;
+ if (ignoreArch) probFilter |= RPMPROB_FILTER_IGNOREARCH;
+ if (ignoreOs) probFilter |= RPMPROB_FILTER_IGNOREOS;
if (allFiles) installFlags |= RPMINSTALL_ALLFILES;
if (justdb) installFlags |= RPMINSTALL_JUSTDB;
if (showHash) interfaceFlags |= INSTALL_HASH;
if (noDeps) interfaceFlags |= INSTALL_NODEPS;
if (noOrder) interfaceFlags |= INSTALL_NOORDER;
+ if (noOrder) interfaceFlags |= INSTALL_NOORDER;
if (!incldocs) {
if (excldocs)
}
ec += doInstall(rootdir, poptGetArgs(optCon), installFlags,
- interfaceFlags, relocations);
+ interfaceFlags, probFilter, relocations);
break;
case MODE_QUERY:
-# Makefile.in generated automatically by automake 1.3b from Makefile.am
+# Makefile.in generated automatically by automake 1.3 from Makefile.am
# Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
includedir = @includedir@
oldincludedir = /usr/include
-DESTDIR =
+DISTDIR =
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
-TAR = gtar
+TAR = tar
GZIP = --best
all: Makefile $(SCRIPTS)
info:
dvi:
check: all
+ $(MAKE)
installcheck:
install-exec:
@$(NORMAL_INSTALL)
uninstall: uninstall-configSCRIPTS
install-strip:
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
+ $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
installdirs:
- $(mkinstalldirs) $(DESTDIR)$(configdir)
+ $(mkinstalldirs) $(DATADIR)$(configdir)
mostlyclean-generic:
+ -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
clean-generic:
+ -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
- -rm -f Makefile $(CONFIG_CLEAN_FILES)
+ -rm -f Makefile $(DISTCLEANFILES)
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
+ -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
+ -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
mostlyclean: mostlyclean-generic
clean: clean-generic mostlyclean
-# Makefile.in generated automatically by automake 1.3b from Makefile.am
+# Makefile.in generated automatically by automake 1.3 from Makefile.am
# Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
includedir = @includedir@
oldincludedir = /usr/include
-DESTDIR =
+DISTDIR =
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
-TAR = gtar
+TAR = tar
GZIP = --best
all: all-recursive all-am
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
rpmrc: $(top_builddir)/config.status rpmrc.in
- cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
+ cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status
macros: $(top_builddir)/config.status macros.in
- cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
+ cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status
# This directory's subdirectories are mostly independent; you can cd
# into them and run `make' without going through this Makefile.
list='$(SUBDIRS)'; for subdir in $$list; do \
target=`echo $@ | sed s/-recursive//`; \
echo "Making $$target in $$subdir"; \
- (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$target) \
+ (cd $$subdir && $(MAKE) $$target) \
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
done && test -z "$$fail"
for subdir in $$rev; do \
target=`echo $@ | sed s/-recursive//`; \
echo "Making $$target in $$subdir"; \
- (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$target) \
+ (cd $$subdir && $(MAKE) $$target) \
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
done && test -z "$$fail"
tags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
- (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+ (cd $$subdir && $(MAKE) tags); \
done
tags: TAGS
|| mkdir $(distdir)/$$subdir \
|| exit 1; \
chmod 777 $(distdir)/$$subdir; \
- (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(top_distdir) distdir=../$(distdir)/$$subdir distdir) \
+ (cd $$subdir && $(MAKE) top_distdir=../$(top_distdir) distdir=../$(distdir)/$$subdir distdir) \
|| exit 1; \
done
info: info-recursive
dvi: dvi-recursive
check: all-am
- $(MAKE) $(AM_MAKEFLAGS) check-recursive
+ $(MAKE) check-recursive
installcheck: installcheck-recursive
all-am: Makefile
uninstall: uninstall-recursive
install-strip:
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
+ $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
installdirs: installdirs-recursive
mostlyclean-generic:
+ -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
clean-generic:
+ -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
- -rm -f Makefile $(CONFIG_CLEAN_FILES)
+ -rm -f Makefile $(DISTCLEANFILES)
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
+ -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
+ -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
mostlyclean-am: mostlyclean-tags mostlyclean-generic
clean-am: clean-tags clean-generic mostlyclean-am
-# Makefile.in generated automatically by automake 1.3b from Makefile.am
+# Makefile.in generated automatically by automake 1.3 from Makefile.am
# Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
includedir = @includedir@
oldincludedir = /usr/include
-DESTDIR =
+DISTDIR =
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
-TAR = gtar
+TAR = tar
GZIP = --best
all: Makefile $(SCRIPTS)
info:
dvi:
check: all
- $(MAKE) $(AM_MAKEFLAGS) check-TESTS
+ $(MAKE) check-TESTS
installcheck:
install-exec:
@$(NORMAL_INSTALL)
uninstall:
install-strip:
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
+ $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
installdirs:
mostlyclean-generic:
+ -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
clean-generic:
+ -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
- -rm -f Makefile $(CONFIG_CLEAN_FILES)
+ -rm -f Makefile $(DISTCLEANFILES)
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
+ -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
+ -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
mostlyclean: mostlyclean-generic
clean: clean-generic mostlyclean
-# Makefile.in generated automatically by automake 1.3b from Makefile.am
+# Makefile.in generated automatically by automake 1.3 from Makefile.am
# Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
includedir = @includedir@
oldincludedir = /usr/include
-DESTDIR =
+DISTDIR =
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
rpmputtext_DEPENDENCIES =
rpmputtext_LDFLAGS =
CFLAGS = @CFLAGS@
-COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LINK = $(CC) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
+COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
+LINK = $(CC) $(CFLAGS) $(LDFLAGS) -o $@
DIST_COMMON = Makefile.am Makefile.in
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
-TAR = gtar
+TAR = tar
GZIP = --best
DEP_FILES = .deps/dump.P .deps/dumpdb.P .deps/rpmarchive.P \
.deps/rpmgettext.P .deps/rpmheader.P .deps/rpmlead.P \
info:
dvi:
check: all
+ $(MAKE)
installcheck:
install-exec:
@$(NORMAL_INSTALL)
uninstall:
install-strip:
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
+ $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
installdirs:
mostlyclean-generic:
+ -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
clean-generic:
+ -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
- -rm -f Makefile $(CONFIG_CLEAN_FILES)
+ -rm -f Makefile $(DISTCLEANFILES)
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
+ -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
+ -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
mostlyclean: mostlyclean-noinstPROGRAMS mostlyclean-compile \
mostlyclean-tags mostlyclean-depend mostlyclean-generic
}
static int verifyDependencies(rpmdb db, Header h) {
- rpmDependencies rpmdep;
+ rpmTransactionSet rpmdep;
struct rpmDependencyConflict * conflicts;
int numConflicts;
char * name, * version, * release;
int type, count, i;
- rpmdep = rpmdepDependencies(db);
- rpmdepAddPackage(rpmdep, h, NULL);
+ rpmdep = rpmtransCreateSet(db, NULL);
+ rpmtransAddPackage(rpmdep, h, NULL, NULL, 0, NULL);
rpmdepCheck(rpmdep, &conflicts, &numConflicts);
- rpmdepDone(rpmdep);
+ rpmtransFree(rpmdep);
if (numConflicts) {
headerGetEntry(h, RPMTAG_NAME, &type, (void **) &name, &count);
rpmdb db;
dbiIndexSet matches;
char * arg;
- char path[PATH_MAX];
ec = 0;
if (source == VERIFY_RPM && !(verifyFlags & VERIFY_DEPS)) {