def load_index(index_url, package_whitelist=None, package_blacklist=[]): ''' Loads the index for a URL pointing to an index archive. :param index_url: the URL :type index_url: str :param package_whitelist: list of target package list :type package_whitelist: [str] :param package_blacklist: list of blacklisted package :type package_blacklist: [str] :returns: the index :rtype: rocon_app_utilities.RappIndexer ''' logger.debug('load_index(%s)' % index_url) if not index_url.endswith('.index.tar.gz'): raise NotImplementedError( "The url of the index must end with '.index.tar.gz'") logger.debug('load_index() load gzipped tar index') tar_gz_str = load_url(index_url, skip_decode=True) tar_gz_stream = StringIO(tar_gz_str) index = read_tarball(fileobj=tar_gz_stream, package_whitelist=package_whitelist, package_blacklist=package_blacklist) index.source = index_url return index
def _get_stack_info(distro, stack_name): global _stack_info if stack_name not in _stack_info: stack = distro.stacks[stack_name] version = stack.version url = 'http://ros-dry-releases.googlecode.com/svn/download/stacks/%(stack_name)s/%(stack_name)s-%(version)s/%(stack_name)s-%(version)s.yaml' % locals() logger.debug('Load dry package info from "%s"' % url) try: data = load_url(url) except URLError as e: raise RuntimeError("Could not fetch information for stack '%s' with version '%s': %s" % (stack_name, version, e)) _stack_info[stack_name] = yaml.load(data) return _stack_info[stack_name]
def _get_stack_info(distro, stack_name): global _stack_info if stack_name not in _stack_info: stack = distro.stacks[stack_name] version = stack.version url = 'http://ros-dry-releases.googlecode.com/svn/download/stacks/%(stack_name)s/%(stack_name)s-%(version)s/%(stack_name)s-%(version)s.yaml' % locals( ) logger.debug('Load dry package info from "%s"' % url) try: data = load_url(url) except URLError as e: raise RuntimeError( "Could not fetch information for stack '%s' with version '%s': %s" % (stack_name, version, e)) _stack_info[stack_name] = yaml.load(data) return _stack_info[stack_name]
def load_index(index_url, package_whitelist=None, package_blacklist=[]): ''' Loads the index for a URL pointing to an index archive. :param index_url: the URL :type index_url: str :param package_whitelist: list of target package list :type package_whitelist: [str] :param package_blacklist: list of blacklisted package :type package_blacklist: [str] :returns: the index :rtype: rocon_app_utilities.RappIndexer ''' logger.debug('load_index(%s)' % index_url) if not index_url.endswith('.index.tar.gz'): raise NotImplementedError("The url of the index must end with '.index.tar.gz'") logger.debug('load_index() load gzipped tar index') tar_gz_str = load_url(index_url, skip_decode=True) tar_gz_stream = StringIO(tar_gz_str) index = read_tarball(fileobj=tar_gz_stream, package_whitelist=package_whitelist, package_blacklist=package_blacklist) index.source = index_url return index
def test_distribution_file(): url = 'file://' + FILES_DIR + '/foo/distribution.yaml' yaml_str = load_url(url) data = yaml.load(yaml_str) dist_file = DistributionFile('foo', data) _validate_dist_file(dist_file)
def test_release_file(): url = 'file://' + FILES_DIR + '/foo/distribution.yaml' yaml_str = load_url(url) data = yaml.load(yaml_str) rel_file = ReleaseFile('foo', data) _validate_rel_file(rel_file)
def test_doc_file(): url = 'file://' + FILES_DIR + '/foo/distribution.yaml' yaml_str = load_url(url) data = yaml.load(yaml_str) doc_file = DocFile('foo', data) _validate_doc_file(doc_file)
def test_doc_build_file(): url = 'file://' + FILES_DIR + '/foo/doc-build.yaml' yaml_str = load_url(url) data = yaml.load(yaml_str) DocBuildFile('foo', data)
def test_distribution_file(): url = 'file://' + FILES_DIR + '/foo/distribution.yaml' yaml_str = load_url(url) data = yaml.safe_load(yaml_str) dist_file = DistributionFile('foo', data) _validate_dist_file(dist_file)
def test_release_build_file(): url = 'file://' + FILES_DIR + '/foo/release-build.yaml' yaml_str = load_url(url) data = yaml.load(yaml_str) ReleaseBuildFile('foo', data)
def test_release_build_file(): url = 'file://' + FILES_DIR + '/foo/release-build.yaml' yaml_str = load_url(url) data = yaml.safe_load(yaml_str) ReleaseBuildFile('foo', data)
def test_doc_file(): url = 'file://' + FILES_DIR + '/foo/doc.yaml' yaml_str = load_url(url) data = yaml.load(yaml_str) doc_file = DocFile('foo', data) _validate_doc_file(doc_file)
def test_source_file(): url = 'file://' + FILES_DIR + '/foo/distribution.yaml' yaml_str = load_url(url) data = yaml.safe_load(yaml_str) src_file = SourceFile('foo', data) _validate_src_file(src_file)
def test_source_build_file(): url = 'file://' + FILES_DIR + '/foo/source-build.yaml' yaml_str = load_url(url) data = yaml.load(yaml_str) SourceBuildFile('foo', data)
def test_source_file(): url = 'file://' + FILES_DIR + '/foo/distribution.yaml' yaml_str = load_url(url) data = yaml.load(yaml_str) src_file = SourceFile('foo', data) _validate_src_file(src_file)