#! /bin/sh
# patch ybin line 1595
OFPATH="/usr/sbin/ofpath"

# test cases
for macos in	"/dev/sdc7" \
		"/dev/disk/by-id/scsi-SATA_SAMSUNG_SV1204H0504J1BW706040-part7" \
 		"/pci@80000000/pci-bridge@d/pci-ata@1/@0/@0:7" \
		"hd:7"
do
echo "test-ybin-patch1:${macos}"

# from ybin line 644:
	case "$macos" in
	    /dev/*)

# line 1595 from ybin, now sorted into convertpath(): 
macos="`readlink -f \"$(eval echo ${macos})\"`"

echo "test-ybin-patch2:${macos}"

		[ "$VERBOSE" = 1 ] && echo "$PRG: Finding OpenFirmware device path to \`$macos'..."
		local smacos="$macos"
		macos="$($OFPATH $macos)"
		if [ $? != 0 ] ; then
		    echo 1>&2 "$PRG: Unable to determine OpenFirmware path for macos=$smacos"
		    echo 1>&2 "$PRG: Try specifying the real OpenFirmware path for macos=$smacos in $CONF"
		    local CONVERR=1
		fi
		[ "$DEBUG" = 1 ] && echo 1>&2 "$PRG: DEBUG: macos set to \`$macos' from \`$smacos'"
		;;
	    *)
		[ "$DEBUG" = 1 ] && echo 1>&2 "$PRG: DEBUG: macos left alone: \`$macos'"
		;;
	esac

echo "test-ybin-patch3:${macos}"
echo
done
