Merge pull request #192 from dramforever/nix-channels-new-tagline-take2
Some checks failed
docker-images / multi (., tunasync-scripts, ubuntu-24.04-arm) (push) Has been cancelled
docker-images / multi (., tunasync-scripts, ubuntu-latest) (push) Has been cancelled
docker-images / multi (ftpsync, ubuntu-24.04-arm) (push) Has been cancelled
docker-images / multi (ftpsync, ubuntu-latest) (push) Has been cancelled
docker-images / multi (nix-channels, ubuntu-24.04-arm) (push) Has been cancelled
docker-images / multi (nix-channels, ubuntu-latest) (push) Has been cancelled
docker-images / multi (rubygems-mirror, ubuntu-24.04-arm) (push) Has been cancelled
docker-images / multi (rubygems-mirror, ubuntu-latest) (push) Has been cancelled
docker-images / multi (rustup-mirror, ubuntu-24.04-arm) (push) Has been cancelled
docker-images / multi (rustup-mirror, ubuntu-latest) (push) Has been cancelled
docker-images / multi (tsumugu, ubuntu-24.04-arm) (push) Has been cancelled
docker-images / multi (tsumugu, ubuntu-latest) (push) Has been cancelled
docker-images / merge (push) Has been cancelled

nix-channels: Tolerate new release taglines, take 2
This commit is contained in:
Shengqi Chen 2025-11-27 17:48:07 +08:00 committed by GitHub
commit f382c991da
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -196,8 +196,8 @@ def clone_channels():
# Examples:
#
# Released on yyyy-mm-dd hh:mm UTC from Git commit ...
# Released on yyyy-mm-dd hh:mm from ...
# Released on yyyy-mm-dd hh:mm:ss UTC from Git commit ...
# Released on yyyy-mm-dd hh:mm:ss from ...
tagline_res = re.match(r'^Released on (.+?) (?:UTC )?from', tagline)
if tagline_res is None:
@ -389,7 +389,7 @@ def garbage_collect():
channel = release.name.split('@')[0]
date_str = (release / '.released-time').read_text()
date_match = re.match(r'\d+-\d+-\d+ \d+:\d+', date_str)
date_match = re.match(r'\d+-\d+-\d+ \d+:\d+:\d+', date_str)
assert date_match is not None, f'Release {release!r} has invalid time {date_str!r}'
date_str = date_match[0]
released_date = datetime.strptime(date_str, '%Y-%m-%d %H:%M:%S')