Handle case where a sha256sums might contain previous kmods/. In such
case packages.adb for previous kmods/ needs to be skipped as not
included in the sign tar and already signed by previous runs.
Skip is limited to kmods/ entry as those are the only entry expected to
be present in the sha256sums but not included in sign tar.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
grep 'packages\.adb' sha256sums | while IFS= read -r line; do
filename="${line#*' *'}"
+ # Skip updating hash of previous kmods/ if not found in sign tar (already signed)
+ [ ! -f "$filename" ] && [[ "$filename" == kmods/* ]] && continue
escaped_filename="${filename//\//\\\/}"
escaped_filename="${escaped_filename//&/\\&}"
checksum_output=$(sha256sum --binary -- "$filename")