diff options
-rwxr-xr-x | watch-versions | 22 |
1 files changed, 18 insertions, 4 deletions
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 |