. tap.sh
-plan 46
+plan 53
newpkg() {
pkgid=$1
#require zpm add -f $PF $pkgid /bin/true
#
-# install via pkgfiles
+# install via syncfs
#
require zpm pkg -f $PF $pkgid status=installing
-zpm pkgfiles -d $PF -R. $pkgid 2>&1
-okexit ran pkgfiles
+zpm syncfs -d $PF -R. $pkgid 2>&1
+okexit ran syncfs
test -f bin/true
okexit bin/true installed
okexit setup package $pkgid
require rm bin/sh
PF=$pkgid.zpm
-zpm install -v -R. -d local.db -f $PF $pkgid | diagstdin
+zpm install -R. -d local.db -f $PF $pkgid | diagstdin
okexit installed $pkgid
oktest -f bin/sh
}
}
+#
+# package with failing pre-script
+#
+pkgid=fourth-1.0-1
+PF=$pkgid.zpm
+newpkg $pkgid /bin/printf
+skiponfail 3 "can't create $pkgid" || {
+ zpm setscript -f $PF $pkgid pre-install /bin/false
+ okexit "add false pre-install script to $pkgid"
+ skiponfail 1 "can't set $pkgid pre-install script" || {
+ zpm install -R. -d local.db -f $PF $pkgid 2>/dev/null
+ failsok failed to install $pkgid
+ }
+}
+
+tryrun zpm uninstall -R. -d local.db third-1.0-1
+test -f bin/echo
+failsok bin/echo removed
+
cd .. || bailout
require rm -rf tmp