mach clean-nightlies: don’t remove everything versioned by date

(Dates contain `-`.)
This commit is contained in:
Simon Sapin 2017-10-11 15:41:48 +02:00
parent 3bf9d6ee9e
commit 675ae92cb5

View file

@ -317,11 +317,9 @@ class MachCommands(CommandBase):
full_path = path.join(base, name) full_path = path.join(base, name)
if name.startswith("rust-"): if name.startswith("rust-"):
name = name[len("rust-"):] name = name[len("rust-"):]
# We append `-alt` if LLVM assertions aren't enabled, if name.endswith("-alt"):
# so use just the commit hash itself. name = name[:-len("-alt")]
# This may occasionally leave an extra nightly behind if name not in to_keep:
# but won't remove too many nightlies.
if name.partition('-')[0] not in to_keep:
removing_anything = True removing_anything = True
if force: if force:
print("Removing {}".format(full_path)) print("Removing {}".format(full_path))