aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnsuel Smith <ansuelsmth@gmail.com>2021-07-06 00:56:21 +0200
committerPaul Spooren <mail@aparcar.org>2021-09-22 19:51:44 -1000
commit4eb4c3c469a7b38266957d8a14d27e894e4da494 (patch)
tree91c44577265725e72bbc59e07d96d45e89ca3029
parentf48ced582dd33b6d0921f5851c1ea2cef2ff730c (diff)
downloadupstream-4eb4c3c469a7b38266957d8a14d27e894e4da494.tar.gz
upstream-4eb4c3c469a7b38266957d8a14d27e894e4da494.tar.bz2
upstream-4eb4c3c469a7b38266957d8a14d27e894e4da494.zip
scripts: add missing regex for dl_cleanup script
Regex xxx-YYYY-MM-DD-GIT_SHASUM was missing. Add the new regex to improve and better find outdated package. This also fix a bug where some bug were incorrectly detected as packagename-yyyy-mm-dd instead of packagename due to them be parsed by the wrong parser Example: openwrt-keyring-2021-02-20-49283916.tar.xz Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com> [added example in commit message] Signed-off-by: Paul Spooren <mail@aparcar.org>
-rwxr-xr-xscripts/dl_cleanup.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/scripts/dl_cleanup.py b/scripts/dl_cleanup.py
index 1acb049582..83269e68e5 100755
--- a/scripts/dl_cleanup.py
+++ b/scripts/dl_cleanup.py
@@ -62,6 +62,13 @@ def parseVer_r(match, filepath):
progversion = (int(match.group(2)) << 64)
return (progname, progversion)
+def parseVer_ymd_GIT_SHASUM(match, filepath):
+ progname = match.group(1)
+ progversion = (int(match.group(2)) << 64) |\
+ (int(match.group(3)) << 48) |\
+ (int(match.group(4)) << 32)
+ return (progname, progversion)
+
def parseVer_ymd(match, filepath):
progname = match.group(1)
progversion = (int(match.group(2)) << 64) |\
@@ -90,6 +97,7 @@ extensions = (
versionRegex = (
(re.compile(r"(.+)[-_](\d+)\.(\d+)\.(\d+)\.(\d+)"), parseVer_1234), # xxx-1.2.3.4
+ (re.compile(r"(.+)[-_](\d\d\d\d)-?(\d\d)-?(\d\d)-"), parseVer_ymd_GIT_SHASUM), # xxx-YYYY-MM-DD-GIT_SHASUM
(re.compile(r"(.+)[-_](\d\d\d\d)-?(\d\d)-?(\d\d)"), parseVer_ymd), # xxx-YYYY-MM-DD
(re.compile(r"(.+)[-_]([0-9a-fA-F]{40,40})"), parseVer_GIT), # xxx-GIT_SHASUM
(re.compile(r"(.+)[-_](\d+)\.(\d+)\.(\d+)(\w?)"), parseVer_123), # xxx-1.2.3a