From 8e40716e3569491cf39284a714d1b3cda57059c3 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Wed, 28 Jul 2021 17:23:01 +0300 Subject: fix: list_new_release_tags to not require v prefix in tag name any prefix of letters and digits and dashes works Sponsored-by: author --- list_new_release_tags | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/list_new_release_tags b/list_new_release_tags index 90994ac..25b6ee2 100755 --- a/list_new_release_tags +++ b/list_new_release_tags @@ -14,7 +14,7 @@ import subprocess import sys -TAG_PATTERN = re.compile(r"^v(\d+)?.(\d+)\.(\d+)$") +TAG_PATTERN = re.compile(r"^[a-zA-Z0-9-]*(\d+)?.(\d+)\.(\d+)$") def release_tags(): @@ -41,20 +41,33 @@ def built_tags(filename): def save_built_tags(filename, tags): + msg(f"saving tags to {filename}: {built}") return open(filename, "w").write("".join(f"{tag}\n" for tag in tags)) +def msg(s): + sys.stderr.write(f"{s}\n") + sys.stderr.flush() + + tags_filename = sys.argv[1] tags = sorted_tags(release_tags()) +msg(f"found tags: {tags}") if os.path.exists(tags_filename): built = built_tags(tags_filename) - for tag in tags: - if tag not in built: + msg(f"previously built tags: {built}") + new = [tag for tag in tags if tag not in built] + if new: + for tag in new: + msg(f"build tag {tag}") print(tag) built.append(tag) + else: + msg("no new tags, not building anything") else: + msg("no list of old tags, not building anything") built = tags save_built_tags(tags_filename, built) -- cgit v1.2.1