Beispiel #1
0
    print("sources", sources)
    print("libraries", libraries)
    print("debugFlag", debugFlag)
    print("sourceURL", sourceURL)
    print("noCompile", noCompile)
    print("useCMake", useCMake)
except:
    sys.exit(EC_MissingArg)

# save current dir
currentDir = record_exec_directory()

print(time.ctime())

url = '%s/cache/%s' % (sourceURL, sources)
tmpStat, tmpOut = get_file_via_http(full_url=url)
if not tmpStat:
    print("ERROR : " + tmpOut)
    sys.exit(EC_NoTarball)

# goto work dir
workDir = currentDir + '/workDir'
print(commands_get_status_output('rm -rf %s' % workDir)[-1])
os.makedirs(workDir)
print("--- Goto workDir %s ---\n" % workDir)
os.chdir(workDir)

# cmake
if useCMake:
    # go back to current dir
    os.chdir(currentDir)
Beispiel #2
0
    elif libraries.startswith('/'):
        tmpStat, tmpOut = commands_get_status_output('tar xvfzm %s' %
                                                     libraries)
        print(tmpOut)
    else:
        tmpStat, tmpOut = commands_get_status_output('tar xvfzm %s/%s' %
                                                     (currentDir, libraries))
        print(tmpOut)
    if tmpStat != 0:
        print("ERROR : {0} is corrupted".format(libraries))
        sys.exit(EC_Tarball)

    # expand jobOs if needed
    if archiveJobO != "" and libraries == '':
        url = '%s/cache/%s' % (sourceURL, archiveJobO)
        tmpStat, tmpOut = get_file_via_http(full_url=url)
        if not tmpStat:
            print("ERROR : " + tmpOut)
            sys.exit(EC_WGET)
        tmpStat, tmpOut = commands_get_status_output('tar xvfzm %s' %
                                                     archiveJobO)
        print(tmpOut)
        if tmpStat != 0:
            print("ERROR : {0} is corrupted".format(archiveJobO))
            sys.exit(EC_Tarball)

# make run dir just in case
commands_get_status_output('mkdir %s' % runDir)
# go to run dir
os.chdir(runDir)