diff options
author | Lars Wirzenius <liw@liw.fi> | 2021-07-28 17:23:01 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2021-07-28 17:24:11 +0300 |
commit | 8e40716e3569491cf39284a714d1b3cda57059c3 (patch) | |
tree | 39a7b7e3bb2902054dad3d06bf288b994ba2eaaa /list_new_release_tags | |
parent | cd791b3820754c241735e00cedd6dc4a6e968765 (diff) | |
download | ick-helpers-master.tar.gz |
any prefix of letters and digits and dashes works
Sponsored-by: author
Diffstat (limited to 'list_new_release_tags')
-rwxr-xr-x | list_new_release_tags | 19 |
1 files 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) |