From 861c3824fb4801c9952bd10fcb2369307f355e7b Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Sat, 19 Feb 2022 19:06:25 +0000 Subject: [PATCH] dvdrip: Prepare the `dest' file early, so that it can be edited. --- dvdrip | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 -- 2.11.0