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 -p $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
55 zpm add -f $PF -C -c -p $pkgid etc/conf
57 isconf=$(zpm pkgfile -f $PF $pkgid /etc/conf configuration)
58 okstreq $isconf 1 etc/conf 1.0 is config file
61 newpkg $pkgid /bin/true
62 okexit setup package $pkgid
65 zpm add -f $PF -C -c -p $pkgid etc/conf
67 isconf=$(zpm pkgfile -f $PF $pkgid /etc/conf configuration)
68 okstreq $isconf 1 etc/conf 2.0 is config file
71 newpkg $pkgid /bin/true
72 okexit setup package $pkgid
75 zpm add -f $PF -C -c -p $pkgid etc/conf
77 isconf=$(zpm pkgfile -f $PF $pkgid /etc/conf configuration)
78 okstreq $isconf 1 etc/conf 3.0 is config file
84 require mkdir var/lib/zpm
86 require zpm install -R. -f itest-1.0-1.zpm itest-1.0-1
89 okexit etc/conf installed via zpm-install
91 okstreq "$conf" foo conf is foo
93 # update unchanged config file
94 require zpm install -R. -f itest-2.0-1.zpm itest-2.0-1
96 okstreq "$conf" bar new conf is bar
98 zpm note -f var/lib/zpm/local.db -l | diagstdin
101 qhash=$(printf '%.8s' $(zpm hash etc/conf))
103 require zpm install -R. -f itest-3.0-1.zpm itest-3.0-1
105 okstreq "$conf" quux kept conf $qhash as quux
107 zpm note -f var/lib/zpm/local.db -l | diagstdin
109 ZPMDB=$PWD/var/lib/zpm/local.db
112 require zpm uninstall -R. itest
113 zpm note -f var/lib/zpm/local.db -l | diagstdin