tom/dependencies.py
def update_single_dep(self, dep):
        """Check if new version of dependency dep was released and create
        commit updating it in *.spec, dist, source, and README.md files
        """
        log.info('Checking new version of {}'.format(dep))
        dist_file_path = 'deps-packaging/{}/distfiles'.format(dep)
        dist_file = self.buildscripts.get_file(dist_file_path)
        dist_file = dist_file.strip()
        source_file_path = 'deps-packaging/{}/source'.format(dep)
        source_file = self.buildscripts.get_file(source_file_path)
        source_file = source_file.strip()
        old_filename = re.sub('.* ', '', dist_file)
        old_url = '{}{}'.format(source_file, old_filename)
        (old_version, separator) = self.extract_version_from_filename(dep, old_filename)
        new_version = self.get_version_from_monitoring(dep)
        if not new_version:
            log.warning('Dependency {} not found in release-monitoring.org or in data file'.format(dep))
            new_version = self.find_new_version(old_url, old_version, separator)
        if new_version == old_version:
            # no update needed
            return False
        new_filename = old_filename.replace(old_version, new_version)
        new_url = old_url.replace(old_version, new_version)
        md5sum = self.checkfile(new_url, True)
        if not md5sum:
            message = 'Update {} from {} to {} FAILED to download {}'.format(dep, old_version, new_version, new_url)
            log.warn(message)
            self.slack.reply(message)
            return False
        message = 'Update {} from {} to {}'.format(dep, old_version, new_version)
        log.info(message)
        dist_file = '{}  {}'.format(md5sum, new_filename)
        self.buildscripts.put_file(dist_file_path, dist_file + '\n')
        source_file = source_file.replace(old_version, new_version)
        self.buildscripts.put_file(source_file_path, source_file + '\n')
        self.readme_lines = [
            self.maybe_replace(
                x, '* [{}]('.format(dep.replace('-hub', '')), old_version, new_version)
            for x in self.readme_lines
        ]
        readme_file = '\n'.join(self.readme_lines)
        self.buildscripts.put_file(self.readme_file_path, readme_file)
        spec_file_path = 'deps-packaging/{}/cfbuild-{}.spec'.format(dep, dep)
        try:
            spec_file = self.buildscripts.get_file(spec_file_path)
        except:
            pass
        else:
            spec_file = spec_file.replace(old_version, new_version)
            self.buildscripts.put_file(spec_file_path, spec_file + '\n')
        self.buildscripts.commit(message)
        return message
Check if new version of dependency dep was released and create
        commit updating it in *.spec, dist, source, and README.md files
        
Check if new version of dependency dep was released and create
commit updating it in *.spec, dist, source, and README.md files
Check if new version of dependency dep was released and create commit updating it in * . spec dist source and README . md files
def update_single_dep(self, dep):
        log.info('Checking new version of {}'.format(dep))
        dist_file_path = 'deps-packaging/{}/distfiles'.format(dep)
        dist_file = self.buildscripts.get_file(dist_file_path)
        dist_file = dist_file.strip()
        source_file_path = 'deps-packaging/{}/source'.format(dep)
        source_file = self.buildscripts.get_file(source_file_path)
        source_file = source_file.strip()
        old_filename = re.sub('.* ', '', dist_file)
        old_url = '{}{}'.format(source_file, old_filename)
        (old_version, separator) = self.extract_version_from_filename(dep, old_filename)
        new_version = self.get_version_from_monitoring(dep)
        if not new_version:
            log.warning('Dependency {} not found in release-monitoring.org or in data file'.format(dep))
            new_version = self.find_new_version(old_url, old_version, separator)
        if new_version == old_version:
            return False
        new_filename = old_filename.replace(old_version, new_version)
        new_url = old_url.replace(old_version, new_version)
        md5sum = self.checkfile(new_url, True)
        if not md5sum:
            message = 'Update {} from {} to {} FAILED to download {}'.format(dep, old_version, new_version, new_url)
            log.warn(message)
            self.slack.reply(message)
            return False
        message = 'Update {} from {} to {}'.format(dep, old_version, new_version)
        log.info(message)
        dist_file = '{}  {}'.format(md5sum, new_filename)
        self.buildscripts.put_file(dist_file_path, dist_file + '\n')
        source_file = source_file.replace(old_version, new_version)
        self.buildscripts.put_file(source_file_path, source_file + '\n')
        self.readme_lines = [
            self.maybe_replace(
                x, '* [{}]('.format(dep.replace('-hub', '')), old_version, new_version)
            for x in self.readme_lines
        ]
        readme_file = '\n'.join(self.readme_lines)
        self.buildscripts.put_file(self.readme_file_path, readme_file)
        spec_file_path = 'deps-packaging/{}/cfbuild-{}.spec'.format(dep, dep)
        try:
            spec_file = self.buildscripts.get_file(spec_file_path)
        except:
            pass
        else:
            spec_file = spec_file.replace(old_version, new_version)
            self.buildscripts.put_file(spec_file_path, spec_file + '\n')
        self.buildscripts.commit(message)
        return message
def update_single_dep ( self , dep ) : log . info ( 'Checking new version of {}' . format ( dep ) ) dist_file_path = 'deps-packaging/{}/distfiles' . format ( dep ) dist_file = self . buildscripts . get_file ( dist_file_path ) dist_file = dist_file . strip ( ) source_file_path = 'deps-packaging/{}/source' . format ( dep ) source_file = self . buildscripts . get_file ( source_file_path ) source_file = source_file . strip ( ) old_filename = re . sub ( '.* ' , '' , dist_file ) old_url = '{}{}' . format ( source_file , old_filename ) ( old_version , separator ) = self . extract_version_from_filename ( dep , old_filename ) new_version = self . get_version_from_monitoring ( dep ) if not new_version : log . warning ( 'Dependency {} not found in release-monitoring.org or in data file' . format ( dep ) ) new_version = self . find_new_version ( old_url , old_version , separator ) if new_version == old_version : return False new_filename = old_filename . replace ( old_version , new_version ) new_url = old_url . replace ( old_version , new_version ) md5sum = self . checkfile ( new_url , True ) if not md5sum : message = 'Update {} from {} to {} FAILED to download {}' . format ( dep , old_version , new_version , new_url ) log . warn ( message ) self . slack . reply ( message ) return False message = 'Update {} from {} to {}' . format ( dep , old_version , new_version ) log . info ( message ) dist_file = '{}  {}' . format ( md5sum , new_filename ) self . buildscripts . put_file ( dist_file_path , dist_file + '\n' ) source_file = source_file . replace ( old_version , new_version ) self . buildscripts . put_file ( source_file_path , source_file + '\n' ) self . readme_lines = [ self . maybe_replace ( x , '* [{}](' . format ( dep . replace ( '-hub' , '' ) ) , old_version , new_version ) for x in self . readme_lines ] readme_file = '\n' . join ( self . readme_lines ) self . buildscripts . put_file ( self . readme_file_path , readme_file ) spec_file_path = 'deps-packaging/{}/cfbuild-{}.spec' . format ( dep , dep ) try : spec_file = self . buildscripts . get_file ( spec_file_path ) except : pass else : spec_file = spec_file . replace ( old_version , new_version ) self . buildscripts . put_file ( spec_file_path , spec_file + '\n' ) self . buildscripts . commit ( message ) return message
Check if new version of dependency dep was released and create
commit updating it in *.spec, dist, source, and README.md files
Check if new version of dependency dep was released and create commit updating it in * . spec dist source and README . md files
"""Check if new version of dependency dep was released and create
        commit updating it in *.spec, dist, source, and README.md files
        """ # no update needed
self
dep