aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormerakor <cem@ckyln.com>2021-07-30 10:43:47 +0000
committermerakor <cem@ckyln.com>2021-07-30 10:43:47 +0000
commit0bbaf7b214ed9a6e2c4788ab3987ef21d6ae62e1 (patch)
tree36c1e9fa05a28a36d8d51cd06c67134b659d5ec1
parent69011919790dd64568e91563659e57a77452b002 (diff)
downloadcpt-0bbaf7b214ed9a6e2c4788ab3987ef21d6ae62e1.tar.gz
cpt-checksum: use pkg_find once per loop
FossilOrigin-Name: 909ee2ee48fcda24b75f9ae8e49c6f61cbbb2bc91d9390152d7ddbce65f36a33
-rwxr-xr-xsrc/cpt-checksum4
1 files 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"