Changeset 909


Ignore:
Timestamp:
Nov 1, 2006, 1:28:11 AM (11 years ago)
Author:
bruno
Message:

Remove calls to grep -w when use in mondorestore as busybox doesn't support that option. (report from Alfred Chua)

Location:
branches/stable/mondo/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/stable/mondo/src/common/libmondo-devices.c

    r877 r909  
    15301530    }
    15311531    paranoid_pclose(fin);
    1532     sprintf(tmp, "%s | grep -w \"%s\" > /dev/null 2> /dev/null",
     1532    sprintf(tmp, "%s | grep -E \"^%s\" > /dev/null 2> /dev/null",
    15331533            SWAPLIST_COMMAND, device_with_space);
    15341534    log_msg(4, "tmp (command) = '%s'", tmp);
  • branches/stable/mondo/src/common/libmondo-tools.c

    r686 r909  
    13961396    log_msg(4, "Done. Great. Seeting command to something");
    13971397    strcpy(command,
    1398            "grep -v \":\" /etc/fstab | grep -vx \"#.*\" | grep -w \"/boot\" | tr -s ' ' '\t' | cut -f1 | head -n1");
     1398           "grep -v \":\" /etc/fstab | grep -vx \"#.*\" | grep -E \"[   ]/boot[     ]\" | tr -s ' ' '\t' | cut -f1 | head -n1");
    13991399    log_msg(4, "Cool. Command = '%s'", command);
    14001400    strcpy(tmp, call_program_and_get_last_line_of_output(command));
     
    14101410            }
    14111411        } else {
    1412             sprintf(command, "mount | grep -w \"%s\"", tmp);
     1412            sprintf(command, "mount | grep -E \"^%s\"", tmp);
    14131413            log_msg(3, "command = %s", command);
    14141414            if (run_program_and_log_output(command, 5)) {
  • branches/stable/mondo/src/mondorestore/mondo-rstr-tools.c

    r873 r909  
    12071207                /* Find out where it's mounted */
    12081208                sprintf(command,
    1209                         "mount | grep -w %s | tail -n1 | cut -d' ' -f3",
     1209                        "mount | grep -E '^%s' | tail -n1 | cut -d' ' -f3",
    12101210                        g_isodir_device);
    12111211                log_it("command = %s", command);
Note: See TracChangeset for help on using the changeset viewer.