kiss: make pkg_install operate on a single package at a time

This commit is contained in:
Dylan Araps 2019-09-11 08:25:13 +03:00
parent be3aa8928e
commit 857f03fd88

18
kiss
View File

@ -642,22 +642,21 @@ pkg_remove() {
pkg_install() {
# Install a built package tar-ball.
for pkg; do
# Install can also take the full path to a tar-ball.
# We don't need to check the repository if this is the case.
if [ -f "$pkg" ] && [ -z "${pkg%%*.tar.gz}" ] ; then
tar_file=$pkg
if [ -f "$1" ] && [ -z "${1%%*.tar.gz}" ] ; then
tar_file=$1
else
# Read the version information to name the package.
read -r version release < "$(pkg_find "$pkg")/version"
read -r version release < "$(pkg_find "$1")/version"
# Construct the name of the package tarball.
tar_name=$pkg\#$version-$release.tar.gz
tar_name=$1\#$version-$release.tar.gz
[ -f "$bin_dir/$tar_name" ] ||
die "Package '$pkg' has not been built" \
"Run 'kiss build $pkg'"
die "Package '$1' has not been built" \
"Run 'kiss build $1'"
tar_file=$bin_dir/$tar_name
fi
@ -769,7 +768,6 @@ pkg_install() {
}
log "[$pkg_name] Installed successfully"
done
}
pkg_updates() {
@ -961,7 +959,9 @@ args() {
esac
done
pkg_install $install_pkgs
for pkg in $install_pkgs; do
pkg_install "$pkg"
done
;;
r|remove)