Merge pull request #52 from kisslinux/install_change

kiss: make pkg_install operate on a single package at a time
This commit is contained in:
black 2019-09-11 08:42:27 +03:00 committed by GitHub
commit eefbe205c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 108 additions and 111 deletions

37
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() {
@ -947,21 +945,20 @@ args() {
i|install)
# Create a list of each package's dependencies.
for pkg; do
if [ "${pkg%%*.tar.gz}" ]; then
pkg_depends "$pkg"
else
missing_deps="$missing_deps $pkg "
fi
done
# Filter the list, only including explicit packages.
for pkg in $missing_deps; do
case " $* " in
*" $pkg "*) install_pkgs="$install_pkgs $pkg " ;;
case $pkg in
*.tar.gz) missing_deps="$missing_deps $pkg " ;;
*) pkg_depends "$pkg"
esac
done
pkg_install $install_pkgs
# Filter the list, only installing explicit packages.
# The purpose of these two loops is to order the
# argument list based on dependence.
for pkg in $missing_deps; do
case " $* " in
*" $pkg "*) pkg_install "$pkg" ;;
esac
done
;;
r|remove)