diff options
author | P. J. McDermott <pj@pehjota.net> | 2018-05-05 18:29:27 (EDT) |
---|---|---|
committer | P. J. McDermott <pj@pehjota.net> | 2018-05-16 16:16:49 (EDT) |
commit | ff2c5304dcdfc5af3a95a09e62377768f4e0ceca (patch) | |
tree | 061806f90bc6169dced7aec8d74e6c39b35d44d0 | |
parent | f27acca93e4e219925661bc56b759997059acbd4 (diff) | |
download | icecat-ff2c5304dcdfc5af3a95a09e62377768f4e0ceca.zip icecat-ff2c5304dcdfc5af3a95a09e62377768f4e0ceca.tar.gz icecat-ff2c5304dcdfc5af3a95a09e62377768f4e0ceca.tar.bz2 |
gnuzilla/uscanzilla: New file
-rw-r--r-- | .gitignore.d/icecat | 2 | ||||
-rwxr-xr-x | gnuzilla/uscanzilla | 23 |
2 files changed, 25 insertions, 0 deletions
diff --git a/.gitignore.d/icecat b/.gitignore.d/icecat index df58867..d90e9f2 100644 --- a/.gitignore.d/icecat +++ b/.gitignore.d/icecat @@ -4,6 +4,8 @@ # Include relevant files !/.gitignore.d/ !/.gitignore.d/icecat +!/gnuzilla/ +!/gnuzilla/uscanzilla # Exclude swap and backup files *.s[a-w]? diff --git a/gnuzilla/uscanzilla b/gnuzilla/uscanzilla new file mode 100755 index 0000000..a879ca5 --- /dev/null +++ b/gnuzilla/uscanzilla @@ -0,0 +1,23 @@ +#!/bin/sh + +set -eu + +old_version='0' +{ read old_version 0<"${0%/*}/version" || :; } 2>'/dev/null' + +output="$(uscan --package 'icecat' --upstream-version "${old_version}" \ + --watchfile "${0%/*}/watch" 2>&1)" || return 0 + +sed_s='s/uscan: Newest version of icecat on remote site is \([^,][^,]*\),' +sed_s="${sed_s}"' local version is .*$/\1/p;' +new_version="$(sed -n "${sed_s}")" <<-EOF + ${output} + EOF + +printf '%s\n' "${new_version}" >"${0%/*}/version" + +notify-send "New icecat version: ${new_version}" \ + "${old_version} -> ${new_version}" +# mailx -s "New version of icecat available: ${version}" 'pj@pehjota.net' <<-EOF +# ${output} +# EOF |