def __init__(self): if self.patches is None: self.patches = [] if not self.version: raise InvalidRecipeError( self, _("'version' attribute is missing in the recipe"))
def __init__(self): Source.__init__(self) if not self.url: raise InvalidRecipeError( _("'url' attribute is missing in the recipe")) self.url = self.replace_name_and_version(self.url) if self.tarball_name is not None: self.tarball_name = \ self.replace_name_and_version(self.tarball_name) else: self.tarball_name = os.path.basename(self.url) if self.tarball_dirname is not None: self.tarball_dirname = \ self.replace_name_and_version(self.tarball_dirname) self.download_path = os.path.join(self.repo_dir, self.tarball_name) # URL-encode spaces and other special characters in the URL's path split = list(urllib.parse.urlsplit(self.url)) split[2] = urllib.parse.quote(split[2]) self.url = urllib.parse.urlunsplit(split) self.mirror_url = urllib.parse.urljoin(TARBALL_MIRROR, self.tarball_name) o = urllib.parse.urlparse(self.url) if o.scheme in ('http', 'ftp'): raise FatalError('Download URL {!r} must use HTTPS'.format( self.url))
def __init__(self): Source.__init__(self) if not self.url: raise InvalidRecipeError( _("'url' attribute is missing in the recipe")) self.url = self.replace_name_and_version(self.url) if self.tarball_name is not None: self.tarball_name = self.replace_name_and_version( self.tarball_name) else: self.tarball_name = os.path.basename(self.url) self.download_path = os.path.join(self.repo_dir, self.tarball_name)
def __init__(self): Source.__init__(self) if not self.url: raise InvalidRecipeError( self, _("'url' attribute is missing in the recipe")) self.url = self.expand_url_template(self.url) self.url = self.replace_name_and_version(self.url) if self.tarball_name is not None: self.tarball_name = \ self.replace_name_and_version(self.tarball_name) if self.tarball_dirname is not None: self.tarball_dirname = \ self.replace_name_and_version(self.tarball_dirname) self.download_dir = self.repo_dir BaseTarball.__init__(self)