File tree 2 files changed +8
-4
lines changed
2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -2,3 +2,4 @@ packer_cache/
2
2
* .box
3
3
* .swp
4
4
output- *
5
+ .vscode
Original file line number Diff line number Diff line change 12
12
import os .path
13
13
14
14
API_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 ()
17
16
LEN_RELEASES = 2
18
17
CWD = '/srv/arch-boxes/arch-boxes'
19
18
ISO_PATH = '/srv/ftp/iso/latest/archlinux-' + NOW .strftime (
@@ -58,8 +57,12 @@ def determine_missing_release(release_providers):
58
57
59
58
60
59
def 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
63
66
64
67
65
68
def all_released (release_providers ):
You can’t perform that action at this time.
0 commit comments