From 3bf9d6ee9eed7c3aa51dcec1506d2b714a7253ef Mon Sep 17 00:00:00 2001 From: Simon Sapin Date: Wed, 11 Oct 2017 15:36:52 +0200 Subject: [PATCH 1/2] mach clean-nightlies: fix removing cargo versioned by rust commit --- python/servo/bootstrap_commands.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/servo/bootstrap_commands.py b/python/servo/bootstrap_commands.py index edaad4f6dbb..593fd6cb634 100644 --- a/python/servo/bootstrap_commands.py +++ b/python/servo/bootstrap_commands.py @@ -314,6 +314,7 @@ class MachCommands(CommandBase): if not path.isdir(base): continue for name in os.listdir(base): + full_path = path.join(base, name) if name.startswith("rust-"): name = name[len("rust-"):] # We append `-alt` if LLVM assertions aren't enabled, @@ -322,7 +323,6 @@ class MachCommands(CommandBase): # but won't remove too many nightlies. if name.partition('-')[0] not in to_keep: removing_anything = True - full_path = path.join(base, name) if force: print("Removing {}".format(full_path)) try: From 675ae92cb5cddf808e9bc563d417e036bf335637 Mon Sep 17 00:00:00 2001 From: Simon Sapin Date: Wed, 11 Oct 2017 15:41:48 +0200 Subject: [PATCH 2/2] =?UTF-8?q?mach=20clean-nightlies:=20don=E2=80=99t=20r?= =?UTF-8?q?emove=20everything=20versioned=20by=20date?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (Dates contain `-`.) --- python/servo/bootstrap_commands.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/python/servo/bootstrap_commands.py b/python/servo/bootstrap_commands.py index 593fd6cb634..5d09fadb806 100644 --- a/python/servo/bootstrap_commands.py +++ b/python/servo/bootstrap_commands.py @@ -317,11 +317,9 @@ class MachCommands(CommandBase): full_path = path.join(base, name) if name.startswith("rust-"): name = name[len("rust-"):] - # We append `-alt` if LLVM assertions aren't enabled, - # so use just the commit hash itself. - # This may occasionally leave an extra nightly behind - # but won't remove too many nightlies. - if name.partition('-')[0] not in to_keep: + if name.endswith("-alt"): + name = name[:-len("-alt")] + if name not in to_keep: removing_anything = True if force: print("Removing {}".format(full_path))