root/trunk/contrib/yum-2.3.3-chroot.patch
| Revision 2124, 7.5 kB (checked in by ensc, 3 years ago) | |
|---|---|
| |
-
yum-2.3.3/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.3/yum/config.py
old new 193 193 194 194 #defaults -either get them or set them 195 195 optionstrings = [('cachedir', '/var/cache/yum'), 196 ('logfile', '/var/log/yum.log'), 196 ('logfile', '/var/log/yum.log'), 197 ('lockfile', '/var/run/yum.pid'), 197 198 ('reposdir', ['/etc/yum/repos.d', '/etc/yum.repos.d']), 198 199 ('syslog_ident', None), 199 200 ('syslog_facility', 'LOG_USER'), … … 305 306 306 307 # do the dirs - set the root if there is one (grumble) 307 308 for option in ['cachedir', 'logfile']: 308 path = self.configdata[option] 309 root = self.configdata['installroot'] 310 rootedpath = root + path 309 rootedpath = self.getRootedPath(self.configdata[option]) 311 310 self.configdata[option] = rootedpath 312 311 setattr(self, option, rootedpath) 313 312 … … 340 339 "All plugin search paths must be absolute") 341 340 342 341 342 def getRootedPath(self, path, enforce_default=False, defaults_to_host=False): 343 instroot = self.configdata['installroot'] 344 if path.startswith('hostfs://'): res = path[9:] 345 elif path.startswith('chrootfs://'): res = instroot + '/' + path[11:] 346 else: 347 tmp = instroot + '/' +path 348 349 if enforce_default: 350 if defaults_to_host: res = path 351 else: res = tmp 352 else: 353 if os.path.exists(tmp): res = tmp 354 elif defaults_to_host: res = path 355 else: res = tmp 356 357 return res 358 343 359 def listConfigOptions(self): 344 360 """return list of options available for global config""" 345 361 return self.configdata.keys() … … 719 735 # read each of them in using confpp, then parse them same as any other repo 720 736 # section - as above. 721 737 722 reposdir = conf.reposdir 723 if os.path.exists(conf.installroot + '/' + reposdir): 724 reposdir = conf.installroot + '/' + reposdir 738 reposdir = conf.getRootedPath(conf.reposdir) 725 739 726 740 reposglob = reposdir + '/*.repo' 727 741 if os.path.exists(reposdir) and os.path.isdir(reposdir): -
yum-2.3.3/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.
