From dbed17a19b07578f42e663a4bd441e0390fc0dbb Mon Sep 17 00:00:00 2001 From: Elliu <elliu@hashi.re> Date: Sat, 10 Sep 2022 00:36:00 +0200 Subject: [PATCH] Properly update checksums --- stpkg | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/stpkg b/stpkg index 9aff73e..0a1a554 100755 --- a/stpkg +++ b/stpkg @@ -766,11 +766,15 @@ __pack() { for i in `cat $TEMP_CHECK | grep ': OK$' | sed 's/\(.*\): OK/\1/'`; do if [ "x$i" = "x" ]; then continue; fi + echo "$FILE is OK" if [ "x$STPKG_REUPLOAD_SAME_FILE" = "xyes" ]; then + echo "$FILE is updated" updatedFiles["$i"]="${hashes["$i"]}" else + echo "$FILE is unchanged" unchangedFiles["$i"]="${hashes["$i"]}" fi + echo "unset $FILE" unset hashes["$i"] skipFiles[$i]="" done @@ -801,13 +805,12 @@ __pack() { elif [[ -v deletedFiles[$FILE] ]]; then STICKER_STATUS="Deleted" ST_JSON=`jq ".stickers[] | select(.body == \"$STICKER_NAME\")" < "$DEST_INDEX"` - #TODO: remove checksum - #TODO: Don't print "," - + #TODO: remove from checksum? else if [[ -v updatedFiles[$FILE] ]]; then STICKER_STATUS="Updated" #TODO: deleted old checksum + sed -i "/[0-9a-f]\{32\} $FILE/d" $SUM_FILE else STICKER_STATUS="New" if [[ "`md5sum $FILE | sed -e 's/\([0-9a-f]\{32\}\) .*$/\1/'`" = "$(cat $SUM_FILE | grep "$FILE" | sed -e 's/\([0-9a-f]\{32\}\) .*$/\1/')" ]]; then -- GitLab