From 16e8ebed5748dd646d9833c5195a48981e5da2a2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Arkadiusz=20Mi=C5=9Bkiewicz?= Date: Sun, 18 Nov 2007 14:21:06 +0000 Subject: [PATCH] - fix rebuilddb with root Changed files: rpm-rpm5-patchset-8784.patch -> 1.1 --- rpm-rpm5-patchset-8784.patch | 41 ++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 rpm-rpm5-patchset-8784.patch diff --git a/rpm-rpm5-patchset-8784.patch b/rpm-rpm5-patchset-8784.patch new file mode 100644 index 0000000..7f518e5 --- /dev/null +++ b/rpm-rpm5-patchset-8784.patch @@ -0,0 +1,41 @@ +diff -urN rpm-4.4.9.org/rpmdb/rpmdb.c rpm-4.4.9/rpmdb/rpmdb.c +--- rpm-4.4.9.org/rpmdb/rpmdb.c 2007-11-18 15:11:35.653546000 +0100 ++++ rpm-4.4.9/rpmdb/rpmdb.c 2007-11-18 15:14:35.666077651 +0100 +@@ -3899,11 +3899,6 @@ + int * dbiTags = NULL; + int dbiTagsMax = 0; + +- /*@-branchstate@*/ +- if (prefix == NULL) prefix = "/"; +- /*@=branchstate@*/ +- prefix = rpmGetPath(prefix, NULL); /* strip trailing '/' */ +- + _dbapi = rpmExpandNumeric("%{_dbapi}"); + _dbapi_rebuild = rpmExpandNumeric("%{_dbapi_rebuild}"); + +@@ -3920,6 +3915,16 @@ + rc = 1; + goto exit; + } ++ /* Add --root prefix iff --dbpath is not a URL. */ ++ switch (urlPath(tfn, NULL)) { ++ default: ++ prefix = xstrdup(""); ++ break; ++ case URL_IS_UNKNOWN: ++ prefix = rpmGetPath((prefix ? prefix : "/"), NULL); ++ break; ++ } ++ + dbpath = rootdbpath = rpmGetPath(prefix, tfn, NULL); + if (!(prefix[0] == '/' && prefix[1] == '\0')) + dbpath += strlen(prefix); +@@ -3945,7 +3950,7 @@ + } + newdbpath = newrootdbpath = rpmGetPath(prefix, tfn, NULL); + if (!(prefix[0] == '/' && prefix[1] == '\0')) +- newdbpath += strlen(prefix) - 1; ++ newdbpath += strlen(prefix); + tfn = _free(tfn); + + rpmMessage(RPMMESS_DEBUG, _("rebuilding database %s into %s\n"), -- 2.44.0