Esempio n. 1
0
 def __init__(self, arg, options):
     if is_url(arg):
         name = arg
     elif is_archive_file(arg):
         name = path_to_fileurl(arg)
     elif os.path.isdir(arg):
         name = path_to_fileurl(arg)
     else:
         name = arg
     
     if is_url(name):
         self.download_url = name
         filename = Link(self.download_url).filename
         pkg = Package(filename)
     else:
         pkg = Package(name)
         self.download_url = get_python_version_url(pkg.version)
         if not self.download_url:
             logger.info("Unknown python version: `%s`" % pkg.name)
             sys.exit(1)
         filename = Link(self.download_url).filename
     self.pkg = pkg
     self.install_dir = "%s/%s" % (PATH_PYTHONS, pkg.name)
     self.build_dir = "%s/%s" % (PATH_BUILD, pkg.name)
     self.download_file = "%s/%s" % (PATH_DISTS, filename)
     if is_file(self.download_url):
         path = fileurl_to_path(self.download_url)
         self.content_type = mimetypes.guess_type(path)[0]
     else:
         headerinfo = get_headerinfo_from_url(self.download_url)
         self.content_type = headerinfo['content-type']
     self.options = options
     self.logfile = "%s/build.log" % PATH_LOG
    def __init__(self, arg, options):
        if is_archive_file(arg):
            name = path_to_fileurl(arg)
        elif os.path.isdir(arg):
            name = path_to_fileurl(arg)
        else:
            name = arg
        
        if is_url(name):
            self.download_url = name
            filename = Link(self.download_url).filename
            pkg = Package(filename, options.alias)
        else:
            pkg = Package(name, options.alias)
            self.download_url = get_python_version_url(pkg.version)
            if not self.download_url:
                logger.error("Unknown python version: `%s`" % pkg.name)
                raise UnknownVersionException
            filename = Link(self.download_url).filename
        self.pkg = pkg
        self.install_dir = os.path.join(PATH_PYTHONS, pkg.name)
        self.build_dir = os.path.join(PATH_BUILD, pkg.name)
        self.download_file = os.path.join(PATH_DISTS, filename)

        self.options = options
        self.logfile = os.path.join(PATH_LOG, 'build.log')
        self.patches = []

        if Version(self.pkg.version) >= '3.1':
            self.configure_options = ['--with-computed-gotos']
        else:
            self.configure_options = []
Esempio n. 3
0
    def __init__(self, arg, options):
        if is_archive_file(arg):
            name = path_to_fileurl(arg)
        elif os.path.isdir(arg):
            name = path_to_fileurl(arg)
        else:
            name = arg

        if is_url(name):
            self.download_url = name
            filename = Link(self.download_url).filename
            pkg = Package(filename, options.alias)
        else:
            pkg = Package(name, options.alias)
            self.download_url = get_python_version_url(pkg.version)
            if not self.download_url:
                logger.error("Unknown python version: `%s`" % pkg.name)
                raise UnknownVersionException
            filename = Link(self.download_url).filename
        self.pkg = pkg
        self.install_dir = os.path.join(PATH_PYTHONS, pkg.name)
        self.build_dir = os.path.join(PATH_BUILD, pkg.name)
        self.download_file = os.path.join(PATH_DISTS, filename)

        self.options = options
        self.logfile = os.path.join(PATH_LOG, 'build.log')
        self.patches = []

        if Version(self.pkg.version) >= '3.1':
            self.configure_options = ['--with-computed-gotos']
        else:
            self.configure_options = []
Esempio n. 4
0
 def __init__(self, arg, options):
     if is_url(arg):
         self.download_url = arg
         filename = Link(self.download_url).filename
         pkg = Package(splitext(filename)[0])
     else:
         pkg = Package(arg)
         self.download_url = get_python_version_url(pkg.version)
         if not self.download_url:
             logger.info("Unknown python version: `%s`" % pkg.name)
             sys.exit(1)
         filename = Link(self.download_url).filename
     self.pkg = pkg
     self.install_dir = "%s/%s" % (PATH_PYTHONS, pkg.name)
     self.build_dir = "%s/%s" % (PATH_BUILD, pkg.name)
     self.download_file = "%s/%s" % (PATH_DISTS, filename)
     resp = get_response_from_url(self.download_url)
     self.content_type = resp.info()['content-type']
     self.options = options
     self.logfile = "%s/build.log" % PATH_LOG