diff options
author | davidovski <david@davidovski.xyz> | 2022-03-20 10:46:08 +0000 |
---|---|---|
committer | davidovski <david@davidovski.xyz> | 2022-03-20 10:46:08 +0000 |
commit | 4103bae6d29b50d2dabb7af7be7676b705944da2 (patch) | |
tree | 863cc298e969bb8259ee3a403f7a9b2ef5d2dec1 /src/validate.sh | |
parent | eac3c122678d19e090742d01e348d800d358733a (diff) |
added file validation
Diffstat (limited to 'src/validate.sh')
-rw-r--r-- | src/validate.sh | 17 |
1 files changed, 17 insertions, 0 deletions
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 +} |