summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2019-01-28 09:41:21 +0100
committerErich Eckner <git@eckner.net>2019-01-28 09:41:21 +0100
commit428575acd9728473516d0a7876e43ec4023090ee (patch)
tree01a3af6b518e2b7e48291b84b7c7e11e18ecb73b
parent0a20b01edd747ce5a401c48f8746d711c7043a1b (diff)
downloaddevops-428575acd9728473516d0a7876e43ec4023090ee.tar.xz
watch-versions: -m new
-rwxr-xr-xwatch-versions22
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