Package: hotplug
Version: 0.0.20040329-22
Severity: wishlist
Tags: patch
A Debian patch to hotplug causes it to require the sed feature whereby,
if you supply an empty regex, it repeats the previous match:
-SYSFS=$(sed -n 's/^.* \([^ ]*\) sysfs .*$/\1/p' /proc/mounts)
+SYSFS=$(sed -n '/^.* \([^ ]*\) sysfs .*$/ { s//\1/p ; q }' /proc/mounts)
While I realise hotplug's probably entitled to depend on this feature
since it's in POSIX, busybox sed doesn't support it in this context (my
tests indicate that it works for e.g. two s/// commands in a row, but
doesn't work for /regex/ { s//replacement/; }).
Would you be willing to accept a workaround for this problem? The patch
is fairly simple:
diff -u hotplug-0.0.20040329/debian/patches/firmware_misc
hotplug-0.0.20040329/debian/patches/firmware_misc
--- hotplug-0.0.20040329/debian/patches/firmware_misc
+++ hotplug-0.0.20040329/debian/patches/firmware_misc
@@ -6,7 +6,7 @@
# mountpoint of sysfs
-SYSFS=$(sed -n 's/^.* \([^ ]*\) sysfs .*$/\1/p' /proc/mounts)
-+SYSFS=$(sed -n '/^.* \([^ ]*\) sysfs .*$/ { s//\1/p ; q }' /proc/mounts)
++SYSFS=$(grep '^.* [^ ]* sysfs .*$' /proc/mounts | head -n1 | sed 's/^.* \([^
]*\) sysfs .*$/\1/')
# use /proc for 2.4 kernels
if [ "$SYSFS" = "" ]; then
Debian's hotplug already requires grep and head.
Thanks,
--
Colin Watson [EMAIL PROTECTED]
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]