16 tryrun zpm init $pkgid.zpm
18 tryrun zpm newpackage -f $pkgid.zpm $pkgid
21 tryrun zpm add -u $owner -g $group -f $pkgid.zpm $pkgid "$@"
24 skip 1 not adding files init failed
28 skip 2 "unable to init $pkgid.zpm"
40 failsok test $1 $2 fails
47 # set up a new package
50 newpkg $pkgid /bin/true
51 okexit setup package $pkgid
54 username=$(zpm pathmod -f $PF $pkgid /bin/true username)
55 okstreq "$username" "$owner" 'default owned by current user'
56 zpm pathmod -f $PF $pkgid /bin/true username=root
57 username=$(zpm pathmod -f $PF $pkgid /bin/true username)
58 okstreq "$username" root 'set username to root'
59 has=$(zpm contents -q -f $PF $pkgid : /bin/true)
60 okstreq "$has" /bin/true 'package has /bin/true'
62 zpm packagehash -qs -f $PF $pkgid
63 hash=$(zpm packagehash -f $PF $pkgid)
64 if [ -n "$hash" ]; then
65 pass 'packagehash set'
68 fail 'packagehash set'
71 zpm pathmod -f $PF $pkgid /bin/true delete
72 zpm contents -q -f $PF $pkgid : /bin/true
73 has=$(zpm contents -q -f $PF $pkgid : /bin/true)
74 okstreq "$has" '' '/bin/true deleted'
76 hash=$(zpm packagehash -e -f $PF $pkgid)
77 if [ -z "$hash" ]; then
78 pass 'packagehash cleared'
80 fail 'packagehash cleared'