Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/postinstall Use grep -E and grep -F instead of egre...



details:   https://anonhg.NetBSD.org/src/rev/9cdf3cec0ba2
branches:  trunk
changeset: 780987:9cdf3cec0ba2
user:      apb <apb%NetBSD.org@localhost>
date:      Tue Aug 14 12:07:57 2012 +0000

description:
Use grep -E and grep -F instead of egrep and fgrep.  This reduces the
number of tools that may need to be passed in the environment.

diffstat:

 usr.sbin/postinstall/postinstall |  10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

diffs (47 lines):

diff -r ea35dc257b08 -r 9cdf3cec0ba2 usr.sbin/postinstall/postinstall
--- a/usr.sbin/postinstall/postinstall  Tue Aug 14 10:38:40 2012 +0000
+++ b/usr.sbin/postinstall/postinstall  Tue Aug 14 12:07:57 2012 +0000
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: postinstall,v 1.142 2012/08/14 10:38:40 apb Exp $
+# $NetBSD: postinstall,v 1.143 2012/08/14 12:07:57 apb Exp $
 #
 # Copyright (c) 2002-2008 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -54,8 +54,6 @@
 # environment to override the locations of some tools.
 : ${AWK:=awk}
 : ${DB:=db}
-: ${EGREP:=egrep}
-: ${FGREP:=fgrep}
 : ${GREP:=grep}
 : ${MAKE:=make}
 : ${PWD_MKDB:=/usr/sbin/pwd_mkdb}
@@ -429,7 +427,7 @@
                _dirname="$(dirname "${_path}" 2>/dev/null)"
                _basename="$(basename "${_path}" 2>/dev/null)"
                ls -fa "${DEST_DIR}${_dirname}" 2> /dev/null \
-                       | ${FGREP} -x "${_basename}" >/dev/null \
+                       | ${GREP} -F -x "${_basename}" >/dev/null \
                        || return 1
                _path="${_dirname}"
        done
@@ -1493,7 +1491,7 @@
        # then it will not be deleted.
        ( [ -f "${DEST_DIR}"/var/db/obsolete/xbase ] \
            &&  sort -ru "${DEST_DIR}"/var/db/obsolete/xbase \
-           | ${EGREP} "^\\.?${pcpath}/" ;
+           | ${GREP} -E "^\\.?${pcpath}/" ;
            echo "${pcpath}" ) \
        | obsolete_paths "${op}"
        failed=$(( ${failed} + $? ))
@@ -1734,7 +1732,7 @@
 
        # check if ptyfs is in use
        failed=0;
-       if ${EGREP} "^ptyfs" "${DEST_DIR}/etc/fstab" > /dev/null; then
+       if ${GREP} -E "^ptyfs" "${DEST_DIR}/etc/fstab" > /dev/null; then
                maj_t=$( ${AWK} < "${DEST_DIR}/dev/MAKEDEV" \
                        '/mkdev ttyp0 c [0-9]* 0 666/{print $4}' )
                maj_p=$( ${AWK} < "${DEST_DIR}/dev/MAKEDEV" \



Home | Main Index | Thread Index | Old Index