casper uses grep -E but should use egrep instead (BusyBox)

Bug #512386 reported by phl
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
casper (Ubuntu)
Fix Released
Undecided
Colin Watson

Bug Description

Binary package hint: casper

Ubuntu 9.10 casper 1.206 uses grep -E which is misuse under BusyBox v1.13.3 (Ubuntu 1:1.13.3-1ubuntu7).

Under BusyBox the correct syntax is "egrep"

egrep -r 'grep -.?E ' *

casper: if /lib/udev/path_id "${sysfs_path}" | grep -E -q "ID_PATH=(usb|pci-[^-]*-(ide|scsi|usb)|platform-orion-ehci|platform-mmc|platform-mxsdhci)"; then
casper: for sysblock in $(echo /sys/block/* | tr ' ' '\n' | grep -vE "/(loop|ram|fd)"); do
casper-premount/10driver_updates: if /lib/udev/path_id "${sysfs_path}" | grep -E -q "ID_PATH=(usb|pci-[^-]*-(ide|scsi|usb))"; then

This misuse is within casper:is_nice_device(), casper:find_livefs() and casper-premount/10driver_updates:is_nice_device()

The result is filters that don't filter anything with many useless tries:

For instance

grep 'get_fstype /dev/ram' /var/log/casper.log | wc -l

gives 96.

In many case it doesn't hurt, but in some special cases it a potential slow-downer worth getting rid of.

Replacing "grep -vE" with egrep -v" solves the issue.

Philippe Lelédy

Related branches

Revision history for this message
Colin Watson (cjwatson) wrote :

Thanks - I've fixed this for version 1.217.

Changed in casper (Ubuntu):
assignee: nobody → Colin Watson (cjwatson)
status: New → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package casper - 1.217

---------------
casper (1.217) lucid; urgency=low

  [ Luke Yelavich ]
  * ubiquity-hooks/30accessibility: Enable accessible login for the blindness
    and braile accessibility profiles.

  [ Colin Watson ]
  * Use egrep rather than 'grep -E' (LP: #512386).

  [ Julien Lavergne ]
  * 15autologin: Add support for LXDM autologin (LP: #511976).

  [ Evan Dandrea ]
  * Properly shut down debconf-communicate so that its database gets
    written (LP: #518272).
 -- Evan Dandrea <email address hidden> Thu, 11 Feb 2010 08:25:53 +0000

Changed in casper (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.