dvdrip: Leave a note in the working directory about which device we're using.
authorMark Wooding <mdw@distorted.org.uk>
Sun, 6 Mar 2022 01:08:27 +0000 (01:08 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Sun, 6 Mar 2022 01:08:27 +0000 (01:08 +0000)
dvdrip

diff --git a/dvdrip b/dvdrip
index a4b5900..734b00f 100755 (executable)
--- a/dvdrip
+++ b/dvdrip
@@ -95,6 +95,9 @@ info "copying \`$discid'"
 echo "$discid" >"$tmp/$tag/discid.new"
 mv "$tmp/$tag/discid.new" "$tmp/$tag/discid"
 
+echo "$dev" >"$tmp/$tag/device.new"
+mv "$tmp/$tag/device.new" "$tmp/$tag/device"
+
 accumulate_badblocks () {
   if [ -f "$tmp/$tag/badblocks.new" ]; then
     if [ ! -f "$tmp/$tag/badblocks" ]; then
@@ -143,12 +146,14 @@ if [ ! -f "$tmp/$tag/iso" ]; then
       -b"$tmp/$tag/badblocks.new" "$@" "$dev" "$tmp/$tag/iso.new"
   run mv "$tmp/$tag/iso.new" "$tmp/$tag/iso"
   accumulate_badblocks
+  rm -f "$tmp/$tag/device"
   case $retry in t) rm -f "$tmp/$tag/badblocks.retry" ;; esac
   if [ -f "$tmp/$tag/badblocks" ]; then
     fail "bad sectors found: check \`$tmp/$tag/iso', run again if ok"
   fi
 fi
 
+rm -f "$tmp/$tag/device"
 run mv "$tmp/$tag/dest.new" "$tmp/$tag/dest"
 if [ -f "$tmp/$tag/eject" ]; then eject=t; else eject=nil; fi
 if [ -f "$tmp/$tag/ding" ]; then ding=t; else ding=nil; fi