#!/bin/sh pkgfile=$1 shift for path in $*; do mkdir -p tmp/$(dirname $path) fhash=$(sqlite3 $pkgfile "select hash from packagefiles where path = '$path';") ./zpm-extract $pkgfile $fhash ./tmp/$path done