+ Add suggested diskutil code to auto-detect the CD on OS X.
authorSteve McIntyre <steve@einval.com>
Thu, 19 Apr 2012 16:31:38 +0000 (16:31 +0000)
committerSteve McIntyre <steve@einval.com>
Thu, 19 Apr 2012 16:31:38 +0000 (16:31 +0000)
      Closes issue 45.

abcde
changelog

diff --git a/abcde b/abcde
index 31f9c48..975bff3 100755 (executable)
--- a/abcde
+++ b/abcde
@@ -3302,6 +3302,8 @@ if [ "$CDROM" = "" ] ; 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
 
index a641baf..381c1c2 100644 (file)
--- a/changelog
+++ b/changelog
@@ -17,6 +17,8 @@ abcde 2.5.1 UNRELEASED
   * Updates for CD device detection:
     + Look for /dev/sr0, in case /dev/cdrom doesn't exist.
       Closes issue 52.
+    + Add suggested diskutil code to auto-detect the CD on OS X.
+      Closes issue 45.
 
   [ Colin Tuckley ]
   * replace deprecated egrep with grep -E (Closes issue 24).