kiss: new naming scheme for tarballs

This commit is contained in:
Dylan Araps 2020-11-06 08:34:36 +02:00
parent 117605b88a
commit dd4204d6e2
No known key found for this signature in database
GPG Key ID: 46D62DD9F1DE636E
1 changed files with 9 additions and 5 deletions

14
kiss
View File

@ -170,13 +170,17 @@ pkg_list() {
pkg_cache() {
# Find the tarball of a package using a glob. Use the first found match
# of '<pkg_name>#<pkg_version><pkg_release>.tar.*'.
# of '<pkg_name>[#@]<pkg_version><pkg_release>.tar.*'.
read -r version release 2>/dev/null < "$(pkg_find "$1")/version"
set +f; set -f -- "$bin_dir/$1#$version-$release.tar."*
set +f
set -f -- "$bin_dir/$1"[#@]"$version-$release.tar."*
[ -f "$2" ] && shift
tar_file=$1
[ -f "$tar_file" ]
[ -f "$1" ]
}
pkg_sources() {
@ -547,7 +551,7 @@ pkg_tar() (
lz) lzip -z ;;
xz) xz -zT 0 ;;
zst) zstd -z ;;
esac > "$bin_dir/$1#$version-$release.tar.${KISS_COMPRESS:=gz}"
esac > "$bin_dir/$1@$version-$release.tar.${KISS_COMPRESS:=gz}"
log "$1" "Successfully created tarball"
run_hook post-package "$1"
@ -1144,7 +1148,7 @@ 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%#*}
tar_file=$1 pkg_name=${1##*/} pkg_name=${pkg_name%[#@]*}
elif pkg_cache "$1" 2>/dev/null; then
pkg_name=$1