don't overwrite an existing database

CVS patchset: 495
CVS date: 1996/03/29 01:43:10
This commit is contained in:
root 1996-03-29 01:43:10 +00:00
parent 2aed2e1fa8
commit 93efd0a7b8
1 changed files with 4 additions and 7 deletions

View File

@ -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 */