mirror of
https://codeberg.org/kiss-community/kiss
synced 2024-09-28 12:22:39 -06:00
kiss: don't run some functions unless needed
This commit is contained in:
parent
0832390955
commit
5d024096c7
34
kiss
34
kiss
@ -423,12 +423,13 @@ pkg_extract() {
|
|||||||
# local repository files.
|
# local repository files.
|
||||||
#
|
#
|
||||||
# NOTE: repo_dir comes from caller.
|
# NOTE: repo_dir comes from caller.
|
||||||
|
|
||||||
# Support packages without sources. Simply do nothing.
|
|
||||||
[ -f "$repo_dir/sources" ] || return 0
|
|
||||||
|
|
||||||
log "$1" "Extracting sources"
|
log "$1" "Extracting sources"
|
||||||
|
|
||||||
|
# arg1: pre-extract
|
||||||
|
# arg2: package name
|
||||||
|
# arg3: path to DESTDIR
|
||||||
|
run_hook pre-extract "$pkg" "$pkg_dir/$pkg"
|
||||||
|
|
||||||
while read -r src dest || [ "$src" ]; do
|
while read -r src dest || [ "$src" ]; do
|
||||||
pkg_source_resolve "$1" "$src" "$dest" >/dev/null
|
pkg_source_resolve "$1" "$src" "$dest" >/dev/null
|
||||||
|
|
||||||
@ -819,7 +820,8 @@ pkg_build_all() {
|
|||||||
|
|
||||||
for pkg do
|
for pkg do
|
||||||
pkg_source "$pkg"
|
pkg_source "$pkg"
|
||||||
pkg_verify "$pkg"
|
|
||||||
|
! [ -f "$repo_dir/sources" ] || pkg_verify "$pkg"
|
||||||
done
|
done
|
||||||
|
|
||||||
# Finally build and create tarballs for all passed packages and
|
# Finally build and create tarballs for all passed packages and
|
||||||
@ -835,12 +837,8 @@ pkg_build_all() {
|
|||||||
# arg4: total in queue
|
# arg4: total in queue
|
||||||
run_hook queue "$pkg" "$((_build_cur += 1))" "$#"
|
run_hook queue "$pkg" "$((_build_cur += 1))" "$#"
|
||||||
|
|
||||||
# arg1: pre-extract
|
! [ -f "$repo_dir/sources" ] || pkg_extract "$pkg"
|
||||||
# arg2: package name
|
|
||||||
# arg3: path to DESTDIR
|
|
||||||
run_hook pre-extract "$pkg" "$pkg_dir/$pkg"
|
|
||||||
|
|
||||||
pkg_extract "$pkg"
|
|
||||||
pkg_build "$pkg"
|
pkg_build "$pkg"
|
||||||
pkg_strip "$pkg"
|
pkg_strip "$pkg"
|
||||||
pkg_manifest "$pkg"
|
pkg_manifest "$pkg"
|
||||||
@ -957,8 +955,6 @@ pkg_verify() {
|
|||||||
# NOTE: repo_dir comes from caller.
|
# NOTE: repo_dir comes from caller.
|
||||||
log "$1" "Verifying sources"
|
log "$1" "Verifying sources"
|
||||||
|
|
||||||
[ -f "$repo_dir/sources" ] || return 0
|
|
||||||
|
|
||||||
# Generate a new set of checksums to compare against.
|
# Generate a new set of checksums to compare against.
|
||||||
pkg_checksums "$1" > /dev/null
|
pkg_checksums "$1" > /dev/null
|
||||||
|
|
||||||
@ -1753,20 +1749,20 @@ args() {
|
|||||||
for pkg do
|
for pkg do
|
||||||
pkg_source "$pkg" c
|
pkg_source "$pkg" c
|
||||||
|
|
||||||
[ -f "$repo_dir/sources" ] || {
|
[ -f "$repo_dir/sources" ] || continue
|
||||||
log "$pkg" "No sources file, skipping checksums"
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
pkg_checksums "$pkg"
|
pkg_checksums "$pkg"
|
||||||
|
|
||||||
[ "$_hash" ] || {
|
case $_hash in
|
||||||
|
'')
|
||||||
log "$pkg" "No sources needing checksums"
|
log "$pkg" "No sources needing checksums"
|
||||||
continue
|
;;
|
||||||
}
|
|
||||||
|
|
||||||
|
*)
|
||||||
printf '%s\n' "$_hash" > "$repo_dir/checksums"
|
printf '%s\n' "$_hash" > "$repo_dir/checksums"
|
||||||
log "$pkg" "Generated checksums"
|
log "$pkg" "Generated checksums"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
done
|
done
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user