yum/chroot-without-dupe-path.patch

60 lines
2.4 KiB
Diff

commit f48b1d9f0ede0eae518f5b353ed9dda74dde6d7c
Author: Seth Vidal <skvidal@fedoraproject.org>
Date: Fri Apr 30 12:16:54 2010 -0400
make sure we're not prepending a path which is already been prepended
with the installroot
fixes rh bugs:
https://bugzilla.redhat.com/show_bug.cgi?id=577627
and
https://bugzilla.redhat.com/show_bug.cgi?id=560078
diff --git a/yum/rpmsack.py b/yum/rpmsack.py
index 83268cc..6a40939 100644
--- a/yum/rpmsack.py
+++ b/yum/rpmsack.py
@@ -171,7 +171,10 @@ class RPMDBPackageSack(PackageSackBase):
if cachedir is None:
cachedir = misc.getCacheDir()
self.setCacheDir(cachedir)
- self._persistdir = root + '/' + persistdir
+ if not os.path.normpath(persistdir).startswith(self.root):
+ self._persistdir = root + '/' + persistdir
+ else:
+ self._persistdir = persistdir
self._have_cached_rpmdbv_data = None
self._cached_conflicts_data = None
# Store the result of what happens, if a transaction completes.
@@ -231,7 +234,10 @@ class RPMDBPackageSack(PackageSackBase):
def setCacheDir(self, cachedir):
""" Sets the internal cachedir value for the rpmdb, to be the
"installed" directory from this parent. """
- self._cachedir = self.root + '/' + cachedir + "/installed/"
+ if not os.path.normpath(cachedir).startswith(self.root):
+ self._cachedir = self.root + '/' + cachedir + "/installed/"
+ else:
+ self._cachedir = '/' + cachedir + "/installed/"
def readOnlyTS(self):
if not self.ts:
commit 9714379777bfa6569a46ef8d2cc1131b951eebf7
Author: Seth Vidal <skvidal@fedoraproject.org>
Date: Fri Apr 30 12:28:10 2010 -0400
and do the same for the history db with an --installroot
--- a/yum/history.py~ 2010-02-10 11:40:37.000000000 -0500
+++ b/yum/history.py 2010-05-03 11:38:09.000000000 -0400
@@ -176,7 +176,10 @@
self._conn = None
self.conf = yum.misc.GenericHolder()
- self.conf.db_path = os.path.normpath(root + '/' + db_path)
+ if not os.path.normpath(db_path).startswith(root):
+ self.conf.db_path = os.path.normpath(root + '/' + db_path)
+ else:
+ self.conf.db_path = os.path.normpath('/' + db_path)
self.conf.writable = False
if not os.path.exists(self.conf.db_path):