]> piware.de Git - bin.git/blob - for-archive
mockspec: run offline
[bin.git] / for-archive
1 #!/bin/sh -e
2
3 cmd=`which "$3"` || true
4
5 [ -f "$1" ] && [ -d "$2" ] && [ -x "$cmd" ] || {
6     echo "Execute a command for all debs in an archive"
7     echo "Usage: $0 <packages file> <archive root dir> <command>"
8     exit 1
9 }
10
11 list=`readlink -f "$1"`
12
13 cd "$2"
14 zgrep ^Filename: "$list" | cut -f 2- -d\  | xargs -l1 $cmd