aboutsummaryrefslogtreecommitdiff
path: root/src/cpt-checksum
diff options
context:
space:
mode:
authormerakor <cem@ckyln.com>2021-07-30 10:39:56 +0000
committermerakor <cem@ckyln.com>2021-07-30 10:39:56 +0000
commit69011919790dd64568e91563659e57a77452b002 (patch)
treef8a487d910e41209ee29d0516d330f7c99f92389 /src/cpt-checksum
parentab960e47945033bea128474a255ccf52ea1ddf6c (diff)
downloadcpt-69011919790dd64568e91563659e57a77452b002.tar.gz
cpt-checksum: don't generate checksums file if no sources exist
FossilOrigin-Name: ba75b770884c705c81be7e47cc2d697bd2b2971ae9ae14985873d795c20ad5f6
Diffstat (limited to 'src/cpt-checksum')
-rwxr-xr-xsrc/cpt-checksum7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/cpt-checksum b/src/cpt-checksum
index 5c6de52..951eb34 100755
--- a/src/cpt-checksum
+++ b/src/cpt-checksum
@@ -13,8 +13,13 @@ create_cache
for pkg; do pkg_lint "$pkg" c; done
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" ] || {
+ log "$pkg" "No 'sources' file, skipping checksums"
+ continue
+ }
pkg_checksums "$pkg" | {
repo_dir=$(pkg_find "$pkg")