diff --git a/scripts/pkgmeek b/scripts/pkgmeek index a1427ef..12ec82f 100755 --- a/scripts/pkgmeek +++ b/scripts/pkgmeek @@ -198,14 +198,13 @@ find . -maxdepth 1 -mindepth 1 -type l -delete # Install if requested # First find out how the effective user will invoke pkgadd -[ $UID = 0 ] || PKGMK_SU="sudo "; -[ -z "$PKGMK_SU" ] || [ -x $(command -v "$PKGMK_SU") ] || PKGMK_SU="/usr/bin/doas "; -[ -x $(command -v "$PKGMK_SU") ] || PKGMK_SU="su -c"; +[ $UID = 0 ] || PKGMK_SU="sudo"; +[ -z "$PKGMK_SU" ] || [ -x "$(command -v $PKGMK_SU)" ] || PKGMK_SU="/usr/bin/doas"; +[ -x "$(command -v $PKGMK_SU)" ] || PKGMK_SU="su -c"; -[ -z "$PKGMK_INSTALL_COMMAND" ] || \ - $PKGMK_SU $PKGMK_INSTALL_COMMAND "$package" || \ - { error "Unable to install $package using pkgadd."; - exit "$E_INSTALL"; } +[ -z "$PKGMK_INSTALL_COMMAND" ] || { $PKGMK_SU $PKGMK_INSTALL_COMMAND "$pkg_dir$package" \ + && info "$(basename $PKGMK_INSTALL_COMMAND) $package succeeded."; } || \ + { error "Unable to install $package using pkgadd."; exit "$E_INSTALL"; } # Clean up, part 2 [ "$PKGMK_KEEP_WORK" = "yes" ] || [ "$pkg_dir" = "$(pwd)/" ] || rm -f "$package"