]>
Commit | Line | Data |
---|---|---|
16e8ebed AM |
1 | diff -urN rpm-4.4.9.org/rpmdb/rpmdb.c rpm-4.4.9/rpmdb/rpmdb.c |
2 | --- rpm-4.4.9.org/rpmdb/rpmdb.c 2007-11-18 15:11:35.653546000 +0100 | |
3 | +++ rpm-4.4.9/rpmdb/rpmdb.c 2007-11-18 15:14:35.666077651 +0100 | |
4 | @@ -3899,11 +3899,6 @@ | |
5 | int * dbiTags = NULL; | |
6 | int dbiTagsMax = 0; | |
7 | ||
8 | - /*@-branchstate@*/ | |
9 | - if (prefix == NULL) prefix = "/"; | |
10 | - /*@=branchstate@*/ | |
11 | - prefix = rpmGetPath(prefix, NULL); /* strip trailing '/' */ | |
12 | - | |
13 | _dbapi = rpmExpandNumeric("%{_dbapi}"); | |
14 | _dbapi_rebuild = rpmExpandNumeric("%{_dbapi_rebuild}"); | |
15 | ||
16 | @@ -3920,6 +3915,16 @@ | |
17 | rc = 1; | |
18 | goto exit; | |
19 | } | |
20 | + /* Add --root prefix iff --dbpath is not a URL. */ | |
21 | + switch (urlPath(tfn, NULL)) { | |
22 | + default: | |
23 | + prefix = xstrdup(""); | |
24 | + break; | |
25 | + case URL_IS_UNKNOWN: | |
26 | + prefix = rpmGetPath((prefix ? prefix : "/"), NULL); | |
27 | + break; | |
28 | + } | |
29 | + | |
30 | dbpath = rootdbpath = rpmGetPath(prefix, tfn, NULL); | |
31 | if (!(prefix[0] == '/' && prefix[1] == '\0')) | |
32 | dbpath += strlen(prefix); | |
33 | @@ -3945,7 +3950,7 @@ | |
34 | } | |
35 | newdbpath = newrootdbpath = rpmGetPath(prefix, tfn, NULL); | |
36 | if (!(prefix[0] == '/' && prefix[1] == '\0')) | |
37 | - newdbpath += strlen(prefix) - 1; | |
38 | + newdbpath += strlen(prefix); | |
39 | tfn = _free(tfn); | |
40 | ||
41 | rpmMessage(RPMMESS_DEBUG, _("rebuilding database %s into %s\n"), |