def __init__(self, uri: str, repo_type: str = 'rpm-md', source_type: str = ''): """ Manage kiwi source URIs and allow transformation into standard URLs :param str uri: URI, remote, local or metalink repository location The resource type as part of the URI can be set to one of: * http: * https: * ftp: * obs: * dir: * file: * obsrepositories: * this: The special this:// type resolve to the image description directory. The code to resolve this is not part of the Uri class because it has no state information about the image description directory. Therefore the resolving of the this:// path happens on construction of an XMLState object as part of the resolve_this_path() method. The method resolves the path into a native dir:// URI which can be properly handled here. :param str repo_type: repository type name, defaults to 'rpm-md' and is only effectively used when building inside of the open build service which maps local repositories to a specific environment :param str source_type: specify source type if the provided URI is a service. Currently only the metalink source type is handled """ self.runtime_config = RuntimeConfig() if source_type == 'metalink': uri = self._resolve_metalink_uri(uri) self.repo_type = repo_type self.uri = uri if not uri.startswith(os.sep) else ''.join( [Defaults.get_default_uri_type(), uri]) self.remote_uri_types = { 'http': True, 'https': True, 'ftp': True, 'obs': True } self.local_uri_type = { 'dir': True, 'file': True, 'obsrepositories': True }
def __init__(self, uri: str, repo_type: str = 'rpm-md'): self.runtime_config = RuntimeConfig() self.repo_type = repo_type self.uri = uri if not uri.startswith(os.sep) else ''.join( [Defaults.get_default_uri_type(), uri] ) self.remote_uri_types = { 'http': True, 'https': True, 'ftp': True, 'obs': True } self.local_uri_type = { 'dir': True, 'file': True, 'obsrepositories': True }
def __init__(self, uri: str, repo_type: Dict = None): self.runtime_config = RuntimeConfig() self.repo_type = repo_type self.uri = uri if not uri.startswith(os.sep) else ''.join( [Defaults.get_default_uri_type(), uri]) self.mount_stack: List[str] = [] self.remote_uri_types = { 'http': True, 'https': True, 'ftp': True, 'obs': True } self.local_uri_type = { 'iso': True, 'dir': True, 'file': True, 'obsrepositories': True }