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

Revision 2457, 6.6 kB (checked in by ensc, 2 years ago)

added patch for yum-3.0.3

  • yum-3.0.3/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-3.0.3/yum/__init__.py

    old new  
    169169        # (typically /etc/yum.repos.d and /etc/yum/repos.d) 
    170170        parser = ConfigParser() 
    171171        for reposdir in self.conf.reposdir: 
    172             if os.path.exists(self.conf.installroot+'/'+reposdir): 
    173                 reposdir = self.conf.installroot + '/' + reposdir 
     172            reposdir  = self.conf.getRootedPath(reposdir) 
    174173 
    175174            if os.path.isdir(reposdir): 
    176175                for repofn in glob.glob('%s/*.repo' % reposdir): 
     
    523522             
    524523        self.verbose_logger.log(logginglevels.INFO_2, 'Finished') 
    525524         
    526     def doLock(self, lockfile = YUM_PID_FILE): 
     525    def doLock(self): 
    527526        """perform the yum locking, raise yum-based exceptions, not OSErrors""" 
    528527         
    529528        # if we're not root then we don't lock - just return nicely 
    530529        if self.conf.uid != 0: 
    531530            return 
    532              
    533         root = self.conf.installroot 
    534         lockfile = root + '/' + lockfile # lock in the chroot 
    535         lockfile = os.path.normpath(lockfile) # get rid of silly preceding extra / 
    536          
     531 
     532        lockfile = self.conf.lockfile 
     533 
    537534        mypid=str(os.getpid())     
    538535        while not self._lock(lockfile, mypid, 0644): 
    539536            fd = open(lockfile, 'r') 
     
    558555                    msg = 'Existing lock %s: another copy is running. Aborting.' % lockfile 
    559556                    raise Errors.LockError(0, msg) 
    560557     
    561     def doUnlock(self, lockfile = YUM_PID_FILE): 
     558    def doUnlock(self): 
    562559        """do the unlock for yum""" 
    563560         
    564561        # if we're not root then we don't lock - just return nicely 
    565562        if self.conf.uid != 0: 
    566563            return 
    567564         
    568         root = self.conf.installroot 
    569         lockfile = root + '/' + lockfile # lock in the chroot 
    570          
     565        lockfile=self.conf.lockfile 
     566 
    571567        self._unlock(lockfile) 
    572568         
    573569    def _lock(self, filename, contents='', mode=0777): 
Note: See TracBrowser for help on using the browser.