def unpack(src_path, tempdir): if src_path.endswith((".tar.gz", ".tar.bz2", ".tgz", ".tar.xz", ".tar")): tar_xf(src_path, tempdir) elif src_path.endswith(".zip"): unzip(src_path, tempdir) else: raise Exception("not a valid source")
def unpack(src_path, tempdir): if src_path.endswith(('.tar.gz', '.tar.bz2', '.tgz', '.tar.xz', '.tar')): tar_xf(src_path, tempdir) elif src_path.endswith('.zip'): unzip(src_path, tempdir) else: raise Exception("not a valid source")
def unpack(meta): src_path = download_to_cache(meta) os.makedirs(WORK_DIR) if src_path.endswith(('.tar.gz', '.tar.bz2', '.tgz', '.tar.xz', '.tar')): tar_xf(src_path, WORK_DIR) elif src_path.endswith('.zip'): unzip(src_path, WORK_DIR) else: raise Exception("not a valid source")
def unpack(meta): src_path = download_to_cache(meta) os.makedirs(WORK_DIR) if src_path.endswith((".tar.gz", ".tar.bz2", ".tgz", ".tar.xz", ".tar")): tar_xf(src_path, WORK_DIR) elif src_path.endswith(".zip"): unzip(src_path, WORK_DIR) else: # In this case, the build script will need to deal with unpacking the source print("Warning: Unrecognized source format. Source file will be copied to the SRC_DIR") copy2(src_path, WORK_DIR)