]> pd.if.org Git - zpackage/commitdiff
fix rmpackage quoting
authorNathan Wagner <nw@hydaspes.if.org>
Sat, 15 Dec 2018 16:59:01 +0000 (16:59 +0000)
committerNathan Wagner <nw@hydaspes.if.org>
Sat, 15 Dec 2018 16:59:01 +0000 (16:59 +0000)
zpm-rmpackage

index a09d0e2b8309e462dccd9e5a8aab4d73e9a955de..4e8f10768686b4c991f528c76b5dd2f293066f61 100755 (executable)
@@ -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