From ada8405d470a7b13eba173bcacfd660e13dfed0d Mon Sep 17 00:00:00 2001 From: Nathan Wagner Date: Sat, 6 Oct 2018 17:58:09 +0000 Subject: [PATCH] add option to show install scripts --- zpm-setscript | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/zpm-setscript b/zpm-setscript index 09e3b4a..0036e66 100755 --- a/zpm-setscript +++ b/zpm-setscript @@ -129,6 +129,17 @@ EOS #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 @@ -136,9 +147,9 @@ 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" -- 2.40.0