diff --git a/kiss b/kiss index 2619bfc..d964f62 100755 --- a/kiss +++ b/kiss @@ -1262,18 +1262,20 @@ pkg_install() { # Install can also take the full path to a tarball. We don't need to check # the repository if this is the case. - if [ -f "$1" ] && [ -z "${1%%*.tar.*}" ]; then - tar_file=$1 pkg_name=${1##*/} pkg_name=${pkg_name%[#@]*} + case $1 in + *.tar.*) + [ -f "$1" ] || die "File '$1' does not exist" - elif pkg_cache "$1" 2>/dev/null; then - pkg_name=$1 + tar_file=$1 + pkg_name=${1##*/} + pkg_name=${pkg_name%@*} + ;; - else - case $1 in - *.tar.*) die "Tarball '$1' does not exist" ;; - *) die "Package '$1' has not yet been built" - esac - fi + *) + pkg_cache "$1" || die "$1" "Not yet built" + pkg_name=$1 + ;; + esac mkdir -p "$tar_dir/$pkg_name" cd "$tar_dir/$pkg_name"