From 93efd0a7b8ffc48adafc9ba25e7cee42a8bef153 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 29 Mar 1996 01:43:10 +0000 Subject: [PATCH] don't overwrite an existing database CVS patchset: 495 CVS date: 1996/03/29 01:43:10 --- convertdb.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/convertdb.c b/convertdb.c index 956655a81..c498dfefb 100644 --- a/convertdb.c +++ b/convertdb.c @@ -38,17 +38,14 @@ int convertDB(void) { char * preun, * postun; int i, j; - if (oldrpmdbOpen(&olddb)) { - error(RPMERR_OLDDBMISSING, ""); + if (exists("/var/lib/rpm/packages.rpm")) { + error(RPMERR_NOCREATEDB, "RPM database already exists"); return 0; } - if (exists("/var/lib/rpm/packages.rpm")) { -#if 0 - error(RPMERR_NOCREATEDB, "RPM database already exists"); + if (oldrpmdbOpen(&olddb)) { + error(RPMERR_OLDDBMISSING, ""); return 0; -#endif - unlink("/var/lib/rpm/packages.rpm"); } /* if any of the indexes exist, get rid of them */