[Pkg-utopia-commits] r94 - packages/hal/trunk/debian

Sjoerd Simons sjoerd@haydn.debian.org
Wed, 17 Nov 2004 15:58:59 -0700


Author: sjoerd
Date: 2004-11-17 15:58:54 -0700 (Wed, 17 Nov 2004)
New Revision: 94

Added:
   packages/hal/trunk/debian/hal.udev.device-removable.sh
Removed:
   packages/hal/trunk/debian/hal.udev.removable.sh
Modified:
   packages/hal/trunk/debian/hal.udev.rules
   packages/hal/trunk/debian/rules
Log:
Rename removable.sh to device-removable.sh

Copied: packages/hal/trunk/debian/hal.udev.device-removable.sh (from rev 93, packages/hal/trunk/debian/hal.udev.removable.sh)

Deleted: packages/hal/trunk/debian/hal.udev.removable.sh
===================================================================
--- packages/hal/trunk/debian/hal.udev.removable.sh	2004-11-17 22:33:06 UTC (rev 93)
+++ packages/hal/trunk/debian/hal.udev.removable.sh	2004-11-17 22:58:54 UTC (rev 94)
@@ -1,66 +0,0 @@
-#!/bin/sh -e
-# print "1" if device $1 is either removable, on the ieee1394 or on the usb bus,
-# and "0" otherwise.
-
-get_devpath() {
-  # Turn the symlink to a device into a the path inside the sysfs tree
-  path=$(/bin/readlink $1)
-  # strip the leading "../"'s
-  prev=""
-  while [ "${path}" != "${prev}" ]; do 
-    prev=${path}
-    path=${prev#../}
-  done
-  echo "/${path}"
-}
-
-is_prefix() {
-  # check if the first argument is a path prefix of the section
-  prefix=$1
-  compare=$2
-  while [ ${#compare} -gt ${#prefix} ] ; do
-    compare="${compare%/*}"
-  done
-  if [ "${compare}" != "${prefix}" ]; then
-   return 1;
-  fi
-  return 0;
-}
-
-check_bus() {
-  # check if the DEVICE is on the given bus 
-  # This is done by checking if any of the devices on the bus is a prefix 
-  # of the device
-  BUSDEVP="/sys/bus/$1/devices"
-  for x in $BUSDEVP/*; do
-    if is_prefix $(get_devpath $x) $DEVICE; then 
-      IS_REMOVABLE=1
-      return
-    fi
-  done
-}
-
-DEV="${1%[0-9]*}"
-BLOCKPATH="/sys/block/$DEV"
-
-if [ ! -d ${BLOCKPATH} ]; then 
-  exit 1
-fi
-
-REMOVABLE=${BLOCKPATH}/removable
-DEVICE=$(get_devpath ${BLOCKPATH}/device)
-IS_REMOVABLE=0
-if [ -e "$REMOVABLE" ]; then
-    IS_REMOVABLE=$(cat $REMOVABLE)
-fi
-
-if [ $IS_REMOVABLE -eq 0 ]; then 
-  check_bus "usb"
-fi
-
-if [ $IS_REMOVABLE -eq 0 ]; then 
-  check_bus "ieee1394"
-fi
-
-echo $IS_REMOVABLE
-exit 0

Modified: packages/hal/trunk/debian/hal.udev.rules
===================================================================
--- packages/hal/trunk/debian/hal.udev.rules	2004-11-17 22:33:06 UTC (rev 93)
+++ packages/hal/trunk/debian/hal.udev.rules	2004-11-17 22:58:54 UTC (rev 94)
@@ -1,4 +1,4 @@
 # put removable IDE/SCSI devices into the hal group instead of 'disk'
-BUS="scsi",KERNEL="sd[a-z]*", PROGRAM="/etc/udev/scripts/removable.sh %k", RESULT="1", NAME="%k", MODE="0640", GROUP="hal"
-BUS="ide", KERNEL="hd[a-z]*", PROGRAM="/etc/udev/scripts/removable.sh %k", RESULT="1", NAME="%k", MODE="0640", GROUP="hal"
-BUS="usb", KERNEL="ub[a-z]*", PROGRAM="/etc/udev/scripts/removable.sh %k", RESULT="1", NAME="%k", MODE="0640", GROUP="hal"
+BUS="scsi",KERNEL="sd[a-z]*", PROGRAM="/etc/udev/scripts/device-removable.sh %k", RESULT="1", NAME="%k", MODE="0640", GROUP="hal"
+BUS="ide", KERNEL="hd[a-z]*", PROGRAM="/etc/udev/scripts/device-removable.sh %k", RESULT="1", NAME="%k", MODE="0640", GROUP="hal"
+BUS="usb", KERNEL="ub[a-z]*", PROGRAM="/etc/udev/scripts/device-removable.sh %k", RESULT="1", NAME="%k", MODE="0640", GROUP="hal"

Modified: packages/hal/trunk/debian/rules
===================================================================
--- packages/hal/trunk/debian/rules	2004-11-17 22:33:06 UTC (rev 93)
+++ packages/hal/trunk/debian/rules	2004-11-17 22:58:54 UTC (rev 94)
@@ -26,7 +26,7 @@
 	install -m 755 -D debian/unmount.dev \
 		$(DEB_DESTDIR)/etc/dev.d/default/unmount.dev
 	install -m 755 -D debian/hal.udev.device-removable.sh \
-	  $(DEB_DESTDIR)/etc/udev/scripts/removable.sh
+	  $(DEB_DESTDIR)/etc/udev/scripts/device-removable.sh
 	install -m 644 -D debian/hal.udev.rules \
 	  $(DEB_DESTDIR)/etc/udev/hal.rules