]> piware.de Git - bin.git/commitdiff
add update-installed-deb
authorMartin Pitt <martin@piware.de>
Tue, 3 Jan 2012 15:18:25 +0000 (16:18 +0100)
committerMartin Pitt <martin@piware.de>
Tue, 3 Jan 2012 15:18:25 +0000 (16:18 +0100)
update-installed-deb [new file with mode: 0755]

diff --git a/update-installed-deb b/update-installed-deb
new file mode 100755 (executable)
index 0000000..b0de93a
--- /dev/null
@@ -0,0 +1,19 @@
+#!/bin/sh
+set -e
+
+if [ `id -u` = 0 ]; then
+    SUDO=
+else
+    SUDO=sudo
+fi
+
+P=""
+for deb in *.deb; do
+    if dpkg -s ${deb%%_*} 2>/dev/null|grep -q '^Status:'; then
+        P="$P $deb"
+    else
+        echo "Skipping $deb, not installed"
+    fi
+done
+
+$SUDO dpkg -i $P