From c750998765fbb74b31cca0a0677c317a4cc7d126 Mon Sep 17 00:00:00 2001 From: Enrico Scholz Date: Sun, 10 Dec 2006 12:56:27 +0000 Subject: [PATCH] fixed location of the lockfile; formerly, the chroot path was prepended twice git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@2425 94cd875c-1c1d-0410-91d2-eb244daf1a30 --- contrib/yum-2.6.0-chroot.patch | 12 +++--------- contrib/yum-2.9.6-chroot.patch | 12 +++--------- 2 files changed, 6 insertions(+), 18 deletions(-) diff --git a/contrib/yum-2.6.0-chroot.patch b/contrib/yum-2.6.0-chroot.patch index 3f0e750..1122668 100644 --- a/contrib/yum-2.6.0-chroot.patch +++ b/contrib/yum-2.6.0-chroot.patch @@ -48,17 +48,11 @@ if os.path.isdir(reposdir): #XXX: why can't we just pass the list of files? -@@ -482,16 +481,20 @@ +@@ -482,16 +481,14 @@ self.log(2, 'Finished') - def doLock(self, lockfile): -+ def __getLockfileName(self): -+ lockfile = self.conf.lockfile -+ return self.conf.getRootedPath(lockfile, -+ enforce_default = True, -+ defaults_to_host = False) -+ + def doLock(self): """perform the yum locking, raise yum-based exceptions, not OSErrors""" @@ -69,7 +63,7 @@ - root = self.conf.installroot - lockfile = root + '/' + lockfile # lock in the chroot - lockfile = os.path.normpath(lockfile) # get rid of silly preceding extra / -+ lockfile = self.__getLockfileName() ++ lockfile = self.conf.lockfile mypid=str(os.getpid()) while not self._lock(lockfile, mypid, 0644): @@ -87,7 +81,7 @@ - root = self.conf.installroot - lockfile = root + '/' + lockfile # lock in the chroot -+ lockfile=self.__getLockfileName() ++ lockfile=self.conf.lockfile self._unlock(lockfile) diff --git a/contrib/yum-2.9.6-chroot.patch b/contrib/yum-2.9.6-chroot.patch index 0634cc2..56b8410 100644 --- a/contrib/yum-2.9.6-chroot.patch +++ b/contrib/yum-2.9.6-chroot.patch @@ -127,17 +127,11 @@ diff -Nurp yum-2.9.6.orig/yum/__init__.py yum-2.9.6/yum/__init__.py if os.path.isdir(reposdir): #XXX: why can't we just pass the list of files? -@@ -502,16 +501,20 @@ class YumBase(depsolve.Depsolve): +@@ -502,16 +501,14 @@ class YumBase(depsolve.Depsolve): self.verbose_logger.log(logginglevels.INFO_2, 'Finished') - def doLock(self, lockfile): -+ def __getLockfileName(self): -+ lockfile = self.conf.lockfile -+ return self.conf.getRootedPath(lockfile, -+ enforce_default = True, -+ defaults_to_host = False) -+ + def doLock(self): """perform the yum locking, raise yum-based exceptions, not OSErrors""" @@ -148,7 +142,7 @@ diff -Nurp yum-2.9.6.orig/yum/__init__.py yum-2.9.6/yum/__init__.py - root = self.conf.installroot - lockfile = root + '/' + lockfile # lock in the chroot - lockfile = os.path.normpath(lockfile) # get rid of silly preceding extra / -+ lockfile = self.__getLockfileName() ++ lockfile = self.conf.lockfile mypid=str(os.getpid()) while not self._lock(lockfile, mypid, 0644): @@ -166,7 +160,7 @@ diff -Nurp yum-2.9.6.orig/yum/__init__.py yum-2.9.6/yum/__init__.py - root = self.conf.installroot - lockfile = root + '/' + lockfile # lock in the chroot -+ lockfile=self.__getLockfileName() ++ lockfile=self.conf.lockfile self._unlock(lockfile) -- 1.8.1.5