diff options
author | olpc user <olpc@xo-5d-f7-86.localdomain> | 2020-01-10 08:56:26 -0800 |
---|---|---|
committer | olpc user <olpc@xo-5d-f7-86.localdomain> | 2020-01-10 08:56:26 -0800 |
commit | 739f7227a94a909feddc2f4bfe7eb642df6152dd (patch) | |
tree | 589956d866a3bcf1e3d62ebaf0c5c31519fffb51 | |
parent | 255f8d488848719de303f3fc4614e419c2aaecd7 (diff) | |
download | standingwithresilience-739f7227a94a909feddc2f4bfe7eb642df6152dd.tar.gz standingwithresilience-739f7227a94a909feddc2f4bfe7eb642df6152dd.zip |
fix bug preventing upload, attempt
-rwxr-xr-x | git-maintenance/store.sh | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/git-maintenance/store.sh b/git-maintenance/store.sh index f40dfb7..8dba270 100755 --- a/git-maintenance/store.sh +++ b/git-maintenance/store.sh @@ -67,20 +67,25 @@ for packfile in objects/pack/*.pack do $TAR -cv "$packfile" > "$tmpfile" fn="$({ cat "$packfile"; echo -n "$RESPECT"; } | sha256sum | cut -f 1 -d ' ')".aes + skipmove=0 if [ -e encrypted/"$fn" ] then echo "$fn ALREADY EXISTS LOCALLY ($packfile)" if [ "$(cat "$packfile" | sha256sum)" = "$(decrypt < encrypted/"$fn" | $TAR -xvOf - "$packfile" | sha256sum)" ] then echo "$fn MATCHES CONTENT LOCALLY ($packfile)" + skipmove=1 else echo "$fn DOESN'T MATCH LOCAL CONTENT ($packfile)" - encrypt < "$tmpfile" > "$tmpfile".aes - mv "$tmpfile".aes encrypted/"$fn" fi else echo "$fn IS NEW LOCALLY ($packfile)" fi + if ! (( skipmove )) + then + encrypt < "$tmpfile" > "$tmpfile".aes + mv "$tmpfile".aes encrypted/"$fn" + fi # need to decrypt to compare content. if [ "$(curl "$URLPFX"/"$fn" | decrypt | $TAR -xvOf - "$packfile" | sha256sum)" = "$(cat "$packfile" | sha256sum)" ]; then echo "$fn MATCHES DOWNLOAD CONTENT ($packfile)" |