]> git.pld-linux.org Git - packages/rpm.git/commitdiff
- fix rebuilddb with root
authorArkadiusz Miśkiewicz <arekm@maven.pl>
Sun, 18 Nov 2007 14:21:06 +0000 (14:21 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    rpm-rpm5-patchset-8784.patch -> 1.1

rpm-rpm5-patchset-8784.patch [new file with mode: 0644]

diff --git a/rpm-rpm5-patchset-8784.patch b/rpm-rpm5-patchset-8784.patch
new file mode 100644 (file)
index 0000000..7f518e5
--- /dev/null
@@ -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"),
This page took 0.047089 seconds and 4 git commands to generate.