chiark / gitweb /
path_id: fix invalid character class
[elogind.git] / extras / path_id
index 4ac7187..44fc482 100755 (executable)
@@ -235,6 +235,11 @@ handle_block_scsi () {
                adapter="`echo $controller_dev |  sed -e 's@/[^/]\{1,\}$@@;s@^.*/@@;s@^.*:@@'`"
                bus="gc"
                ;;
+               # PARISC devices
+               *parisc*)
+               adapter="${controler_dev##*/}"
+               bus=parisc;
+               ;;
                *)
                adapter="${controller_dev##*/}"
                bus="pci"
@@ -270,7 +275,7 @@ handle_block_usb_storage () {
        # usb-storage devs have a serial number, hopefully unique
        serial=
        if [ -f $controller_dev/../serial ] ; then
-               serial="`sed -e 's@^[ -]\{1,\}\|[ -]\{1,\}$@@g;s@[^abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_0123456789]@@g' < $controller_dev/../serial`"
+               serial="`sed -e 's@^[ -]\{1,\}\|[ -]\{1,\}$@@g;s@[^abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789-]@@g' < $controller_dev/../serial`"
                : serial XXX_${serial}_XXX
                d="usb-$serial"
                serial="`echo $serial | sed -e 's@[ 0]\{1,\}@@g'`"
@@ -280,10 +285,10 @@ handle_block_usb_storage () {
                # has eventually binary junk in vpd
                identifier=
                if [ -f $controller_dev/../product ] ; then
-               product="`sed -e 's@^[ -]\{1,\}\|[ -]\{1,\}$@@g;s@[^abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_0123456789]@@g' < $controller_dev/../product`"
+               product="`sed -e 's@^[ -]\{1,\}\|[ -]\{1,\}$@@g;s@[^abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789-]@@g' < $controller_dev/../product`"
                fi
                if [ -f $controller_dev/../manufacturer ] ; then
-               manufacturer="`sed -e 's@^[ -]\{1,\}\|[ -]\{1,\}$@@g;s@[^abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_0123456789]@@g' < $controller_dev/../manufacturer`"
+               manufacturer="`sed -e 's@^[ -]\{1,\}\|[ -]\{1,\}$@@g;s@[^abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789-]@@g' < $controller_dev/../manufacturer`"
                fi
                if [ -z "$product" -o -z "$manufacturer" ] ; then
                        read idvendor < $controller_dev/../idVendor