diff options
author | José Romildo Malaquias <malaquias@gmail.com> | 2018-05-22 10:55:56 -0300 |
---|---|---|
committer | José Romildo Malaquias <malaquias@gmail.com> | 2018-07-26 15:22:05 -0300 |
commit | 836b827226458fc57e0a37a1f53463590696d22d (patch) | |
tree | 1d5f964c093b1a6fde2b64803803aeb9d00eb039 /pkgs/desktops | |
parent | 507951e889325fd0ac0ff0dcf8aa2df6fef0b559 (diff) |
lxqt: add update script
Diffstat (limited to 'pkgs/desktops')
-rwxr-xr-x | pkgs/desktops/lxqt/update.sh | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/pkgs/desktops/lxqt/update.sh b/pkgs/desktops/lxqt/update.sh new file mode 100755 index 0000000000000..bad78f7c1fff9 --- /dev/null +++ b/pkgs/desktops/lxqt/update.sh @@ -0,0 +1,39 @@ +#!/usr/bin/env nix-shell +#!nix-shell -i bash -p libarchive curl common-updater-scripts + +set -eu -o pipefail + +cd "$(dirname "${BASH_SOURCE[0]}")" +root=../../.. +export NIXPKGS_ALLOW_UNFREE=1 + +lxqt_version=0.13.0 +lxqtrepo=https://downloads.lxqt.org/${lxqt_version}.html + +version() { + (cd "$root" && nix-instantiate --eval --strict -A "$1.version" 2>/dev/null | tr -d '"') +} + +update_lxqt() { + local pname + local pversion + curl -sS ${lxqtrepo} | sed -rne 's|.*<a href=.*>(.+) (.+)</a><br>|\1 \2|p' | + while read pname pversion; do + local pversionold=$(version lxqt.$pname) + if [[ "$pversion" = "$pversionold" ]]; then + echo "nothing to do, $pname $pversion is current" + else + echo "$pname: $pversionold -> $pversion" + (cd "$root" + local pfile=$(EDITOR=echo nix edit -f. lxqt.$pname 2>/dev/null) + update-source-version lxqt.$pname "$pversion" + git add $pfile + git commit -m "$pname: $pversionold -> $pversion" + ) + fi + echo + done + echo DONE +} + +update_lxqt |