index : devops | |
Archlinux32 devs' convenience-scripts | gitolite user |
summaryrefslogtreecommitdiff |
author | Erich Eckner <git@eckner.net> | 2019-01-28 09:41:21 +0100 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2019-01-28 09:41:21 +0100 |
commit | 428575acd9728473516d0a7876e43ec4023090ee (patch) | |
tree | 01a3af6b518e2b7e48291b84b7c7e11e18ecb73b /watch-versions | |
parent | 0a20b01edd747ce5a401c48f8746d711c7043a1b (diff) |
-rwxr-xr-x | watch-versions | 22 |
diff --git a/watch-versions b/watch-versions index 7761460..8c0dac1 100755 --- a/watch-versions +++ b/watch-versions @@ -1,5 +1,12 @@ #!/bin/sh +if [ "x$1" = 'x-m' ]; then + machine_readable=true + shift +else + machine_readable=false +fi + if [ $# -eq 0 ]; then git -C "$(dirname "$0")/../packages" pull --ff-only >/dev/null 2>&1 # curl -Ss 'https://packages.archlinux32.org/?uses_upstream=Does+Not+Use+Upstream&fuzzy&tsv' @@ -82,8 +89,15 @@ newver=$( ) if [ "${newver}" != "${oldver}" ]; then - printf '%s: %s vs. %s\n' \ - "${pkgbase}" \ - "${newver}" \ - "${oldver}" + if ${machine_readable}; then + printf '%s="%s";\n' \ + 'pkgbase' "${pkgbase}" \ + 'newver' "${newver}" \ + 'oldver' "${oldver}" + else + printf '%s: %s vs. %s\n' \ + "${pkgbase}" \ + "${newver}" \ + "${oldver}" + fi fi |