Quote aptget command and params, simplify explorer

This commit is contained in:
Jonas Weber 2018-09-12 11:35:23 +02:00
parent 346f1f8af3
commit b3f3b907a4
2 changed files with 3 additions and 3 deletions

View File

@ -30,7 +30,7 @@ fi
# Except dpkg failing, if package is not known / installed
packages="$(apt-cache showpkg "$name" | sed -e "1,/Reverse Provides:/d" | cut -d ' ' -f 1) $name"
for p in $packages; do
if [ -n "$(dpkg -s "$p" 2>/dev/null | grep "^Status: install ok installed$")" ]; then
if dpkg -s "$p" 2>/dev/null | grep --quiet "^Status: install ok installed$" ; then
version=$(dpkg -s "$p" 2>/dev/null | grep "^Version:" | cut -d ' ' -f 2)
echo "present $p $version"
exit 0

View File

@ -77,11 +77,11 @@ case "$state_should" in
if [ -n "$version" ]; then
name="${name}=${version}"
fi
echo $aptget install $target_release \"$name\"
echo "$aptget install $target_release \"$name\""
echo "installed" >> "$__messages_out"
;;
absent)
echo $aptget remove $purgeparam \"$name\"
echo "$aptget remove $purgeparam \"$name\""
echo "removed" >> "$__messages_out"
;;
*)