diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2007-05-16 16:18:05 +0300 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2007-05-16 16:18:05 +0300 |
commit | 2c080c11877fa083b6439b207368e05bb24e5b59 (patch) | |
tree | 6b1562c0cbc5a790e7147bded599680a36ae6c40 | |
parent | 7e796f6f52b175097914a0b7bfd5d104b0d60ade (diff) | |
download | librpm-tizen-2c080c11877fa083b6439b207368e05bb24e5b59.tar.gz librpm-tizen-2c080c11877fa083b6439b207368e05bb24e5b59.tar.bz2 librpm-tizen-2c080c11877fa083b6439b207368e05bb24e5b59.zip |
Make rebuilddb work with the --root option.
Patch from OpenSuSE.
-rw-r--r-- | rpmdb/rpmdb.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/rpmdb/rpmdb.c b/rpmdb/rpmdb.c index c15253e21..e88c92eef 100644 --- a/rpmdb/rpmdb.c +++ b/rpmdb/rpmdb.c @@ -3773,7 +3773,7 @@ int rpmdbRebuild(const char * prefix, rpmts ts, } dbpath = rootdbpath = rpmGetPath(prefix, tfn, NULL); if (!(prefix[0] == '/' && prefix[1] == '\0')) - dbpath += strlen(prefix); + dbpath += strlen(prefix) - 1; tfn = _free(tfn); /*@-nullpass@*/ @@ -3796,7 +3796,7 @@ int rpmdbRebuild(const char * prefix, rpmts ts, } newdbpath = newrootdbpath = rpmGetPath(prefix, tfn, NULL); if (!(prefix[0] == '/' && prefix[1] == '\0')) - newdbpath += strlen(prefix); + newdbpath += strlen(prefix) - 1; tfn = _free(tfn); rpmMessage(RPMMESS_DEBUG, _("rebuilding database %s into %s\n"), |