Logo Search packages:      
Sourcecode: yum version File versions  Download package

def yum::YumBase::getReposFromConfig (   self  ) 

read in repositories from config main and .repo files

Definition at line 85 of file __init__.py.

00085                                 :
        """read in repositories from config main and .repo files"""
        
        reposlist = []
        # look through our repositories.
        for section in self.conf.cfg.sections(): # loop through the list of sections
            if section != 'main': # must be a repoid
                try:
                    thisrepo = config.cfgParserRepo(section, self.conf, self.conf.cfg)
                except (Errors.RepoError, Errors.ConfigError), e:
                    self.errorlog(2, e)
                    continue
                else:
                    reposlist.append(thisrepo)

        # reads through each reposdir for *.repo
        # does not read recursively
        # read each of them in using confpp, then parse them same as any other repo
        # section - as above.
        for reposdir in self.conf.reposdir:
            if os.path.exists(self.conf.installroot + '/' + reposdir):
                reposdir = self.conf.installroot + '/' + reposdir
            
            if os.path.isdir(reposdir):
                repofn = glob.glob(reposdir+'/*.repo')
                repofn.sort()
                
                for fn in repofn:
                    if not os.path.isfile(fn):
                        continue
                    try:
                        cfg, sections = config.parseDotRepo(fn)
                    except Errors.ConfigError, e:
                        self.errorlog(2, e)
                        continue

                    for section in sections:
                        try:
                            thisrepo = config.cfgParserRepo(section, self.conf, 
                                    cfg)
                            reposlist.append(thisrepo)
                        except (Errors.RepoError, Errors.ConfigError), e:
                            self.errorlog(2, e)
                            continue

        # got our list of repo objects
        for thisrepo in reposlist:
            try:
                self.repos.add(thisrepo)
            except Errors.RepoError, e: 
                self.errorlog(2, e)
                continue

    def disablePlugins(self):


Generated by  Doxygen 1.6.0   Back to index