root/trunk/contrib/yum-2.6.0-chroot.patch

Revision 2425, 7.0 kB (checked in by ensc, 2 years ago)

fixed location of the lockfile; formerly, the chroot path was prepended
twice

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
  • yum-2.6.0/docs/yum.conf.5

    old new  
    2323following options: 
    2424 
    2525.IP \fBcachedir\fR 
    26 Directory where yum should store its cache and db files. The default is 
    27 `/var/cache/yum'. 
     26Directory where yum should store its cache and db files. The default 
     27is `/var/cache/yum'. Unless the prefixes `hostfs://' or `chrootfs://' 
     28are used, some magic will be applied to determine the real path in 
     29combination with `--installroot'. 
    2830 
    2931.IP \fBkeepcache\fR 
    3032Either `1' or `0'. Determines whether or not yum keeps the cache 
     
    4042repositories defined in /etc/yum.conf to form the complete set of repositories 
    4143that yum will use. 
    4244 
     45Unless the prefixes `hostfs://' or `chrootfs://' are used, some magic 
     46will be applied to determine the real path in combination with 
     47`--installroot'. 
     48 
    4349.IP \fBdebuglevel\fR 
    4450Debug message output level. Practical range is 0\-10. Default is `2'. 
    4551 
     
    4753Error message output level. Practical range is 0\-10. Default is `2'. 
    4854 
    4955.IP \fBlogfile\fR 
    50 Full directory and file name for where yum should write its log file. 
     56Full directory and file name for where yum should write its log 
     57file. Unless the prefixes `hostfs://' or `chrootfs://' are used, 
     58some magic will be applied to determine the real path in combination 
     59with `--installroot'. 
    5160 
    5261.IP \fBgpgcheck\fR 
    5362Either `1' or `0'. This tells yum whether or not it should perform a GPG 
  • yum-2.6.0/yum/config.py

    old new  
    450450        else: 
    451451            raise Errors.ConfigError, 'No such option %s' % option 
    452452 
     453    def getRootedPath(self, path, enforce_default=False, defaults_to_host=False): 
     454        instroot = getattr(self, 'installroot', None) 
     455        if instroot==None: 
     456            return path 
     457 
     458        if   path.startswith('hostfs://'):   res = path[9:] 
     459        elif path.startswith('chrootfs://'): res = instroot + '/' + path[11:] 
     460        else: 
     461            tmp = instroot + '/' +path 
     462 
     463            if enforce_default: 
     464                if defaults_to_host:    res = path 
     465                else:                   res = tmp 
     466            else: 
     467                if os.path.exists(tmp): res = tmp 
     468                elif defaults_to_host:  res = path 
     469                else:                   res = tmp 
     470 
     471        return res 
     472  
     473  
    453474class EarlyConf(BaseConfig): 
    454475    ''' 
    455476    Configuration option definitions for yum.conf's [main] section that are 
     
    474495    cachedir = Option('/var/cache/yum') 
    475496    keepcache = BoolOption(True) 
    476497    logfile = Option('/var/log/yum.log') 
     498    lockfile = Option('/var/run/yum.pid') 
    477499    reposdir = ListOption(['/etc/yum/repos.d', '/etc/yum.repos.d']) 
    478500    syslog_ident = Option() 
    479501    syslog_facility = Option('LOG_DAEMON') 
     
    580602    yumconf.populate(confparser, 'main') 
    581603 
    582604    # Apply the installroot to directory options 
    583     for option in ('cachedir', 'logfile'): 
     605    for option in ('cachedir', 'logfile', 'lockfile'): 
    584606        path = getattr(yumconf, option) 
    585         setattr(yumconf, option, yumconf.installroot + path
     607        setattr(yumconf, option, yumconf.getRootedPath(path)
    586608     
    587609    # Check that plugin paths are all absolute 
    588610    for path in yumconf.pluginpath: 
  • yum-2.6.0/yummain.py

    old new  
    6060    def unlock(): 
    6161        try: 
    6262            base.closeRpmDB() 
    63             base.doUnlock(YUM_PID_FILE
     63            base.doUnlock(
    6464        except Errors.LockError, e: 
    6565            sys.exit(200) 
    6666 
     
    8383    except Errors.YumBaseError, e: 
    8484        exFatal(e) 
    8585    try: 
    86         base.doLock(YUM_PID_FILE
     86        base.doLock(
    8787    except Errors.LockError, e: 
    8888        base.errorlog(0,'%s' % e.msg) 
    8989        sys.exit(200) 
Note: See TracBrowser for help on using the browser.