aboutsummaryrefslogtreecommitdiff
path: root/bin/plmu.sh
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2017-04-05 20:06:39 +1200
committerTom Ryder <tom@sanctum.geek.nz>2017-04-05 20:46:47 +1200
commitc8ab406749124d2e762ad5cf53963070113afd0f (patch)
tree54c9721a06957ebe7098a211eea803b0230c0f5d /bin/plmu.sh
parentHandle POSIX correctness in ~/.bash_profile (diff)
downloaddotfiles-c8ab406749124d2e762ad5cf53963070113afd0f.tar.gz
dotfiles-c8ab406749124d2e762ad5cf53963070113afd0f.zip
Apply runtime shebanging to POSIX shell
Diffstat (limited to 'bin/plmu.sh')
-rw-r--r--bin/plmu.sh22
1 files changed, 22 insertions, 0 deletions
diff --git a/bin/plmu.sh b/bin/plmu.sh
new file mode 100644
index 00000000..d6f163e6
--- /dev/null
+++ b/bin/plmu.sh
@@ -0,0 +1,22 @@
+
+# Set up exceptions file if it exists
+ef=$HOME/.plenv/non-cpanm-modules
+[ -e "$ef" ] || ef=/dev/null
+
+# Check that exceptions file is sorted
+if ! sort -c -- "$ef" ; then
+ printf >&2 '%s not sorted\n' "$ef"
+ exit 1
+fi
+
+# Get the list of modules; sort them in case our current locale disagrees on
+# the existing sorting
+plenv list-modules | sort |
+
+# Exclude any modules in ~.plenv/non-cpanm-modules if it exists
+comm -23 -- - "$ef" |
+
+# Read that list of modules to upgrade and upgrade them one by one
+while read -r module ; do
+ cpanm --notest --quiet -- "$module"
+done