summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2019-07-31 09:17:10 +0200
committerErich Eckner <git@eckner.net>2019-07-31 09:17:10 +0200
commit46c9623f2cf26866de3d591eef3542dba1581399 (patch)
tree84dbc5938f1c363efe588cf81ff75e1ac6529894
parent8ecf00e292ae5f7f1cb91e4ae4472462788a8bba (diff)
downloadarchlinuxewe-46c9623f2cf26866de3d591eef3542dba1581399.tar.xz
checkVersions: simplify perl logic
-rwxr-xr-xcheckVersions34
1 files changed, 14 insertions, 20 deletions
diff --git a/checkVersions b/checkVersions
index 049f4e794..422edb985 100755
--- a/checkVersions
+++ b/checkVersions
@@ -64,7 +64,19 @@ curl_it() {
}
latest_version() {
- sort -V \
+ if [ "x$1" = 'xperl' ]; then
+ local versions
+ versions=$(cat)
+ printf '%s\n' "${versions}" \
+ | if printf '%s\n' "${versions}" \
+ | grep -q '\..*\.'; then
+ sort -V
+ else
+ sort -g
+ fi
+ else
+ sort -V
+ fi \
| tail -n1
}
@@ -597,30 +609,12 @@ then
sed "s|^v\?[0-9.]*||" | \
sed 's|\.|\\\.|'
)
- if [ "${pkgname}" = 'perl-chi' ] || \
- [ "${pkgname}" = 'perl-perl-metrics-simple' ]
- then
- pre='s|\(\...\)$|\10|'
- post='s|\(\...\)0$|\1|'
- elif [ "${pkgname}" = 'perl-opengl' ] || \
- [ "${pkgname}" = 'perl-array-diff' ] || \
- [ "${pkgname}" = 'perl-module-cpants-analyse' ] || \
- [ "${pkgname}" = 'perl-data-clean' ]
- then
- pre='s|\(\...\)\(.\)|\1.\2|'
- post='s|\(\...\)\.\(.\)|\1\2|'
- else
- pre=''
- post=''
- fi
remVer=$( \
curl_it "${quVer}" | \
tr '"<>' '\n' | \
grep "^${quNam}-v\?[0-9.-]*\.${quEnd}\$" | \
sed "s|^${quNam}-v\?\([0-9.-]*\)\.${quEnd}\$|\1|" | \
- sed "${pre}" | \
- latest_version | \
- sed "${post}"
+ latest_version 'perl'
)
elif echo "${src}" | \
grep -q "ftp://"