From dcf728d215d39ae929ac5a5874189093874aaf73 Mon Sep 17 00:00:00 2001 From: George Rawlinson Date: Sat, 5 Feb 2022 08:14:37 +0000 Subject: [PATCH] nvchecker: update scripts for oil & html-xml-utils <3 to Felix Yan https://lists.archlinux.org/pipermail/arch-dev-public/2022-February/030709.html --- .repo/nvchecker.toml | 15 +++++++++------ .repo/pkgver/html-xml-utils.sh | 33 --------------------------------- .repo/pkgver/oil.sh | 31 ------------------------------- 3 files changed, 9 insertions(+), 70 deletions(-) delete mode 100755 .repo/pkgver/html-xml-utils.sh delete mode 100755 .repo/pkgver/oil.sh diff --git a/.repo/nvchecker.toml b/.repo/nvchecker.toml index 42ae75e..3a66cca 100644 --- a/.repo/nvchecker.toml +++ b/.repo/nvchecker.toml @@ -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" diff --git a/.repo/pkgver/html-xml-utils.sh b/.repo/pkgver/html-xml-utils.sh deleted file mode 100755 index 323705d..0000000 --- a/.repo/pkgver/html-xml-utils.sh +++ /dev/null @@ -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 diff --git a/.repo/pkgver/oil.sh b/.repo/pkgver/oil.sh deleted file mode 100755 index ee8654d..0000000 --- a/.repo/pkgver/oil.sh +++ /dev/null @@ -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