isconfig=0
addcontent=1
complete=0
+mode=
# 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
c) isconfig=1 ;;
u) username="$OPTARG" ;;
g) groupname="$OPTARG" ;;
+ m) mode="$OPTARG" ;;
v) verbose=$((verbose + 1)) ;;
C) complete=1 ;;
*) echo 'unknown option' $OPTARG; exit 1 ;;
mtime=$(zpm stat -f '%y' $path)
uid=$(zpm stat -f '%u' $path)
gid=$(zpm stat -f '%g' $path)
- mode=$(zpm stat -f '%a' $path)
+
+ if [ -z "$mode" ]; then
+ mode=$(zpm stat -f '%a' $path)
+ fi
# only stat the file for the user and group name if not set on the
# command line
fi
if [ ! -z "$strip" ]; then
- echo "stripping $strip"
rpath=${rpath#$strip}
rpath=${rpath#/}
fi
rpath="$prefix/$rpath"
fi
+ # ensure all paths are absolute
+ rpath=/${rpath#/}
+
filetype=$(zpm stat -l -f '%t' "$path")
hash='NULL'
target='NULL'
#cat <<EOS
zpm shell $pkgfile <<EOS
begin;
-insert or replace into packagefiles (package,version,release,path,mode,mtime,username,groupname,filetype,hash,target)
-values ('$package', '$pkgver', $pkgrel, '$rpath', '$mode',$mtime, '$username','$groupname','$filetype',$hash,$target);
+insert or replace into packagefiles (package,version,release,path,mode,mtime,username,groupname,filetype,hash,configuration,target)
+values ('$package', '$pkgver', $pkgrel, '$rpath', '$mode',$mtime, '$username','$groupname','$filetype',$hash,$isconfig,$target);
commit;
EOS