1
0
mirror of https://codeberg.org/kiss-community/kiss synced 2024-07-02 14:02:26 +00:00

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

37
kiss
View File

@ -642,22 +642,21 @@ pkg_remove() {
pkg_install() { pkg_install() {
# Install a built package tar-ball. # Install a built package tar-ball.
for pkg; do
# Install can also take the full path to a tar-ball. # Install can also take the full path to a tar-ball.
# We don't need to check the repository if this is the case. # We don't need to check the repository if this is the case.
if [ -f "$pkg" ] && [ -z "${pkg%%*.tar.gz}" ] ; then if [ -f "$1" ] && [ -z "${1%%*.tar.gz}" ] ; then
tar_file=$pkg tar_file=$1
else else
# Read the version information to name the package. # 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. # 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" ] || [ -f "$bin_dir/$tar_name" ] ||
die "Package '$pkg' has not been built" \ die "Package '$1' has not been built" \
"Run 'kiss build $pkg'" "Run 'kiss build $1'"
tar_file=$bin_dir/$tar_name tar_file=$bin_dir/$tar_name
fi fi
@ -769,7 +768,6 @@ pkg_install() {
} }
log "[$pkg_name] Installed successfully" log "[$pkg_name] Installed successfully"
done
} }
pkg_updates() { pkg_updates() {
@ -947,21 +945,20 @@ args() {
i|install) i|install)
# Create a list of each package's dependencies. # Create a list of each package's dependencies.
for pkg; do for pkg; do
if [ "${pkg%%*.tar.gz}" ]; then case $pkg in
pkg_depends "$pkg" *.tar.gz) missing_deps="$missing_deps $pkg " ;;
else *) pkg_depends "$pkg"
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 " ;;
esac esac
done 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) r|remove)