about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRicho Healey <richo@psych0tik.net>2015-01-27 00:09:13 -0800
committerRicho Healey <richo@psych0tik.net>2015-01-27 01:09:38 -0800
commitf230683b1a01500af3f74e3e357441c67b77c4b6 (patch)
tree055655cb0981723de60cf8391cbded736db32984
parent6af36031e2f286e6cca37f14ede514fff46b6e6f (diff)
downloadrust-f230683b1a01500af3f74e3e357441c67b77c4b6.tar.gz
rust-f230683b1a01500af3f74e3e357441c67b77c4b6.zip
Fix PEP8 in get-snapshot
-rwxr-xr-xsrc/etc/get-snapshot.py68
1 files changed, 34 insertions, 34 deletions
diff --git a/src/etc/get-snapshot.py b/src/etc/get-snapshot.py
index 886a84bd819..442c50ed773 100755
--- a/src/etc/get-snapshot.py
+++ b/src/etc/get-snapshot.py
@@ -14,32 +14,32 @@ import os, tarfile, re, shutil, sys
 from snapshot import *
 
 def unpack_snapshot(triple, dl_path):
-  print("opening snapshot " + dl_path)
-  tar = tarfile.open(dl_path)
-  kernel = get_kernel(triple)
+    print("opening snapshot " + dl_path)
+    tar = tarfile.open(dl_path)
+    kernel = get_kernel(triple)
 
-  stagep = os.path.join(triple, "stage0")
+    stagep = os.path.join(triple, "stage0")
 
-  # Remove files from prior unpackings, since snapshot rustc may not
-  # be able to disambiguate between multiple candidate libraries.
-  # (Leave dirs in place since extracting step still needs them.)
-  for root, _, files in os.walk(stagep):
-    for f in files:
-      print("removing " + os.path.join(root, f))
-      os.unlink(os.path.join(root, f))
+    # Remove files from prior unpackings, since snapshot rustc may not
+    # be able to disambiguate between multiple candidate libraries.
+    # (Leave dirs in place since extracting step still needs them.)
+    for root, _, files in os.walk(stagep):
+        for f in files:
+            print("removing " + os.path.join(root, f))
+            os.unlink(os.path.join(root, f))
 
-  for p in tar.getnames():
-    name = p.replace("rust-stage0/", "", 1);
+    for p in tar.getnames():
+        name = p.replace("rust-stage0/", "", 1);
 
-    fp = os.path.join(stagep, name)
-    print("extracting " + p)
-    tar.extract(p, download_unpack_base)
-    tp = os.path.join(download_unpack_base, p)
-    if os.path.isdir(tp) and os.path.exists(fp):
-        continue
-    shutil.move(tp, fp)
-  tar.close()
-  shutil.rmtree(download_unpack_base)
+        fp = os.path.join(stagep, name)
+        print("extracting " + p)
+        tar.extract(p, download_unpack_base)
+        tp = os.path.join(download_unpack_base, p)
+        if os.path.isdir(tp) and os.path.exists(fp):
+                continue
+        shutil.move(tp, fp)
+    tar.close()
+    shutil.rmtree(download_unpack_base)
 
 
 # Main
@@ -50,21 +50,21 @@ def unpack_snapshot(triple, dl_path):
 
 triple = sys.argv[1]
 if len(sys.argv) == 3:
-  dl_path = sys.argv[2]
+    dl_path = sys.argv[2]
 else:
-  snap = determine_curr_snapshot(triple)
-  dl = os.path.join(download_dir_base, snap)
-  url = download_url_base + "/" + snap
-  print("determined most recent snapshot: " + snap)
+    snap = determine_curr_snapshot(triple)
+    dl = os.path.join(download_dir_base, snap)
+    url = download_url_base + "/" + snap
+    print("determined most recent snapshot: " + snap)
 
-  if (not os.path.exists(dl)):
-    get_url_to_file(url, dl)
+    if (not os.path.exists(dl)):
+        get_url_to_file(url, dl)
 
-  if (snap_filename_hash_part(snap) == hash_file(dl)):
-    print("got download with ok hash")
-  else:
-    raise Exception("bad hash on download")
+    if (snap_filename_hash_part(snap) == hash_file(dl)):
+        print("got download with ok hash")
+    else:
+        raise Exception("bad hash on download")
 
-  dl_path = os.path.join(download_dir_base, snap)
+    dl_path = os.path.join(download_dir_base, snap)
 
 unpack_snapshot(triple, dl_path)