• Bug#266243: remove need for awk

    From Jason Thomas@1:229/2 to All on Wed Aug 18 08:30:10 2004
    From: [email protected]

    tags 266243 + patch
    thanks

    Heres a patch to remove the use of awk

    --
    Jason

    "I hope you learn speaking English proper I hope speak I me you."
    -- Branden Robinson, 2001

    diff -Naur grub-0.95+cvs20040624.orig/debian/update-grub grub-0.95+cvs20040624/debian/update-grub
    --- grub-0.95+cvs20040624.orig/debian/update-grub 2004-08-18 16:01:27.000000000 +1000
    +++ grub-0.95+cvs20040624/debian/update-grub 2004-08-18 16:05:22.000000000 +1000
    @@ -62,11 +62,14 @@
    # Autodetect current root device
    device=
    if [ -f /etc/fstab ] ; then
    - script='
    - /^#/ { next }
    - $2 == "'"$mount_point"'" { print $1 ; exit }
    - '
    - device=`awk "$script" /etc/fstab`
    + while read DEV MNT FOO; do
    + if [ `echo "$DEV" | grep -q "^#"` ]; then
    + continue
    + fi
    + if [ "$MNT" = "$mount_point" ]; then
    + device="$DEV";
    + fi
    + done < /etc/fstab
    fi

    if [ -n "$device" ] ; then

    --- SoupGate-Win32 v1.05
    * Origin: you cannot sedate... all the things you hate (1:229/2)