0,t) warn "output file already exists; will overwrite" ;;
esac
+accumulate_badblocks () {
+ if [ -f "$tmp/$tag/badblocks.new" ]; then
+ if [ ! -f "$tmp/$tag/badblocks" ]; then
+ { echo "## bad-blocks region map"; echo; } >"$tmp/$tag/badblocks"
+ fi
+ sed -n "/^[^#]/p" "$tmp/$tag/badblocks.new" >>"$tmp/$tag/badblocks"
+ rm "$tmp/$tag/badblocks.new"
+ fi
+}
+
mkdir -p "$tmp/$tag"
case $backup in
t)
;;
nil)
if [ ! -f "$tmp/$tag/iso" ]; then
- run_setrc "$DVD_SECTOR_COPY" -c -b"$tmp/$tag/badblocks" \
+ accumulate_badblocks
+ run_setrc "$DVD_SECTOR_COPY" -c -b"$tmp/$tag/badblocks.new" \
"$dev" "$tmp/$tag/iso.new"
+ accumulate_badblocks
case $rc in
0)
run mv "$tmp/$tag/iso.new" "$tmp/$tag/iso"