echo "-w <comment>"
echo " Add a comment to the CD tracks"
echo "-W <#> Contatenate CDs: -T #01 -w \"CD #\""
+echo "-z Use debug CDROMREADERSYNTAX option (needs cdparanoia)"
echo ""
echo "Tracks is a space-delimited list of tracks to grab."
echo "Ranges specified with hyphens are allowed (i.e., 1-5)."
fi
}
+# chechwarnings [blurb]
+# Returns "0" if the blurb was found (meaning there was an warning),
+# returns 1 if it wasn't (yes this is a little backwards).
+# Does not print the blurb on stdout.
+# Otherwise, returns "".
+checkwarnings ()
+{
+ if [ -e "$ABCDETEMPDIR/warnings" ]; then :; else
+ return 1
+ fi
+ # Take the last line in the status file if there's multiple matches
+ PATTERN="^$1(:.*)?$"
+ BLURB="$(egrep $PATTERN "$ABCDETEMPDIR/warnings" | tail -n 1)"
+
+ if [ -z "$BLURB" ]; then
+ # negative, we did not have a negative...
+ return 1
+ else
+ # affirmative, we had a negative...
+ return 0
+ fi
+}
+
# checkerrors [blurb]
# Returns "0" if the blurb was found (meaning there was an error),
# returns 1 if it wasn't (yes this is a little backwards).
mp3)
case "$MP3ENCODERSYNTAX" in
# FIXME # check if mp3enc needs -if for pipes
+ # FIXME # I have not been able to find a working mp3enc binary
mp3enc)
FILEARG="-if $IN"
;;
do
MP3FILES="$TRACKFILES track$UTRACKNUM.mp3"
done
- # XXX: Hard-coded batch option!
+ # FIXME # Hard-coded batch option!
$NORMALIZER -b $NORMALIZEROPTS $TRACKFILES
RETURN=$?
if [ "$RETURN" != "0" ]; then
case $OUTPUT in
wav)
if [ "$DOCLEAN" != "y" ] && [ "$FORCE" != "y" ]; then
- ### FIXME ### introduce warnings?
+ # FIXME # introduce warnings?
:
else
# mkdir -p shouldn't return an error if the directory already exists
# Create a proper CUE file based on the CUE file we created before.
do_cleancue()
{
- # FIXME # we can get the name of the cuefile from the status file
if CUEFILE_IN="$ABCDETEMPDIR"/$(checkstatus cuefile); then
CUEFILE_OUT=$CUEFILE_IN.out
### FIXME ### checkstatus cddb
exit 1
fi
;;
- z) echo "Placeholder for a future autodebug option" ;;
+ z) CDROMREADERSYNTAX=debug ; EJECTCD="n" ;;
?) usage; exit ;;
esac
done
DOCLEAN=n
fi
# Check if we have moved all the formats we had previously encoded, if we are not using the FORCE.
-if [ ! "$FORCE" = "y" ]; then
- ENCODED_FORMATS=$(egrep ^encodetrack-(.{3,6})-(.{1,2})$ "$ABCDETEMPDIR/status" | cut -d"-" -f2 | sort -u | tr '\n' '|')
- MOVED_FORMATS=$(egrep ^movetrack-output-(.{3,6})$ "$ABCDETEMPDIR/status" | cut -d"-" -f2 | sort -u | tr '\n' '|')
+if [ "$DOCLEAN" = "y" ] && [ ! "$FORCE" = "y" ]; then
+ ENCODED_FORMATS=$(egrep "^encodetrack-(.{3,6})-(.{1,2})$" "$ABCDETEMPDIR/status" | cut -d"-" -f2 | sort -u | tr '\n' '|')
+ MOVED_FORMATS=$(egrep "^movetrack-output-(.{3,6})$" "$ABCDETEMPDIR/status" | cut -d"-" -f3 | sort -u | tr '\n' '|')
if [ "$ENCODED_FORMATS" != "$MOVED_FORMATS" ]; then
echo "Not all encoded formats have been requested to be moved."
echo "Use \"-a clean -f -C $DISCID\" to force the removal of the remaining data."
+ DOCLEAN=n
+ fi
fi
if [ "$DOCLEAN" = "y" ]; then
# Wipe all the evidence