aboutsummaryrefslogtreecommitdiff
path: root/kiss
diff options
context:
space:
mode:
authordylan.araps@gmail.com <dylan.araps@gmail.com>2020-02-08 18:36:57 +0000
committerdylan.araps@gmail.com <dylan.araps@gmail.com>2020-02-08 18:36:57 +0000
commitc856391f0fce5dbc1e00b5c150dcd008ca86654b (patch)
tree7960860c5cc6cb86a42d17d841c2e4a133069c28 /kiss
parentef34ceb7bfb2cd81b824747bc9a851a3a82535a9 (diff)
downloadcpt-c856391f0fce5dbc1e00b5c150dcd008ca86654b.tar.gz
kiss: clean up
FossilOrigin-Name: 96fe3e1a0ad2b2ecfc520812b1e9683307476fd0dc175c84d3fede0820867e49
Diffstat (limited to 'kiss')
-rwxr-xr-xkiss56
1 files changed, 23 insertions, 33 deletions
diff --git a/kiss b/kiss
index 9132c47..5f25436 100755
--- a/kiss
+++ b/kiss
@@ -92,6 +92,8 @@ pkg_lint() {
read -r _ release < version
[ "$release" ] || die "Release field not found in version file"
+
+ [ "$2" ] || [ -f checksums ] || die "$pkg" "Checksums are missing"
}
pkg_find() {
@@ -548,39 +550,9 @@ pkg_build() {
done
for pkg; do pkg_lint "$pkg"; done
- for pkg; do
- # Ensure that checksums exist prior to building the package.
- [ -f "$(pkg_find "$pkg")/checksums" ] || {
- log "$pkg" "Checksums are missing"
-
- # Instead of dying above, log it to the terminal. Also define a
- # variable so we *can* die after all checksum files have been
- # checked.
- no_sums="$no_sums$pkg "
- }
- done
-
- # Die here as packages without checksums were found above.
- [ "$no_sums" ] && die "Checksums missing, run 'kiss checksum ${no_sums% }'"
-
for pkg; do pkg_sources "$pkg"; done
- # Verify all package checksums. This is achieved by generating
- # a new set of checksums and then comparing those with the old
- # set.
- for pkg; do
- pkg_checksums "$pkg" | cmp -s - "$(pkg_find "$pkg")/checksums" || {
- log "$pkg" "Checksum mismatch"
-
- # Instead of dying above, log it to the terminal. Also define a
- # variable so we *can* die after all checksum files have been
- # checked.
- mismatch="$mismatch$pkg "
- }
- done
-
- # Die here as packages with differing checksums were found above.
- [ "$mismatch" ] && die "Checksum mismatch with: ${mismatch% }"
+ pkg_verify "$@"
# Finally build and create tarballs for all passed packages and
# dependencies.
@@ -599,7 +571,7 @@ pkg_build() {
log "$pkg" "Starting build"
- if [ "$KISS_HOOK" ]; then
+ if [ "$KISS_HOOK" ]; then
log "$pkg" "Running pre-build hook"
TYPE=pre-build PKG=$pkg DEST=$pkg_dir/$pkg . "$KISS_HOOK"
fi
@@ -707,6 +679,24 @@ pkg_checksums() {
done < "$repo_dir/sources"
}
+pkg_verify() {
+ # Verify all package checksums. This is achieved by generating
+ # a new set of checksums and then comparing those with the old
+ # set.
+ for pkg; do
+ pkg_checksums "$pkg" | cmp -s - "$(pkg_find "$pkg")/checksums" || {
+ log "$pkg" "Checksum mismatch"
+
+ # Instead of dying above, log it to the terminal. Also define a
+ # variable so we *can* die after all checksum files have been
+ # checked.
+ mismatch="$mismatch$pkg "
+ }
+ done
+
+ [ -z "$mismatch" ] || die "Checksum mismatch with: ${mismatch% }"
+}
+
pkg_conflicts() {
# Check to see if a package conflicts with another.
log "$2" "Checking for package conflicts"
@@ -1255,7 +1245,7 @@ args() {
;;
c|checksum)
- for pkg; do pkg_lint "$pkg"; done
+ for pkg; do pkg_lint "$pkg" c; done
for pkg; do pkg_sources "$pkg" c; done
for pkg; do
pkg_checksums "$pkg" > "$(pkg_find "$pkg")/checksums"