From: Mark Wooding Date: Sat, 19 Feb 2022 19:06:25 +0000 (+0000) Subject: dvdrip: Prepare the `dest' file early, so that it can be edited. X-Git-Url: https://git.distorted.org.uk/~mdw/dvdrip/commitdiff_plain/861c3824fb4801c9952bd10fcb2369307f355e7b dvdrip: Prepare the `dest' file early, so that it can be edited. --- diff --git a/dvdrip b/dvdrip index 5c1e72b..250e642 100755 --- a/dvdrip +++ b/dvdrip @@ -128,6 +128,13 @@ accumulate_badblocks () { } mkdir -p "$tmp/$tag" +any=nil +for i in "$tmp/$tag/dest.new" "$tmp/$tag/dest" "$tmp/$tag/dest.seen"; do + if [ -f "$tmp/$tag/dest.new" ]; then any=t; fi +done +case $any in + nil) printf "%s\n" "${sub+$sub/}$out.iso" >"$tmp/$tag/dest.new" ;; +esac case $backup in t) if [ ! -d "$tmp/$tag/rip" ]; then @@ -162,7 +169,6 @@ case $backup in fi ;; esac -printf "%s\n" "${sub+$sub/}$out.iso" >"$tmp/$tag/dest.new" mv "$tmp/$tag/dest.new" "$tmp/$tag/dest" run "$DVDRIP_UPLOAD" case $eject in t) run eject "$dev" ;; esac