]> pd.if.org Git - zpackage/commitdiff
fixups for zpm-preserve arg handling
authorNathan Wagner <nw@hydaspes.if.org>
Sun, 27 Dec 2015 08:26:22 +0000 (08:26 +0000)
committerNathan Wagner <nw@hydaspes.if.org>
Sun, 27 Dec 2015 08:26:22 +0000 (08:26 +0000)
zpm
zpm-preserve

diff --git a/zpm b/zpm
index 57065d7655502e9152e072426bd346a91266f1cc..13f4c8e331b738112f0469598e4cfec7bd6c1e76 100755 (executable)
--- a/zpm
+++ b/zpm
@@ -15,7 +15,7 @@ case $cmd in
                find $(echo $PATH | tr ':' ' ') -maxdepth 1 -type f -name 'zpm-*' -executable -printf '%P\n'
                ;;
        *)
-               ecmd=$(command -v "zpm-$cmd") || die "$0: unknown command $cmd"
+               ecmd=$(command -v "zpm-$cmd") || die "$0: unknown command $cmd $@"
                exec "$ecmd" "$@" || die "$0: could not exec $ecmd"
                ;;
 esac
index b1e8c6678f90dded09a5810a9d503bbc5c9b62bb..f3086160ad78b21d5184428bf7a9a9869517db76 100755 (executable)
@@ -9,18 +9,18 @@ if [ "$1" = '-v' ]; then
        shift
 fi
 
-pkgname=$1
+pkgname="$1"
 
-pacman -Qlq "$1" | while read file; do
+pacman -Qlq "$pkgname" | while read file; do
        if [ ! -f "$file" ]; then continue; fi
 
        soname=$(soname $file)
        if [ $? -eq 0 ] && [ -n "$soname" ]; then
                dir=$(dirname "$file")
-               mkdir -p $dir/preserve
+               mkdir -p "$dir/preserve"
                if [ "$verbose" -gt 0 ]; then
-                       printf 'preserving %s\n' $file
+                       printf 'preserving %s\n' "$file"
                fi
-               ln -f $file "$dir/preserve/"
+               ln -f "$file" "$dir/preserve/"
        fi
 done