mirror of
https://github.com/tuna/tunasync-scripts.git
synced 2025-12-25 16:32:47 +00:00
Merge pull request #191 from dramforever/nix-channels-new-tagline
nix-channels: Tolerate new release taglines
This commit is contained in:
commit
6672864095
|
|
@ -194,7 +194,11 @@ def clone_channels():
|
|||
|
||||
tagline = node('p').text()
|
||||
|
||||
tagline_res = re.match(r'^Released on (.+) from', tagline)
|
||||
# Examples:
|
||||
#
|
||||
# Released on yyyy-mm-dd hh:mm UTC from Git commit ...
|
||||
# Released on yyyy-mm-dd hh:mm from ...
|
||||
tagline_res = re.match(r'^Released on (.+?) (?:UTC )?from', tagline)
|
||||
|
||||
if tagline_res is None:
|
||||
logging.warning(f' - Invalid tagline: {tagline}')
|
||||
|
|
@ -385,6 +389,9 @@ 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)
|
||||
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')
|
||||
|
||||
if released_date >= time_threshold:
|
||||
|
|
|
|||
Loading…
Reference in New Issue