Skip to content

Commit 9f540e2

Browse files
committed
Unify grep usage
Signed-off-by: Thomas Deutschmann <[email protected]>
1 parent c862443 commit 9f540e2

6 files changed

+10
-10
lines changed

Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#PACKAGE_VERSION = $(shell /bin/fgrep GK_V= genkernel | sed "s/.*GK_V='\([^']\+\)'/\1/")
1+
#PACKAGE_VERSION = $(shell /bin/grep -F -- GK_V= genkernel | sed "s/.*GK_V='\([^']\+\)'/\1/")
22
PACKAGE_VERSION = $(shell git describe --tags |sed 's,^v,,g')
33
distdir = genkernel-$(PACKAGE_VERSION)
44
MANPAGE = genkernel.8
@@ -78,7 +78,7 @@ verify-doc: doc/genkernel.8.txt
7878
-e '/ssh-host-keys/s,=\(create\|create-from-host\|runtime\),,g' | \
7979
while read opt ; do \
8080
regex="^*--(...no-...)?$$opt" ; \
81-
if ! egrep -e "$$regex" $< -sq ; then \
81+
if ! grep -Ee "$$regex" $< -sq ; then \
8282
touch faildoc ; \
8383
echo "Undocumented option: $$opt" ; \
8484
fi ; \

defaults/initrd.scripts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1023,7 +1023,7 @@ run_shell() {
10231023

10241024
fs_type_in_use() {
10251025
fs_type=$1
1026-
cut -d ' ' -f 3 < /proc/mounts | fgrep -q "${fs_type}"
1026+
cut -d ' ' -f 3 < /proc/mounts | grep -Fq "${fs_type}"
10271027
}
10281028

10291029
mount_devfs() {

defaults/linuxrc

+2-2
Original file line numberDiff line numberDiff line change
@@ -1062,7 +1062,7 @@ then
10621062
bad_msg "Squashfs filesystem could not be mounted, dropping into shell."
10631063
if [ -e /proc/filesystems ]
10641064
then
1065-
fgrep -q squashfs /proc/filesystems || \
1065+
grep -Fq squashfs /proc/filesystems || \
10661066
bad_msg "HINT: Your kernel does not know filesystem \"squashfs\"."
10671067
fi
10681068
run_shell
@@ -1279,7 +1279,7 @@ do
12791279
# and not a mountpoint
12801280
[ -z "${dev}" ] && continue
12811281
fstype=$(get_mount_fstype ${fs})
1282-
if get_mount_options ${fs} | fgrep -q bind
1282+
if get_mount_options ${fs} | grep -Fq bind
12831283
then
12841284
opts='bind'
12851285
dev=${NEW_ROOT}${dev}

gen_determineargs.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,7 @@ determine_real_args() {
606606
vars_to_initialize+=( "BUSYBOX_CONFIG" )
607607
vars_to_initialize+=( "DEFAULT_KERNEL_CONFIG" )
608608

609-
local binpkgs=( $(compgen -A variable |grep '^GKPKG_.*_BINPKG$') )
609+
local binpkgs=( $(compgen -A variable | grep '^GKPKG_.*_BINPKG$') )
610610
local binpkg
611611
for binpkg in "${binpkgs[@]}"
612612
do
@@ -639,7 +639,7 @@ determine_real_args() {
639639
declare -gA GKICM_LOOKUP_TABLE_PKG=()
640640
local known_initramfs_compression_methods_by_compression=( $(get_initramfs_compression_method_by_compression) )
641641
local known_initramfs_compression_methods_by_speed=( $(get_initramfs_compression_method_by_speed) )
642-
local initramfs_compression_methods=( $(compgen -A variable |grep '^GKICM_.*_KOPTNAME$') )
642+
local initramfs_compression_methods=( $(compgen -A variable | grep '^GKICM_.*_KOPTNAME$') )
643643
local initramfs_compression_method key var_name var_prefix
644644
for initramfs_compression_method in "${initramfs_compression_methods[@]}"
645645
do

gen_funcs.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -1908,7 +1908,7 @@ check_disk_space_requirements() {
19081908
}
19091909

19101910
check_distfiles() {
1911-
local source_files=( $(compgen -A variable |grep '^GKPKG_.*_SRCTAR$') )
1911+
local source_files=( $(compgen -A variable | grep '^GKPKG_.*_SRCTAR$') )
19121912

19131913
local -a missing_sources
19141914
local source_file=
@@ -2046,7 +2046,7 @@ make_bootdir_writable() {
20462046
local bootdir_status=unknown
20472047

20482048
# Based on mount-boot.eclass code
2049-
local fstabstate=$(awk "!/^#|^[[:blank:]]+#|^${BOOTDIR//\//\\/}/ {print \$2}" /etc/fstab 2>/dev/null | egrep "^${BOOTDIR}$" )
2049+
local fstabstate=$(awk "!/^#|^[[:blank:]]+#|^${BOOTDIR//\//\\/}/ {print \$2}" /etc/fstab 2>/dev/null | grep -E "^${BOOTDIR}$" )
20502050
local procstate=$(awk "\$2 ~ /^${BOOTDIR//\//\\/}\$/ {print \$2}" /proc/mounts 2>/dev/null)
20512051
local proc_ro=$(awk '{ print $2 " ," $4 "," }' /proc/mounts 2>/dev/null | sed -n "/^${BOOTDIR//\//\\/} .*,ro,/p")
20522052

gen_initramfs.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ copy_binaries() {
3737
[[ -e "${binary}" ]] \
3838
|| gen_die "Binary ${binary} could not be found"
3939

40-
if LC_ALL=C "${LDDTREE_COMMAND}" "${binary}" 2>&1 | fgrep -q 'not found'
40+
if LC_ALL=C "${LDDTREE_COMMAND}" "${binary}" 2>&1 | grep -F -q 'not found'
4141
then
4242
gen_die "Binary ${binary} is linked to missing libraries and may need to be re-built"
4343
fi

0 commit comments

Comments
 (0)