forked from kiss-community/kiss
kiss: rewrite install input
This commit is contained in:
parent
0c51261486
commit
5f93bfef55
22
kiss
22
kiss
@ -1262,18 +1262,20 @@ pkg_install() {
|
|||||||
|
|
||||||
# Install can also take the full path to a tarball. We don't need to check
|
# Install can also take the full path to a tarball. We don't need to check
|
||||||
# the repository if this is the case.
|
# the repository if this is the case.
|
||||||
if [ -f "$1" ] && [ -z "${1%%*.tar.*}" ]; then
|
case $1 in
|
||||||
tar_file=$1 pkg_name=${1##*/} pkg_name=${pkg_name%[#@]*}
|
*.tar.*)
|
||||||
|
[ -f "$1" ] || die "File '$1' does not exist"
|
||||||
|
|
||||||
elif pkg_cache "$1" 2>/dev/null; then
|
tar_file=$1
|
||||||
pkg_name=$1
|
pkg_name=${1##*/}
|
||||||
|
pkg_name=${pkg_name%@*}
|
||||||
|
;;
|
||||||
|
|
||||||
else
|
*)
|
||||||
case $1 in
|
pkg_cache "$1" || die "$1" "Not yet built"
|
||||||
*.tar.*) die "Tarball '$1' does not exist" ;;
|
pkg_name=$1
|
||||||
*) die "Package '$1' has not yet been built"
|
;;
|
||||||
esac
|
esac
|
||||||
fi
|
|
||||||
|
|
||||||
mkdir -p "$tar_dir/$pkg_name"
|
mkdir -p "$tar_dir/$pkg_name"
|
||||||
cd "$tar_dir/$pkg_name"
|
cd "$tar_dir/$pkg_name"
|
||||||
|
Loading…
Reference in New Issue
Block a user