예제 #1
0
    def download(self):
        '''Download missing or update pre-existing project files.  As
        a side effect the program will be in the projects directory
        that contains the downloaded project'''
        log.info(self.name +' download')
        import fs, ConfigParser
        projdir = fs.projects()
        fs.goto(projdir, True)
        from get import get

        try:
            tag = self.tag()
        except ConfigParser.NoOptionError:
            tag = None

        #print 'url="%s" name="%s" tag="%s"'%(self.url(), self.name, tag)
        get(self.url(), self.name, True, tag=tag)
        tarfile = os.path.basename(self.url())
        if '.tgz' in tarfile or '.tar' in tarfile:
            untar(tarfile)
            dot = tarfile.find('.')
            dirname = tarfile[:dot]
            import shutil
            shutil.move(dirname, self.name)
            pass        

        fs.goback
        return
예제 #2
0
def extractInstallScripts( installDir ):
    
    cwd = os.getcwd()
    os.chdir(installDir)

    untar("install-scripts.tar.gz", path=installDir)

    return os.path.isdir( os.path.join( installDir,"install-scripts" ))
예제 #3
0
def download(untar_dir):
    valgrind_release_url = VALGRIND_URL_FORMAT.replace('VER', VALGRIND_VER)
    util.download(valgrind_release_url)

    valgrind_tarball = 'valgrind-VER.tar.bz2'.replace('VER', VALGRIND_VER)
    util.untar(valgrind_tarball)

    shutil.move('valgrind-VER'.replace('VER', VALGRIND_VER), untar_dir)
예제 #4
0
파일: setup.py 프로젝트: dalehamel/getbirch
	def extract_binary(binary):
		if (os.path.lexists(ARGS.install_dir +"/"+binary+ ".tar.gz")):
			if (windows):
				cygwin_untar(ARGS.install_dir +"/"+binary+ ".tar.gz",binary+ ".tar.gz")

			else:
				untar(binary+ ".tar.gz")	
		else:
			print_console( "The required file "+binary+ ".tar.gz was not found")
예제 #5
0
파일: cmt.py 프로젝트: brettviren/garpi
def unpack():
    'Unpack the previously downloaded tarfile'
    log.info('unpacking cmt source')
    target = srcdir()
    if os.path.exists(target):
        log.info('CMT appears to already be unpacked in %s'%(target))
        return target
    fs.goto(fs.external(),True)
    untar(tgz())
    return target
예제 #6
0
파일: git.py 프로젝트: brettviren/garpi
def unpack():
    "Unpack the previously downloaded tarfile"
    log.info("unpacking git source")
    target = srcdir()
    if os.path.exists(target):
        log.info("git appears to already be unpacked in %s" % (target))
        return target
    fs.goto(fs.external(), True)
    untar(tgz())
    return target
def prepare_gold(version):
    curdir = os.getcwd()
    binutils_tarball = binutils_tarball_format.replace('VERSION', version)
    binutils_url = binutils_url_format.replace('TARBALL', binutils_tarball)
    util.download(binutils_url)
    util.untar(binutils_tarball)
    os.chdir('binutils-VERSION'.replace('VERSION', version))
    util.configure(
        '--prefix=%s --enable-gold --enable-plugins --disable-werror' % curdir)
    util.make('-j4')
    util.make('-j4 all-gold')
    util.make('install')
    os.chdir(curdir)
예제 #8
0
def detect_platform(temp_dir):
	fetcher = Fetcher()
	os.chdir(temp_dir)
	path= fetcher.getResource("resources/probes.tar.gz", temp_dir+"/probes.tar.gz")
	print_console(PROGRAM+"Extracted probes to:"+path)
	untar(path,temp_dir)

	detector = PlatformDetector(temp_dir+"/probes/")
	platform=detector.detect_platform()
	print_console(PROGRAM+"Detected platform as: "+platform)
	ARGS.platform=platform
	
	return platform	
예제 #9
0
파일: setup.py 프로젝트: dalehamel/getbirch
def extract_tarballs(windows=False):
	def extract_binary(binary):
		if (os.path.lexists(ARGS.install_dir +"/"+binary+ ".tar.gz")):
			if (windows):
				cygwin_untar(ARGS.install_dir +"/"+binary+ ".tar.gz",binary+ ".tar.gz")

			else:
				untar(binary+ ".tar.gz")	
		else:
			print_console( "The required file "+binary+ ".tar.gz was not found")
	
	
	
	print_console( "Decompressing framework...")
	os.chdir(ARGS.install_dir)
	
	if (os.path.lexists(ARGS.install_dir + "/framework.tar.gz")):

		if (windows and not ARGS.isGitDev):
			cygwin_untar(ARGS.install_dir + "/framework.tar.gz","framework.tar.gz")
		elif(not ARGS.isGitDev):
			untar("framework.tar.gz")
		elif (ARGS.isGitDev):
			if (windows):
				cygwin_untar(ARGS.install_dir + "/framework.tar.gz","framework.tar.gz",noroot=True)
			else:
				excludelist=list()
				if (ARGS.is_update):
					exclude.append("local")
				untar("framework.tar.gz",path=".",noroot=True,exclude=excludelist)
			#print_console("Restoring permission/time data.")
			#restoreMetaData(ARGS.install_dir)
			#print_console("Metadata restored.")
	else:
		print_console( "The required file framework.tar.gz was not found")
		return

	print_console( "Decompressing binaries...")
	
	if (not ARGS.multi_bins):
		extract_binary(ARGS.platform)
	else:
		
		for each in ARGS.platforms:
			extract_binary(each)
    def __init__(self):
        url = \
            'http://groups.inf.ed.ac.uk/calvin/ethz_pascal_stickmen/'\
            'downloads/ETHZ_PASCAL_Stickmen_v1.11.tgz'
        data_filename = os.path.basename(url)
        self.data_filepath = os.path.join(dataset_root,
                                          data_filename)
        data_directory = os.path.join(dataset_root,
                                           'ETHZ_PASCAL_Stickmen_v1.11')
        self.loaded = False

        if not(os.path.exists(self.data_filepath)):
            download(url, self.data_filepath)

        if not(os.path.exists(data_directory)):
            untar(self.data_filepath, dataset_root)

            shutil.move(os.path.join(data_directory, 'images'),
                        os.path.join(dataset_root, 'images'))

            shutil.move(os.path.join(data_directory, 'data'),
                        os.path.join(dataset_root, 'annotations'))