verbose=0
# newpackage -f pkgfile $pkgid
-while getopts :f:vm: opt; do
+while getopts :f:vm:s:S: opt; do
case $opt in
f) pkgfile="$OPTARG" ;;
v) verbose=1 ;;
m) message="$OPTARG" ;;
+ s) status="$status -s $OPTARG" ;;
+ S) exclude="$exclude -S $OPTARG" ;;
esac
done
shift $(( OPTIND - 1))
{
printf ".bail on\n"
+ printf ".echo on\n"
printf "begin;\n"
for pkgstr in "$@"; do
- pkgid=$(zpm findpkg -f $pkgfile "$pkgstr")
+ pkgid=$(zpm findpkg $status $exclude -f $pkgfile "$pkgstr")
+ if [ -z "$pkgid" ]; then
+ continue;
+ fi
if [ $verbose -gt 0 ]; then
- if [ -z "$pkgid" ]; then
- warn "$pkgstr not found"
- continue;
- fi
if [ $verbose -gt 1 ]; then
warn "found %s -> %s\n" "$pkgstr", "$pkgid"
fi