#printf "%s\n" $path
)
+showscript() (
+ stage=$1
+ stage=$(zpm quote "$stage")
+ hash=$(zpm shell $pkgfile "select hash from scripts_pkgid
+ where pkgid = '$pkgid' and stage = '$stage'")
+ if [ -z "$hash" ]; then
+ die "no script for $stage $pkgid"
+ fi
+ zpm extract $pkgfile "$hash" -
+)
+
# TODO better syntax for showing the script
# TODO a way to set the script hash directly
while [ $# -gt 1 ]; do
script=$2
shift 2
- if [ "$script" = '-' ]; then
+ if [ "$script" = '--' ]; then
removescript "$stage"
- elif [ -z "$script" ]; then
+ elif [ "$script" = '-' ]; then
showscript "$stage"
else
addscript "$stage" "$script"