nvchecker: add parallel
This commit is contained in:
parent
18239538cc
commit
a859deb90a
2 changed files with 37 additions and 0 deletions
|
@ -1124,6 +1124,10 @@ cmd = "./.repo/pkgver/sendmail.sh"
|
|||
source = "cmd"
|
||||
cmd = "./.repo/pkgver/time.sh"
|
||||
|
||||
[parallel]
|
||||
source = "cmd"
|
||||
cmd = "./.repo/pkgver/parallel.sh"
|
||||
|
||||
# git
|
||||
#[plasma-pass-git]
|
||||
#source = "git"
|
||||
|
|
33
.repo/pkgver/parallel.sh
Executable file
33
.repo/pkgver/parallel.sh
Executable file
|
@ -0,0 +1,33 @@
|
|||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
# check dependencies
|
||||
count=0
|
||||
for dependency in curl tr cut grep sed sort tail; do
|
||||
if [ ! -x "$(command -v $dependency)" ]; then
|
||||
echo "$dependency missing"
|
||||
count=$((count+1))
|
||||
fi
|
||||
done
|
||||
|
||||
# exit script if any dependencies missing
|
||||
if [ $count -ne 0 ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# upstream URL
|
||||
UPSTREAM_URL="ftp://ftp.gnu.org/gnu/parallel/"
|
||||
|
||||
# options to pass to cURL, including custom user agent
|
||||
USER_AGENT="parallel-version-checker/1.0 george@rawlinson.net.nz"
|
||||
CURL_OPTS=(--ftp-pasv --silent --user-agent "$USER_AGENT")
|
||||
|
||||
curl "${CURL_OPTS[@]}" "$UPSTREAM_URL" | \
|
||||
tr -s ' ' | \
|
||||
cut -d ' ' -f 9 | \
|
||||
grep -E "parallel-[[:digit:]]+\.tar\.bz2\.sig$" | \
|
||||
sed -e 's/^parallel-//' -e 's/\.tar\.bz2\.sig$//' | \
|
||||
sort -n | \
|
||||
tail -n 1
|
||||
|
||||
exit 0
|
Loading…
Reference in a new issue