Use cpioStrerror when getNextHeader fails.
More const warnings removed.
binary rpms always have RPMTAG_SOURCERPM, source rpms do not.
CVS patchset: 2682
CVS date: 1999/01/08 16:44:30
Header h;
int isSource;
int tmpnum = 0;
- rpmTransactionSet rpmdep;
+ rpmTransactionSet rpmdep = NULL;
struct rpmDependencyConflict * conflicts;
int numConflicts;
int stopInstall = 0;
fdClose(fd);
} else {
if (!dbIsOpen) {
- rpmMessage(RPMMESS_DEBUG, _("opening database "
- "mode: 0%o\n"), mode);
if (rpmdbOpen(rootdir, &db, mode, 0644)) {
const char *dn;
dn = rpmGetPath( (rootdir ? rootdir : ""),
if (numBinaryPackages) rpmtransFree(rpmdep);
-
- if (!stopInstall) {
+ if (numSourcePackages && !stopInstall) {
for (i = 0; i < numSourcePackages; i++) {
fd = fdOpen(sourcePackages[i], O_RDONLY, 0);
if (fdFileno(fd) < 0) {
/* FIXME how do we close our various fd's? */
- if (db != NULL) rpmdbClose(db);
+ if (dbIsOpen) rpmdbClose(db);
return numFailed;
}
ch.path = NULL;
do {
if ((rc = getNextHeader(cfd, &ch))) {
- fprintf(stderr, _("error %d reading header: %s\n"),
- rc, strerror(errno));
+ fprintf(stderr, _("getNextHeader: %s\n"), cpioStrerror(rc));
return CPIOERR_BAD_HEADER;
}
return set.recs[recno].fileNumber;
}
-dbiIndex * dbiOpenIndex(char * filename, int flags, int perms, DBTYPE type) {
- dbiIndex * db;
+dbiIndex * dbiOpenIndex(const char * filename, int flags, int perms, DBTYPE type) {
+ dbiIndex * dbi;
- db = malloc(sizeof(*db));
- db->indexname = strdup(filename);
- db->db = dbopen(filename, flags, perms, type, NULL);
- if (!db->db) {
- free(db->indexname);
- free(db);
- rpmError(RPMERR_DBOPEN, _("cannot open file %s: "), filename,
+ dbi = malloc(sizeof(*dbi));
+ dbi->db = dbopen(filename, flags, perms, type, NULL);
+ if (!dbi->db) {
+ free(dbi);
+ rpmError(RPMERR_DBOPEN, _("cannot open file %s: %s"), filename,
strerror(errno));
return NULL;
}
-
- return db;
+ dbi->indexname = strdup(filename);
+ return dbi;
}
void dbiCloseIndex(dbiIndex * dbi) {
extern "C" {
#endif
-dbiIndex * dbiOpenIndex(char * filename, int flags, int perms, DBTYPE type);
+dbiIndex * dbiOpenIndex(const char * filename, int flags, int perms, DBTYPE type);
void dbiCloseIndex(dbiIndex * dbi);
void dbiSyncIndex(dbiIndex * dbi);
int dbiSearchIndex(dbiIndex * dbi, const char * str, dbiIndexSet * set);
char * package, dbiIndexSet * matches);
static int addOrderedPack(rpmTransactionSet rpmdep,
struct availablePackage * package,
- void ** ordering, int * orderNumPtr,
+ const void ** ordering, int * orderNumPtr,
int * selected, int selectionClass,
int satisfyDepends, char ** errorStack);
int count, i, j;
char ** obsoletes;
- if (headerIsEntry(h, RPMTAG_SOURCEPACKAGE)) {
+ /* XXX binary rpms always have RPMTAG_SOURCERPM, source rpms do not */
+ if (!headerIsEntry(h, RPMTAG_SOURCERPM))
return 1;
- }
/* FIXME: handling upgrades like this is *almost* okay. It doesn't
check to make sure we're upgrading to a newer version, and it
static int addOrderedPack(rpmTransactionSet rpmdep,
struct availablePackage * package,
- void ** ordering, int * orderNumPtr,
+ const void ** ordering, int * orderNumPtr,
int * selected, int selectionClass,
int satisfyDepends, char ** errorStack) {
char ** requires, ** requiresVersion;
&defaultPrefix, 1);
}
+ /* XXX binary rpms always have RPMTAG_SOURCERPM, source rpms do not */
if (lead->type == RPMLEAD_SOURCE) {
if (!headerIsEntry(*hdr, RPMTAG_SOURCEPACKAGE))
headerAddEntry(*hdr, RPMTAG_SOURCEPACKAGE, RPM_INT32_TYPE,
int minimal = flags & RPMDB_FLAG_MINIMAL;
const char * akey;
+ if (mode & O_WRONLY)
+ return 1;
+
/* we should accept NULL as a valid prefix */
if (!prefix) prefix="";
filename = alloca(strlen(prefix) + strlen(dbpath) + 40);
- if (mode & O_WRONLY)
- return 1;
-
strcpy(filename, prefix);
strcat(filename, dbpath);
- rpmMessage(RPMMESS_DEBUG, _("opening database in %s\n"), filename);
+ rpmMessage(RPMMESS_DEBUG, _("opening database mode 0x%x in %s\n"),
+ mode, filename);
strcat(filename, "packages.rpm");
void rpmError(int code, char * format, ...);
int rpmErrorCode(void);
+char *rpmErrorCodeString(void);
char *rpmErrorString(void);
rpmErrorCallBackType rpmErrorSetCallback(rpmErrorCallBackType);
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
-"POT-Creation-Date: 1999-01-06 15:53-0500\n"
+"POT-Creation-Date: 1999-01-08 09:54-0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
destdir="`pwd`"
destdir="`dirname $destdir`"
-rm -rf $destdir/var/lib/rpm/*
$rpm -i -vv --nodeps --prefix="`pwd`/../usr" $myrpm | \
sed -e "s,$destdir,,g" > $0.out
destdir="`pwd`"
destdir="`dirname $destdir`"
+rm -rf $destdir/var/lib/rpm/*
${DBGX} $rpm --initdb