From 0bbaf7b214ed9a6e2c4788ab3987ef21d6ae62e1 Mon Sep 17 00:00:00 2001 From: merakor Date: Fri, 30 Jul 2021 10:43:47 +0000 Subject: cpt-checksum: use pkg_find once per loop FossilOrigin-Name: 909ee2ee48fcda24b75f9ae8e49c6f61cbbb2bc91d9390152d7ddbce65f36a33 --- src/cpt-checksum | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cpt-checksum b/src/cpt-checksum index 951eb34..619aad2 100755 --- a/src/cpt-checksum +++ b/src/cpt-checksum @@ -16,12 +16,12 @@ for pkg; do pkg_sources "$pkg" c; done for pkg; do # Do not generate checksums if the 'sources' file is empty or it doesn't # exist. - [ -s "$(pkg_find "$pkg")/sources" ] || { + repo_dir=$(pkg_find "$pkg") + [ -s "$repo_dir/sources" ] || { log "$pkg" "No 'sources' file, skipping checksums" continue } pkg_checksums "$pkg" | { - repo_dir=$(pkg_find "$pkg") if [ -w "$repo_dir" ]; then tee "$repo_dir/checksums" -- cgit v1.2.3