kiss: Split on all invocations of pkg_find_version

This commit is contained in:
Dylan Araps 2021-07-16 11:59:51 +03:00
parent a191caba07
commit 0427d9cfa6
No known key found for this signature in database
GPG Key ID: 13295DAC2CF13B5C
1 changed files with 5 additions and 7 deletions

12
kiss
View File

@ -206,12 +206,10 @@ pkg_find_version() {
read -r repo_ver repo_rel 2>/dev/null < "$repo_dir/version" ||
die "$1" "Failed to read version file ($repo_dir/version)"
case $2 in 1)
# Split the version on '.+-_' to obtain individual components.
IFS=.+-_ read -r repo_major repo_minor repo_patch repo_ident <<EOF
# Split the version on '.+-_' to obtain individual components.
IFS=.+-_ read -r repo_major repo_minor repo_patch repo_ident <<EOF
$repo_ver
EOF
esac
}
pkg_find_die() {
@ -368,7 +366,7 @@ pkg_source_resolve() {
pkg_source() {
# Download any remote package sources. The existence of local files is
# also checked.
pkg_find_version "$1" 1
pkg_find_version "$1"
# Support packages without sources. Simply do nothing.
[ -f "$repo_dir/sources" ] || return 0
@ -820,7 +818,7 @@ pkg_build_all() {
for pkg do
log "$pkg" "Building package ($((_build_cur+=1))/${_build_tot:=$#})"
pkg_find_version "$pkg" 1
pkg_find_version "$pkg"
# arg1: pre-extract
# arg2: package name
@ -1792,7 +1790,7 @@ args() {
c|checksum)
for pkg do pkg_source "$pkg" c; done
for pkg do
pkg_find_die "$pkg"
pkg_find_version "$pkg"
[ -f "$repo_dir/sources" ] || {
log "$pkg" "No sources file, skipping checksums"