diff options
author | jbj <devnull@localhost> | 2002-08-13 20:40:32 +0000 |
---|---|---|
committer | jbj <devnull@localhost> | 2002-08-13 20:40:32 +0000 |
commit | 48a2529ce4b3ab1f677d3de9b70e8cbe14d910c6 (patch) | |
tree | 318f4066a1c3d2eee21732d288e74e0dc963067e /rpmdb | |
parent | 9b29055f422cd5f2aeff27b6c80e7c83317920c9 (diff) | |
download | librpm-tizen-48a2529ce4b3ab1f677d3de9b70e8cbe14d910c6.tar.gz librpm-tizen-48a2529ce4b3ab1f677d3de9b70e8cbe14d910c6.tar.bz2 librpm-tizen-48a2529ce4b3ab1f677d3de9b70e8cbe14d910c6.zip |
- fix: rebuilddb stat'ed target, not source, for rename sanity.
- create /var/lib/rpm if non-existent in, say, a chroot.
- erased packages are now repackaged into /var/spool/repackage.
CVS patchset: 5625
CVS date: 2002/08/13 20:40:32
Diffstat (limited to 'rpmdb')
-rw-r--r-- | rpmdb/db3.c | 5 | ||||
-rw-r--r-- | rpmdb/rpmdb.c | 9 |
2 files changed, 7 insertions, 7 deletions
diff --git a/rpmdb/db3.c b/rpmdb/db3.c index bbd18969e..6414a9482 100644 --- a/rpmdb/db3.c +++ b/rpmdb/db3.c @@ -862,6 +862,11 @@ static int db3open(rpmdb rpmdb, rpmTag rpmtag, dbiIndex * dbip) } /* + * Create the /var/lib/rpm directory if it doesn't exist (root only). + */ + (void) rpmioMkpath(dbhome, 0755, getuid(), getgid()); + + /* * Avoid incompatible DB_CREATE/DB_RDONLY flags on DBENV->open. */ if (dbi->dbi_use_dbenv) { diff --git a/rpmdb/rpmdb.c b/rpmdb/rpmdb.c index 1fed7c808..dfbfe5ef2 100644 --- a/rpmdb/rpmdb.c +++ b/rpmdb/rpmdb.c @@ -3575,9 +3575,9 @@ static int rpmdbMoveDatabase(const char * prefix, continue; sprintf(nfilename, "%s/%s/%s", prefix, newdbpath, base); (void)rpmCleanPath(nfilename); - if (Stat(nfilename, nst)) + if (stat(ofilename, nst)) continue; - if ((xx = Rename(ofilename, nfilename)) != 0) { + if ((xx = rename(ofilename, nfilename)) != 0) { rc = 1; continue; } @@ -3597,12 +3597,7 @@ static int rpmdbMoveDatabase(const char * prefix, xx = unlink(ofilename); sprintf(nfilename, "%s/%s/__db.%03d", prefix, newdbpath, i); (void)rpmCleanPath(nfilename); -#ifdef DYING - if ((xx = Rename(ofilename, nfilename)) != 0) - rc = 1; -#else xx = unlink(nfilename); -#endif } break; case 2: |