nvchecker: update scripts for oil & html-xml-utils
<3 to Felix Yan https://lists.archlinux.org/pipermail/arch-dev-public/2022-February/030709.html
This commit is contained in:
parent
200a01fc32
commit
dcf728d215
3 changed files with 9 additions and 70 deletions
|
@ -1475,8 +1475,15 @@ pypi = "pytest-check"
|
|||
#cmd = './.repo/pkgver/firefox-nightly-en-gb.sh'
|
||||
|
||||
[oil]
|
||||
source = "cmd"
|
||||
cmd = "./.repo/pkgver/oil.sh"
|
||||
source = "htmlparser"
|
||||
url = "https://www.oilshell.org/release/latest/"
|
||||
xpath = "//h1/text()"
|
||||
prefix = "Oil "
|
||||
|
||||
[html-xml-utils]
|
||||
source = "regex"
|
||||
url = "https://www.w3.org/Tools/HTML-XML-utils/"
|
||||
regex = "html-xml-utils-(.*?).tar.gz"
|
||||
|
||||
[enigma]
|
||||
source = "cmd"
|
||||
|
@ -1486,10 +1493,6 @@ cmd = "./.repo/pkgver/enigma.sh"
|
|||
source = "cmd"
|
||||
cmd = "./.repo/pkgver/samhain.sh"
|
||||
|
||||
[html-xml-utils]
|
||||
source = "cmd"
|
||||
cmd = "./.repo/pkgver/html-xml-utils.sh"
|
||||
|
||||
["sendmail/libmilter"]
|
||||
source = "cmd"
|
||||
cmd = "./.repo/pkgver/sendmail.sh"
|
||||
|
|
|
@ -1,33 +0,0 @@
|
|||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
# check dependencies
|
||||
count=0
|
||||
for dependency in hxnormalize hxselect 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="https://www.w3.org/Tools/HTML-XML-utils/"
|
||||
|
||||
# options to pass to cURL, including custom user agent
|
||||
USER_AGENT="hxu-version-checker/1.0 george@rawlinson.net.nz"
|
||||
CURL_OPTS=(--silent --user-agent "$USER_AGENT")
|
||||
|
||||
curl "${CURL_OPTS[@]}" "$UPSTREAM_URL" | \
|
||||
hxnormalize -x | \
|
||||
hxselect -c 'a' -s '\n' | \
|
||||
grep "html-xml-utils" | \
|
||||
sed -e "s/html-xml-utils-//g" -e "s/.tar.gz//g" | \
|
||||
sort -n | \
|
||||
tail -n 1
|
||||
|
||||
exit 0
|
|
@ -1,31 +0,0 @@
|
|||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
# check dependencies
|
||||
count=0
|
||||
for dependency in curl hxnormalize hxselect grep sed; 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="https://www.oilshell.org/release/latest/"
|
||||
|
||||
|
||||
# options to pass to cURL, including custom user agent
|
||||
USER_AGENT="oil-version-checker/1.0 george@rawlinson.net.nz"
|
||||
CURL_OPTS=(--silent --user-agent "$USER_AGENT")
|
||||
|
||||
curl "${CURL_OPTS[@]}" "$UPSTREAM_URL" | \
|
||||
hxnormalize -x | \
|
||||
hxselect -c 'a' -s '\n' | \
|
||||
grep '.tar.gz' | \
|
||||
sed -e "s/^oil-//" -e "s/\.tar.gz$//"
|
||||
exit 0
|
Loading…
Reference in a new issue