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)
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))