From 0bc601a389911aa171b925c43ce1d37c4ac6d1a3 Mon Sep 17 00:00:00 2001 From: dramforever Date: Thu, 27 Nov 2025 17:41:09 +0800 Subject: [PATCH] nix-channels: Tolerate new release taglines, take 2 Fix typo, add back seconds component to the expected release time format. --- nix-channels.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nix-channels.py b/nix-channels.py index 4ce3522..b5d4e61 100755 --- a/nix-channels.py +++ b/nix-channels.py @@ -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')