flavor)
-def OldFlavorOutDir(options, flavor):
- """Given a flavor, returns old flavor directory (transitional)."""
- if isinstance(flavor, tuple):
- return os.path.join(options.toolchain_dir, flavor[0])
- else:
- return os.path.join(options.toolchain_dir, flavor)
-
-
def FlavorName(flavor):
"""Given a flavor, get a string name for it."""
if isinstance(flavor, tuple):
dst: destination directory for the toolchain.
hashes: expected hashes of the toolchain.
"""
+ if isinstance(flavor, tuple):
+ flavor_name = flavor[0]
+ else:
+ flavor_name = flavor
toolchain_dir = os.path.join(PARENT_DIR, 'toolchain')
if not os.path.exists(toolchain_dir):
untar_dir = tempfile.mkdtemp(
suffix=suffix, prefix=prefix, dir=toolchain_dir)
try:
+ if verbose:
+ tar_file = os.path.basename(filepath)
+ rel_dest = os.path.relpath(dst, toolchain_dir)
+ print '%s: Extracting "%s" -> "%s"...' % (flavor_name, tar_file, rel_dest)
+
for filepath in filepaths:
tar = cygtar.CygTar(filepath, 'r:*', verbose=verbose)
curdir = os.getcwd()
version = VersionSelect(versions, flavor)
urls = FlavorUrls(options, versions, flavor)
dst = FlavorOutDir(options, flavor)
- old_dst = OldFlavorOutDir(options, flavor)
hashes = FlavorHashes(versions, flavor)
flavor_name = FlavorName(flavor)
force = False
try:
- # While we are still transitioning to the new toolchain directory format,
- # keep on syncing to the old destination. Eventually we will remove this.
- SyncFlavor(flavor, urls, old_dst, hashes, script_time, force=force,
- keep=options.keep, verbose=options.verbose)
-
if SyncFlavor(flavor, urls, dst, hashes, script_time, force=force,
keep=options.keep, verbose=options.verbose):
print flavor_name + ': updated to version ' + version + '.'