Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
kiss: Split on all invocations of pkg_find_version
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanaraps committed Jul 16, 2021
1 parent a191cab commit 0427d9c
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions kiss
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 0427d9c

Please sign in to comment.