X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=t%2Fupdate.t;h=321551586adc7fc3fb1defcf41909841154275c0;hb=86d735d52280359df4896d5c542ddfbe33d8df7b;hp=8828749143889fcdc9c88047bc436c2ac29c28b5;hpb=2e468963f264e40379425a83048000965320a78e;p=zpackage diff --git a/t/update.t b/t/update.t index 8828749..3215515 100755 --- a/t/update.t +++ b/t/update.t @@ -6,7 +6,7 @@ . tap.sh -plan 32 +plan 33 owner=$(id -un) group=$(id -gn) @@ -18,7 +18,7 @@ newpkg() { tryrun zpm newpackage -f $pkgid.zpm $pkgid if [ $? -eq 0 ]; then shift - tryrun zpm add -u $owner -g $group -f $pkgid.zpm $pkgid "$@" + tryrun zpm add -u $owner -g $group -f $pkgid.zpm -p $pkgid "$@" return $? else skip 1 not adding files init failed @@ -52,7 +52,7 @@ okexit setup package $pkgid PF=$pkgid.zpm require mkdir etc echo foo > etc/conf -zpm add -f $PF -C -c $pkgid etc/conf +zpm add -f $PF -C -c -p $pkgid etc/conf okexit added foo conf isconf=$(zpm pkgfile -f $PF $pkgid /etc/conf configuration) okstreq $isconf 1 etc/conf 1.0 is config file @@ -62,7 +62,7 @@ newpkg $pkgid /bin/true okexit setup package $pkgid PF=$pkgid.zpm echo bar > etc/conf -zpm add -f $PF -C -c $pkgid etc/conf +zpm add -f $PF -C -c -p $pkgid etc/conf okexit added bar conf isconf=$(zpm pkgfile -f $PF $pkgid /etc/conf configuration) okstreq $isconf 1 etc/conf 2.0 is config file @@ -72,7 +72,7 @@ newpkg $pkgid /bin/true okexit setup package $pkgid PF=$pkgid.zpm echo baz > etc/conf -zpm add -f $PF -C -c $pkgid etc/conf +zpm add -f $PF -C -c -p $pkgid etc/conf okexit added baz conf isconf=$(zpm pkgfile -f $PF $pkgid /etc/conf configuration) okstreq $isconf 1 etc/conf 3.0 is config file @@ -95,10 +95,22 @@ require zpm install -R. -f itest-2.0-1.zpm itest-2.0-1 conf=$(cat etc/conf) okstreq "$conf" bar new conf is bar +zpm note -f var/lib/zpm/local.db -l | diagstdin + echo quux > etc/conf +qhash=$(printf '%.8s' $(zpm hash etc/conf)) require zpm install -R. -f itest-3.0-1.zpm itest-3.0-1 conf=$(cat etc/conf) -okstreq "$conf" quux kept conf as quux +okstreq "$conf" quux kept conf $qhash as quux + +zpm note -f var/lib/zpm/local.db -l | diagstdin + +ZPMDB=$PWD/var/lib/zpm/local.db +export ZPMDB +require zpm uninstall -R. itest zpm note -f var/lib/zpm/local.db -l | diagstdin + +cd .. +rm -r tmp