verbose=0
tags=
isconfig=0
+addcontent=1
# option for "multipackage" just to let the system know that's what you meant
# option to take filenames from stdin
# parse package, version, release from file if not given
# TODO -l follow symlinks, -L follow symlinks, adding all, links and targets
-while getopts :f:vr:l:P:S:cu:g: opt; do
+while getopts :f:vr:l:P:S:cu:g:N opt; do
case $opt in
+ N) addcontent=0 ;;
f) pkgfile="$OPTARG" ;;
P) prefix="$OPTARG" ;;
S) strip=$(cleanpath "$OPTARG"); ;;
if [ -z "$pkgfile" ]; then
die "cannot determine package file"
else
- pkgstr=$(zpm findpkg $pkgfile $pkgid)
+ pkgstr=$(zpm findpkg -f $pkgfile $pkgid)
if [ -z "$pkgstr" ]; then
die "unable to find package id for $pkgid in $pkgfile"
fi
case "$filetype" in
regular)
filetype=r
- hash=$(zpm addfile $pkgfile "$path")
- if [ $? -ne 0 ]; then
- die "zpm addfile failed ($?): $pkgfile $path"
+ if [ $addcontent -eq 1 ]; then
+ hash=$(zpm addfile $pkgfile "$path")
+ if [ $? -ne 0 ]; then
+ die "zpm addfile failed ($?): $pkgfile $path"
+ fi
+ else
+ hash=$(zpm hash "$path")
fi
hash="'$hash'"
;;