root/trunk/contrib/yum-2.3.4-chroot.patch
| Revision 2146, 7.5 kB (checked in by ensc, 3 years ago) | |
|---|---|
| |
-
yum-2.3.4/docs/yum.conf.5
old new 23 23 following options: 24 24 25 25 .IP \fBcachedir\fR 26 Directory where yum should store its cache and db files. The default is 27 `/var/cache/yum'. 26 Directory where yum should store its cache and db files. The default 27 is `/var/cache/yum'. Unless the prefixes `hostfs://' or `chrootfs://' 28 are used, some magic will be applied to determine the real path in 29 combination with `--installroot'. 28 30 29 31 .IP \fBreposdir\fR 30 32 A list of directories where yum should look for .repo files which define … … 34 36 repositories defined in /etc/yum.conf to form the complete set of repositories 35 37 that yum will use. 36 38 39 Unless the prefixes `hostfs://' or `chrootfs://' are used, some magic 40 will be applied to determine the real path in combination with 41 `--installroot'. 42 37 43 .IP \fBdebuglevel\fR 38 44 Debug message output level. Practical range is 0\-10. Default is `2'. 39 45 … … 41 47 Error message output level. Practical range is 0\-10. Default is `2'. 42 48 43 49 .IP \fBlogfile\fR 44 Full directory and file name for where yum should write its log file. 50 Full directory and file name for where yum should write its log 51 file. Unless the prefixes `hostfs://' or `chrootfs://' are used, 52 some magic will be applied to determine the real path in combination 53 with `--installroot'. 45 54 46 55 .IP \fBgpgcheck\fR 47 56 Either `1' or `0'. This tells yum whether or not it should perform a GPG -
yum-2.3.4/yum/config.py
old new 205 205 206 206 #defaults -either get them or set them 207 207 optionstrings = [('cachedir', '/var/cache/yum'), 208 ('logfile', '/var/log/yum.log'), 208 ('logfile', '/var/log/yum.log'), 209 ('lockfile', '/var/run/yum.pid'), 209 210 ('reposdir', ['/etc/yum/repos.d', '/etc/yum.repos.d']), 210 211 ('syslog_ident', None), 211 212 ('syslog_facility', 'LOG_USER'), … … 318 319 319 320 # do the dirs - set the root if there is one (grumble) 320 321 for option in ['cachedir', 'logfile']: 321 path = self.configdata[option] 322 root = self.configdata['installroot'] 323 rootedpath = root + path 322 rootedpath = self.getRootedPath(self.configdata[option]) 324 323 self.configdata[option] = rootedpath 325 324 setattr(self, option, rootedpath) 326 325 … … 358 357 "All plugin search paths must be absolute") 359 358 360 359 360 def getRootedPath(self, path, enforce_default=False, defaults_to_host=False): 361 instroot = self.configdata['installroot'] 362 if path.startswith('hostfs://'): res = path[9:] 363 elif path.startswith('chrootfs://'): res = instroot + '/' + path[11:] 364 else: 365 tmp = instroot + '/' +path 366 367 if enforce_default: 368 if defaults_to_host: res = path 369 else: res = tmp 370 else: 371 if os.path.exists(tmp): res = tmp 372 elif defaults_to_host: res = path 373 else: res = tmp 374 375 return res 376 361 377 def listConfigOptions(self): 362 378 """return list of options available for global config""" 363 379 return self.configdata.keys() … … 749 765 750 766 reposdirs = [] 751 767 for dir in conf.reposdir: 752 if os.path.exists(conf.installroot + '/' + dir): 753 reposdirs.append(conf.installroot + '/' + dir) 768 reposdirs.append(conf.getRootedPath(dir)) 754 769 755 770 repofn = [] 756 771 for reposdir in reposdirs: -
yum-2.3.4/yummain.py
old new 60 60 def unlock(): 61 61 try: 62 62 base.closeRpmDB() 63 base.doUnlock( YUM_PID_FILE)63 base.doUnlock() 64 64 except Errors.LockError, e: 65 65 sys.exit(200) 66 66 … … 78 78 except Errors.YumBaseError, e: 79 79 exFatal(e) 80 80 try: 81 base.doLock( YUM_PID_FILE)81 base.doLock() 82 82 except Errors.LockError, e: 83 83 base.errorlog(0,'%s' % e.msg) 84 84 sys.exit(200)
Note: See TracBrowser for help on using the browser.
