summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2023-06-13 10:06:02 +0200
committerErich Eckner <git@eckner.net>2023-06-13 10:06:02 +0200
commit5b5aae52145173c816553936f76dd3b4ffb4e840 (patch)
treede644c45cea181586544999de81adc0a0a2c0f3a
parent7471821b0234d81e8ef5ce919054810967fc1a7a (diff)
downloadcrux-ports-5b5aae52145173c816553936f76dd3b4ffb4e840.tar.xz
update.sh: allow to update all packages at once
-rwxr-xr-xupdate.sh22
1 files changed, 22 insertions, 0 deletions
diff --git a/update.sh b/update.sh
index 8ce44e0..f2162f9 100755
--- a/update.sh
+++ b/update.sh
@@ -1,5 +1,27 @@
#!/bin/bash
+if [ $# -eq 0 ]; then
+ /usr/src/ports/lastVersion.sh \
+ | sed -n '
+ s@ vs\. \S\+$@@
+ T
+ s/ /\n/
+ T
+ p
+ ' \
+ | parallel -j4 --max-args 2 "$0" {} \;
+ exit $?
+fi
+
+if [ $# -ne 2 ]; then
+ >&2 echo 'usage:'
+ >&2 echo ' update.sh'
+ >&2 echo ' update all packages'
+ >&2 echo ' update.sh $package $version'
+ >&2 echo ' update package $package to version $version'
+ exit 1
+fi
+
set -e
pkg="${1%:}"