summaryrefslogtreecommitdiff
path: root/cpan2cruxPorts/p5-sys-info-driver-linux
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2020-04-19 00:47:31 +0200
committerErich Eckner <git@eckner.net>2020-04-19 00:47:31 +0200
commitbe5888d1ace710df3147ebd9bf81df29f5d6bd01 (patch)
treeddf0cd66081d7a8a1268ee8f684e01543604b768 /cpan2cruxPorts/p5-sys-info-driver-linux
parent5ed84b5f74bd2e4b6d49c9a9341d8ad8e43beb9a (diff)
downloadcrux-ports-be5888d1ace710df3147ebd9bf81df29f5d6bd01.tar.xz
p5-*/lastVersion.sh: simplify
Diffstat (limited to 'cpan2cruxPorts/p5-sys-info-driver-linux')
-rwxr-xr-xcpan2cruxPorts/p5-sys-info-driver-linux/lastVersion.sh17
1 files changed, 15 insertions, 2 deletions
diff --git a/cpan2cruxPorts/p5-sys-info-driver-linux/lastVersion.sh b/cpan2cruxPorts/p5-sys-info-driver-linux/lastVersion.sh
index 9d5e0e7..34943e7 100755
--- a/cpan2cruxPorts/p5-sys-info-driver-linux/lastVersion.sh
+++ b/cpan2cruxPorts/p5-sys-info-driver-linux/lastVersion.sh
@@ -1,9 +1,22 @@
#!/bin/bash
-wget --output-document=- "https://cpan.metacpan.org/authors/id/B/BU/BURAK/" 2> /dev/null | \
+url=$(
+ sed -n '
+ /^source=([^)]*$/,/)/ p
+ /^source=(.*)$/ p
+ ' "$(dirname "$0")/Pkgfile" \
+ | sed -n '
+ s/^.*(//
+ s/).*$//
+ \@^https://cpan\.metacpan\.org/@p
+ '
+)
+name="${url##*/}"
+
+wget --output-document=- "${url%/*}/" 2>/dev/null | \
tr '"' '\n' | \
sed '
- s/^Sys-Info-\([0-9.]\+\)\.tar\.gz$/\1/
+ s/^'"${name%\$version.*}"'\([0-9.]\+\)\.tar\.gz$/\1/
t
d
' | \