SOURCES: rpm-rpm5-patchset-8784.patch (NEW) - fix rebuilddb with root
arekm
arekm at pld-linux.org
Sun Nov 18 15:21:11 CET 2007
Author: arekm Date: Sun Nov 18 14:21:11 2007 GMT
Module: SOURCES Tag: HEAD
---- Log message:
- fix rebuilddb with root
---- Files affected:
SOURCES:
rpm-rpm5-patchset-8784.patch (NONE -> 1.1) (NEW)
---- Diffs:
================================================================
Index: SOURCES/rpm-rpm5-patchset-8784.patch
diff -u /dev/null SOURCES/rpm-rpm5-patchset-8784.patch:1.1
--- /dev/null Sun Nov 18 15:21:11 2007
+++ SOURCES/rpm-rpm5-patchset-8784.patch Sun Nov 18 15:21:06 2007
@@ -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"),
================================================================
More information about the pld-cvs-commit
mailing list