]> piware.de Git - bin.git/commitdiff
add for-archive
authormartin@piware.de <>
Wed, 6 Sep 2006 10:19:17 +0000 (12:19 +0200)
committermartin@piware.de <>
Wed, 6 Sep 2006 10:19:17 +0000 (12:19 +0200)
for-archive [new file with mode: 0755]

diff --git a/for-archive b/for-archive
new file mode 100755 (executable)
index 0000000..d886907
--- /dev/null
@@ -0,0 +1,14 @@
+#!/bin/sh -e
+
+cmd=`which "$3"` || true
+
+[ -f "$1" ] && [ -d "$2" ] && [ -x "$cmd" ] || {
+    echo "Execute a command for all debs in an archive"
+    echo "Usage: $0 <packages file> <archive root dir> <command>"
+    exit 1
+}
+
+list=`readlink -f "$1"`
+
+cd "$2"
+grep ^Filename: "$list" | cut -f 2- -d\  | xargs $cmd