| 1 | | --- yum-3.2.0/yum/config.py.chroot |
|---|
| 2 | | +++ yum-3.2.0/yum/config.py |
|---|
| 3 | | @@ -464,6 +464,26 @@ |
|---|
| | 1 | --- yum-3.2.0/yum/__init__.py.chroot 2007-05-16 16:57:12.000000000 -0400 |
|---|
| | 2 | +++ yum-3.2.0/yum/__init__.py 2007-06-20 20:33:35.000000000 -0400 |
|---|
| | 3 | @@ -201,8 +201,7 @@ class YumBase(depsolve.Depsolve): |
|---|
| | 4 | # (typically /etc/yum/repos.d) |
|---|
| | 5 | parser = ConfigParser() |
|---|
| | 6 | for reposdir in self.conf.reposdir: |
|---|
| | 7 | - if os.path.exists(self.conf.installroot+'/'+reposdir): |
|---|
| | 8 | - reposdir = self.conf.installroot + '/' + reposdir |
|---|
| | 9 | + reposdir = self.conf.getRootedPath(reposdir) |
|---|
| | 10 | |
|---|
| | 11 | if os.path.isdir(reposdir): |
|---|
| | 12 | for repofn in glob.glob('%s/*.repo' % reposdir): |
|---|
| | 13 | @@ -632,17 +631,15 @@ class YumBase(depsolve.Depsolve): |
|---|
| | 14 | |
|---|
| | 15 | self.verbose_logger.log(logginglevels.INFO_2, 'Finished') |
|---|
| | 16 | |
|---|
| | 17 | - def doLock(self, lockfile = YUM_PID_FILE): |
|---|
| | 18 | + def doLock(self): |
|---|
| | 19 | """perform the yum locking, raise yum-based exceptions, not OSErrors""" |
|---|
| | 20 | |
|---|
| | 21 | # if we're not root then we don't lock - just return nicely |
|---|
| | 22 | if self.conf.uid != 0: |
|---|
| | 23 | return |
|---|
| | 24 | - |
|---|
| | 25 | - root = self.conf.installroot |
|---|
| | 26 | - lockfile = root + '/' + lockfile # lock in the chroot |
|---|
| | 27 | - lockfile = os.path.normpath(lockfile) # get rid of silly preceding extra / |
|---|
| | 28 | - |
|---|
| | 29 | + |
|---|
| | 30 | + lockfile = self.conf.lockfile |
|---|
| | 31 | + |
|---|
| | 32 | mypid=str(os.getpid()) |
|---|
| | 33 | while not self._lock(lockfile, mypid, 0644): |
|---|
| | 34 | fd = open(lockfile, 'r') |
|---|
| | 35 | @@ -667,16 +664,15 @@ class YumBase(depsolve.Depsolve): |
|---|
| | 36 | msg = 'Existing lock %s: another copy is running as pid %s. Aborting.' % (lockfile, oldpid) |
|---|
| | 37 | raise Errors.LockError(0, msg) |
|---|
| | 38 | |
|---|
| | 39 | - def doUnlock(self, lockfile = YUM_PID_FILE): |
|---|
| | 40 | + def doUnlock(self): |
|---|
| | 41 | """do the unlock for yum""" |
|---|
| | 42 | |
|---|
| | 43 | # if we're not root then we don't lock - just return nicely |
|---|
| | 44 | if self.conf.uid != 0: |
|---|
| | 45 | return |
|---|
| | 46 | |
|---|
| | 47 | - root = self.conf.installroot |
|---|
| | 48 | - lockfile = root + '/' + lockfile # lock in the chroot |
|---|
| | 49 | - |
|---|
| | 50 | + lockfile=self.conf.lockfile |
|---|
| | 51 | + |
|---|
| | 52 | self._unlock(lockfile) |
|---|
| | 53 | |
|---|
| | 54 | def _lock(self, filename, contents='', mode=0777): |
|---|
| | 55 | --- yum-3.2.0/yum/config.py.chroot 2007-04-26 10:12:30.000000000 -0400 |
|---|
| | 56 | +++ yum-3.2.0/yum/config.py 2007-06-20 20:33:35.000000000 -0400 |
|---|
| | 57 | @@ -464,6 +464,26 @@ class StartupConf(BaseConfig): |
|---|
| 50 | | --- yum-3.2.0/yum/__init__.py.chroot |
|---|
| 51 | | +++ yum-3.2.0/yum/__init__.py |
|---|
| 52 | | @@ -201,8 +201,7 @@ |
|---|
| 53 | | # (typically /etc/yum/repos.d) |
|---|
| 54 | | parser = ConfigParser() |
|---|
| 55 | | for reposdir in self.conf.reposdir: |
|---|
| 56 | | - if os.path.exists(self.conf.installroot+'/'+reposdir): |
|---|
| 57 | | - reposdir = self.conf.installroot + '/' + reposdir |
|---|
| 58 | | + reposdir = self.conf.getRootedPath(reposdir) |
|---|
| 59 | | |
|---|
| 60 | | if os.path.isdir(reposdir): |
|---|
| 61 | | for repofn in glob.glob('%s/*.repo' % reposdir): |
|---|
| 62 | | @@ -632,17 +631,15 @@ |
|---|
| 63 | | |
|---|
| 64 | | self.verbose_logger.log(logginglevels.INFO_2, 'Finished') |
|---|
| 65 | | |
|---|
| 66 | | - def doLock(self, lockfile = YUM_PID_FILE): |
|---|
| 67 | | + def doLock(self): |
|---|
| 68 | | """perform the yum locking, raise yum-based exceptions, not OSErrors""" |
|---|
| 69 | | |
|---|
| 70 | | # if we're not root then we don't lock - just return nicely |
|---|
| 71 | | if self.conf.uid != 0: |
|---|
| 72 | | return |
|---|
| 73 | | - |
|---|
| 74 | | - root = self.conf.installroot |
|---|
| 75 | | - lockfile = root + '/' + lockfile # lock in the chroot |
|---|
| 76 | | - lockfile = os.path.normpath(lockfile) # get rid of silly preceding extra / |
|---|
| 77 | | - |
|---|
| 78 | | + |
|---|
| 79 | | + lockfile = self.conf.lockfile |
|---|
| 80 | | + |
|---|
| 81 | | mypid=str(os.getpid()) |
|---|
| 82 | | while not self._lock(lockfile, mypid, 0644): |
|---|
| 83 | | fd = open(lockfile, 'r') |
|---|
| 84 | | @@ -667,16 +664,15 @@ |
|---|
| 85 | | msg = 'Existing lock %s: another copy is running as pid %s. Aborting.' % (lockfile, oldpid) |
|---|
| 86 | | raise Errors.LockError(0, msg) |
|---|
| 87 | | |
|---|
| 88 | | - def doUnlock(self, lockfile = YUM_PID_FILE): |
|---|
| 89 | | + def doUnlock(self): |
|---|
| 90 | | """do the unlock for yum""" |
|---|
| 91 | | |
|---|
| 92 | | # if we're not root then we don't lock - just return nicely |
|---|
| 93 | | if self.conf.uid != 0: |
|---|
| 94 | | return |
|---|
| 95 | | |
|---|
| 96 | | - root = self.conf.installroot |
|---|
| 97 | | - lockfile = root + '/' + lockfile # lock in the chroot |
|---|
| 98 | | - |
|---|
| 99 | | + lockfile=self.conf.lockfile |
|---|
| 100 | | + |
|---|
| 101 | | self._unlock(lockfile) |
|---|
| 102 | | |
|---|
| 103 | | def _lock(self, filename, contents='', mode=0777): |
|---|
| 104 | | --- yum-3.2.0/docs/yum.conf.5.chroot |
|---|
| 105 | | +++ yum-3.2.0/docs/yum.conf.5 |
|---|
| 106 | | @@ -23,8 +23,10 @@ |
|---|
| | 104 | --- yum-3.2.0/docs/yum.conf.5.chroot 2007-02-18 19:14:56.000000000 -0500 |
|---|
| | 105 | +++ yum-3.2.0/docs/yum.conf.5 2007-06-20 20:33:35.000000000 -0400 |
|---|
| | 106 | @@ -23,8 +23,10 @@ The [main] section must exist for yum to |
|---|
| 150 | | + if opts.conffile==None: |
|---|
| 151 | | + opts.conffile = '/etc/yum.conf' |
|---|
| 152 | | + if opts.installroot and os.access(opts.installroot+'/'+opts.conffile, os.R_OK): |
|---|
| 153 | | opts.conffile = opts.installroot+'/'+opts.conffile |
|---|
| 154 | | elif opts.conffile == '/etc/yum/yum.conf': |
|---|
| 155 | | # check if /installroot/etc/yum.conf exists. |
|---|
| 156 | | if os.access(opts.installroot+'/etc/yum.conf', os.R_OK): |
|---|
| 157 | | opts.conffile = opts.installroot+'/etc/yum.conf' |
|---|
| 158 | | + |
|---|
| 159 | | + if opts.installroot: |
|---|
| | 157 | - opts.conffile = opts.installroot+'/'+opts.conffile |
|---|
| | 158 | - elif opts.conffile == '/etc/yum/yum.conf': |
|---|
| | 159 | - # check if /installroot/etc/yum.conf exists. |
|---|
| | 160 | - if os.access(opts.installroot+'/etc/yum.conf', os.R_OK): |
|---|
| | 161 | - opts.conffile = opts.installroot+'/etc/yum.conf' |
|---|