diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2022-07-14 01:30:19 -0600 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2022-07-14 01:30:19 -0600 |
commit | 3acca04bb629e0f898f022fbbcaad78815aaaee3 (patch) | |
tree | 9afdd5b160ea9199ac4ed0fce8d8389155db9658 /scripts/main.sh | |
parent | 7153fc9379dd5910c688925ccd2e0a03b9551a6d (diff) |
have rebuilding the mappings use the scan-for-nodes result
Diffstat (limited to 'scripts/main.sh')
-rwxr-xr-x | scripts/main.sh | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/scripts/main.sh b/scripts/main.sh index e8d006d..a9afde3 100755 --- a/scripts/main.sh +++ b/scripts/main.sh @@ -1,7 +1,11 @@ #!/bin/bash -set -e +set -ex go build ./cmd/btrfs-rec if ! test -s ../scratch/dump.scan-for-nodes.json; then - time ./btrfs-rec --pv=../scratch/dump-zero.img inspect scan-for-nodes > ../scratch/dump.scan-for-nodes.json || - { r=$?; rm -f ../scratch/dump.scan-for-nodes.json; exit $r; } + time ./btrfs-rec --pv=../scratch/dump-zero.img inspect scan-for-nodes > ../scratch/dump.scan-for-nodes.json +fi +if ! test -s ../scratch/dump.rebuilt-mappings.json; then + time ./btrfs-rec --pv=../scratch/dump-zero.img inspect rebuild-mappings ../scratch/dump.scan-for-nodes.json \ + > ../scratch/dump.rebuilt-mappings.json \ + 2> >(tee >&2 ../scratch/dump.rebuilt-mappings.log) fi |