File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed
Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -2,3 +2,4 @@ packer_cache/
22* .box
33* .swp
44output- *
5+ .vscode
Original file line number Diff line number Diff line change 1212import os .path
1313
1414API_URL = 'https://app.vagrantup.com/api/v1/box/archlinux/archlinux'
15- NOW = datetime .datetime .now ()
16- THIS_MONTH = int (NOW .strftime ("%m" ))
15+ NOW = datetime .date .today ()
1716LEN_RELEASES = 2
1817CWD = '/srv/arch-boxes/arch-boxes'
1918ISO_PATH = '/srv/ftp/iso/latest/archlinux-' + NOW .strftime (
@@ -58,8 +57,12 @@ def determine_missing_release(release_providers):
5857
5958
6059def is_latest (release_version ):
61- release_month = int (release_version .split ("." )[1 ])
62- return THIS_MONTH <= release_month
60+ # we need to use .date() here, otherwise the compare is going to fail
61+ release = datetime .datetime .strptime (release_version , "%Y.%m.%d" ).date ()
62+ # set the day to 1, because we only want to check for month and year
63+ release = release .replace (day = 1 )
64+ current_release = NOW .replace (day = 1 )
65+ return current_release <= release
6366
6467
6568def all_released (release_providers ):
You can’t perform that action at this time.
0 commit comments