5 while getopts :f:v:r:d:a:u:l:p:b:P:R: opt; do
7 R) pkgroot="$OPTARG" ;;
8 f) pkgfile="$OPTARG" ;;
10 r) pkgrel="$OPTARG" ;;
11 d) description="$OPTARG" ;;
14 l) licenses="$OPTARG" ;;
15 p) packager="$OPTARG" ;;
16 b) builddate="$OPTARG" ;;
17 P) prefix="$OPTARG" ;;
29 select $1 from packagefiles
31 and package||'-'||version||'-'||release = '$pkg'
36 # if not from a package file, from local db
37 if [ -z "$pkgfile" ]; then
38 die "installing from non-pkgfile not supported"
46 fhash=$(pkgfileinfo hash $path)
47 mode=$(pkgfileinfo mode $path)
48 owner=$(pkgfileinfo username $path)
49 group=$(pkgfileinfo groupname $path)
50 ftype=$(pkgfileinfo filetype $path)
51 name=$(basename -- $path)
53 if [ "$pkgroot" != '/' ]; then
54 dir=$pkgroot/$(dirname -- $path)
56 if [ "$dir" = "//" ]; then dir=/ ; fi
61 tmppath=$dir/.installing.$name
65 zpm extract $pkgfile $fhash $tmppath 0
66 chown $owner:$group $tmppath
68 mv $tmppath $dir/$name