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

8
kiss
View File

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