X-Git-Url: https://git.hcoop.net/clinton/abcde.git/blobdiff_plain/a1d79009e6196e64d1b369db28ea1eabe477081e..7172fbaf157358a6a5788460a2fdbd0bf454bae3:/abcde diff --git a/abcde b/abcde index acbe4bf..3d69a30 100755 --- a/abcde +++ b/abcde @@ -2974,10 +2974,23 @@ do_cdspeed () # vecho [message] # -# vecho outputs a message if EXTRAVERBOSE is selected +# vecho outputs a message if EXTRAVERBOSE is 1 or more vecho () { -if [ x"$EXTRAVERBOSE" != "x" ]; then +if [ x"$EXTRAVERBOSE" != "x" ] && [ $EXTRAVERBOSE -gt 0 ] ; then + case $1 in + warning) shift ; log warning "$@" ;; + *) echo "$@" ;; + esac +fi +} + +# vvecho [message] +# +# vvecho outputs a message if EXTRAVERBOSE is 2 or more +vvecho () +{ +if [ x"$EXTRAVERBOSE" != "x" ] && [ $EXTRAVERBOSE -gt 1 ] ; then case $1 in warning) shift ; log warning "$@" ;; *) echo "$@" ;; @@ -3294,15 +3307,29 @@ if [ "$CDROM" = "" ] ; then CDROM=/dev/cdroms/cdrom0 elif [ -e /dev/cdrom ]; then CDROM=/dev/cdrom + elif [ -e /dev/sr0 ]; then + CDROM=/dev/sr0 elif [ -e /dev/cd0c ]; then CDROM=/dev/cd0c elif [ -e /dev/acd0c ]; then CDROM=/dev/acd0c elif [ -e /dev/disk1 ]; then CDROM=/dev/disk1 + elif [ "$OSFLAVOUR" = "OSX" ] && [[ $(diskutil list) =~ CD_part.*(disk.)$'\n' ]]; then + CDROM=/dev/${BASH_REMATCH[1]} fi fi +# We used to use EXTRAVERBOSE=y to turn on more debug output. Now +# that's changed to a number to allow for more control. If +# EXTRAVERBOSE=y, set it to 1 for backwards compatibility. +if [ "$EXTRAVERBOSE" = "y" ]; then + EXTRAVERBOSE=1 +fi +if [ "$EXTRAVERBOSE" = "n" ]; then + EXTRAVERBOSE=0 +fi + # Parse command line options #while getopts 1a:bc:C:d:Dehj:klLmMnNo:pPq:r:Rs:S:t:T:vVxw:W: opt ; do while getopts 1a:bBc:C:d:Defghj:klLmMnNo:pPq:r:s:S:t:T:UvVxX:w:W:z opt ; do @@ -3347,7 +3374,7 @@ while getopts 1a:bBc:C:d:Defghj:klLmMnNo:pPq:r:s:S:t:T:UvVxX:w:W:z opt ; do echo "abcde -h for extra help" exit ;; - V) EXTRAVERBOSE="y" ;; + V) EXTRAVERBOSE=$(($EXTRAVERBOSE + 1)) ;; x) EJECTCD="y" ;; X) CUE2DISCID="$OPTARG" ;; w) COMMENT="$OPTARG" ;; @@ -3908,7 +3935,7 @@ fi # Make sure a buncha things exist for X in $CDROMREADER $CDDISCID ${NEEDTAGGER+$TAGGER} $MP3ENCODER \ $OGGENCODER $FLACENCODER $SPEEXENCODER $MPPENCODER \ - $AACENCODER \ + $AACENCODER $CDDBTOOL \ ${NEEDATOMICPARSLEY+$ATOMICPARSLEY} \ ${NEEDHTTPGET+$HTTPGET} ${NEEDDISTMP3+$DISTMP3} \ ${NEEDCOMMENTER+$VORBISCOMMENT} ${NEEDMETAFLAC+$METAFLAC} \