From 4103bae6d29b50d2dabb7af7be7676b705944da2 Mon Sep 17 00:00:00 2001 From: davidovski Date: Sun, 20 Mar 2022 10:46:08 +0000 Subject: added file validation --- src/validate.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/validate.sh') diff --git a/src/validate.sh b/src/validate.sh index 42530bb..0c9dd2d 100644 --- a/src/validate.sh +++ b/src/validate.sh @@ -56,3 +56,20 @@ keyimport () { esac set +o noglob } + +validate_files () { + local package=$1 + local ret=0 + + # TODO ensure that all checksums are the same + for file in $(files $package); do + if [ -f "${SYSROOT}$file" ]; then + ${VERBOSE} && printf "${GREEN}%s is present\n" $file + else + ret=$((ret+1)) + ${QUIET} || printf "${RED}%s is missing\n" $file + fi + done + ${QUIET} || printf "${RESET}" + return $ret +} -- cgit v1.2.1