From 9dc0c4f6a9ecb1f45eb8f329a9d977b7515f574e Mon Sep 17 00:00:00 2001 From: Nathan Wagner Date: Sat, 15 Dec 2018 16:59:01 +0000 Subject: [PATCH 1/1] fix rmpackage quoting --- zpm-rmpackage | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/zpm-rmpackage b/zpm-rmpackage index a09d0e2..4e8f107 100755 --- a/zpm-rmpackage +++ b/zpm-rmpackage @@ -9,13 +9,15 @@ while getopts :f:vm: opt; do case $opt in f) pkgfile="$OPTARG" ;; v) verbose=1 ;; - m) message=$(zpm quote "$OPTARG") ;; + m) message="$OPTARG" ;; esac done shift $(( OPTIND - 1)) if [ -z "$message" ]; then message=null +else + message=$(zpm quote -q "$message") fi die() { @@ -47,7 +49,7 @@ fi fi pkgid=$(zpm quote "$pkgid") printf "delete from packages_pkgid where pkgid = '$pkgid';\n" - printf "insert into zpmlog (action, target, info) values (%s,'%s',%s);\n" 'rmpackage' "$pkgid" "$message" + printf "insert into zpmlog (action, target, info) values ('rmpackage','%s',%s);\n" "$pkgid" "$message" done printf "commit;\n" } | zpm shell $pkgfile -- 2.40.0