summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2011-06-30 10:36:55 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2011-06-30 10:36:55 +0200
commit82a793b2b3ef68dbadb894b6428d25ab30b8be17 (patch)
tree5b0b2e40f112a2817172468446f522218d091856
parent72d88d124fb6003b7ad096424d316827f9e1d9bb (diff)
downloadbin-82a793b2b3ef68dbadb894b6428d25ab30b8be17.zip
bin-82a793b2b3ef68dbadb894b6428d25ab30b8be17.tar.gz
add arch-pkgs-update
-rwxr-xr-xarch-pkgs-update21
1 files changed, 21 insertions, 0 deletions
diff --git a/arch-pkgs-update b/arch-pkgs-update
new file mode 100755
index 0000000..a0d7529
--- /dev/null
+++ b/arch-pkgs-update
@@ -0,0 +1,21 @@
+#!/bin/bash
+#
+[ $# -lt 1 ] && echo "usage $0 pkg_list (generated with pacman -Q)" && exit 1
+
+tmp=/tmp/__pkgs
+[ -e $tmp ] && rm $tmp
+
+echo " * read packages list"
+pkgs=`cat $1 | gawk '{ print $1 }'`
+echo " * search packages to install"
+for pkg in $pkgs; do
+ pacman -Q $pkg >/dev/null 2>&1 || echo $pkg >> $tmp
+done
+if [ -e $tmp ]; then
+ echo " * install packages"
+ pkgs=$(cat $tmp)
+ pacman -S $pkgs || exit 1
+ echo " * done"
+else
+ echo " * nothing todo"
+fi