commit:     9f540e262f18abdfde67d63a7d87da04abc322c8
Author:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
AuthorDate: Sat Aug  1 13:55:57 2020 +0000
Commit:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
CommitDate: Sat Aug  1 20:35:00 2020 +0000
URL:        https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=9f540e26

Unify grep usage

Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>

 Makefile                | 4 ++--
 defaults/initrd.scripts | 2 +-
 defaults/linuxrc        | 4 ++--
 gen_determineargs.sh    | 4 ++--
 gen_funcs.sh            | 4 ++--
 gen_initramfs.sh        | 2 +-
 6 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/Makefile b/Makefile
index e423ab0..92d1278 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-#PACKAGE_VERSION = $(shell /bin/fgrep GK_V= genkernel | sed 
"s/.*GK_V='\([^']\+\)'/\1/")
+#PACKAGE_VERSION = $(shell /bin/grep -F -- GK_V= genkernel | sed 
"s/.*GK_V='\([^']\+\)'/\1/")
 PACKAGE_VERSION = $(shell git describe --tags |sed 's,^v,,g')
 distdir = genkernel-$(PACKAGE_VERSION)
 MANPAGE = genkernel.8
@@ -78,7 +78,7 @@ verify-doc: doc/genkernel.8.txt
                        -e 
'/ssh-host-keys/s,=\(create\|create-from-host\|runtime\),,g' | \
                while read opt ; do \
                        regex="^*--(...no-...)?$$opt" ; \
-                       if ! egrep -e "$$regex" $< -sq ; then \
+                       if ! grep -Ee "$$regex" $< -sq ; then \
                                touch faildoc ; \
                                echo "Undocumented option: $$opt" ; \
                        fi ; \

diff --git a/defaults/initrd.scripts b/defaults/initrd.scripts
index 304d634..22d7e85 100644
--- a/defaults/initrd.scripts
+++ b/defaults/initrd.scripts
@@ -1023,7 +1023,7 @@ run_shell() {
 
 fs_type_in_use() {
        fs_type=$1
-       cut -d ' ' -f 3 < /proc/mounts | fgrep -q "${fs_type}"
+       cut -d ' ' -f 3 < /proc/mounts | grep -Fq "${fs_type}"
 }
 
 mount_devfs() {

diff --git a/defaults/linuxrc b/defaults/linuxrc
index e9e97b6..3ca7e86 100644
--- a/defaults/linuxrc
+++ b/defaults/linuxrc
@@ -1062,7 +1062,7 @@ then
                                        bad_msg "Squashfs filesystem could not 
be mounted, dropping into shell."
                                        if [ -e /proc/filesystems ]
                                        then
-                                               fgrep -q squashfs 
/proc/filesystems || \
+                                               grep -Fq squashfs 
/proc/filesystems || \
                                                        bad_msg "HINT: Your 
kernel does not know filesystem \"squashfs\"."
                                        fi
                                        run_shell
@@ -1279,7 +1279,7 @@ do
        # and not a mountpoint
        [ -z "${dev}" ] && continue
        fstype=$(get_mount_fstype ${fs})
-       if get_mount_options ${fs} | fgrep -q bind
+       if get_mount_options ${fs} | grep -Fq bind
        then
                opts='bind'
                dev=${NEW_ROOT}${dev}

diff --git a/gen_determineargs.sh b/gen_determineargs.sh
index d8f3028..75dc151 100755
--- a/gen_determineargs.sh
+++ b/gen_determineargs.sh
@@ -606,7 +606,7 @@ determine_real_args() {
        vars_to_initialize+=( "BUSYBOX_CONFIG" )
        vars_to_initialize+=( "DEFAULT_KERNEL_CONFIG" )
 
-       local binpkgs=( $(compgen -A variable |grep '^GKPKG_.*_BINPKG$') )
+       local binpkgs=( $(compgen -A variable | grep '^GKPKG_.*_BINPKG$') )
        local binpkg
        for binpkg in "${binpkgs[@]}"
        do
@@ -639,7 +639,7 @@ determine_real_args() {
        declare -gA GKICM_LOOKUP_TABLE_PKG=()
        local known_initramfs_compression_methods_by_compression=( 
$(get_initramfs_compression_method_by_compression) )
        local known_initramfs_compression_methods_by_speed=( 
$(get_initramfs_compression_method_by_speed) )
-       local initramfs_compression_methods=( $(compgen -A variable |grep 
'^GKICM_.*_KOPTNAME$') )
+       local initramfs_compression_methods=( $(compgen -A variable | grep 
'^GKICM_.*_KOPTNAME$') )
        local initramfs_compression_method key var_name var_prefix
        for initramfs_compression_method in 
"${initramfs_compression_methods[@]}"
        do

diff --git a/gen_funcs.sh b/gen_funcs.sh
index f2f075a..0eea8ee 100755
--- a/gen_funcs.sh
+++ b/gen_funcs.sh
@@ -1908,7 +1908,7 @@ check_disk_space_requirements() {
 }
 
 check_distfiles() {
-       local source_files=( $(compgen -A variable |grep '^GKPKG_.*_SRCTAR$') )
+       local source_files=( $(compgen -A variable | grep '^GKPKG_.*_SRCTAR$') )
 
        local -a missing_sources
        local source_file=
@@ -2046,7 +2046,7 @@ make_bootdir_writable() {
        local bootdir_status=unknown
 
        # Based on mount-boot.eclass code
-       local fstabstate=$(awk "!/^#|^[[:blank:]]+#|^${BOOTDIR//\//\\/}/ {print 
\$2}" /etc/fstab 2>/dev/null | egrep "^${BOOTDIR}$" )
+       local fstabstate=$(awk "!/^#|^[[:blank:]]+#|^${BOOTDIR//\//\\/}/ {print 
\$2}" /etc/fstab 2>/dev/null | grep -E "^${BOOTDIR}$" )
        local procstate=$(awk "\$2 ~ /^${BOOTDIR//\//\\/}\$/ {print \$2}" 
/proc/mounts 2>/dev/null)
        local proc_ro=$(awk '{ print $2 " ," $4 "," }' /proc/mounts 2>/dev/null 
| sed -n "/^${BOOTDIR//\//\\/} .*,ro,/p")
 

diff --git a/gen_initramfs.sh b/gen_initramfs.sh
index e48fa06..c583318 100755
--- a/gen_initramfs.sh
+++ b/gen_initramfs.sh
@@ -37,7 +37,7 @@ copy_binaries() {
                [[ -e "${binary}" ]] \
                        || gen_die "Binary ${binary} could not be found"
 
-               if LC_ALL=C "${LDDTREE_COMMAND}" "${binary}" 2>&1 | fgrep -q 
'not found'
+               if LC_ALL=C "${LDDTREE_COMMAND}" "${binary}" 2>&1 | grep -F -q 
'not found'
                then
                        gen_die "Binary ${binary} is linked to missing 
libraries and may need to be re-built"
                fi

Reply via email to