From 988db3ba49f0ee7ee6113acf97e83a1ab118cf06 Mon Sep 17 00:00:00 2001 From: Chris Lamb Date: Thu, 19 Jun 2008 19:49:16 +0100 Subject: Consolidate grep text searching predicates to use "grep -qs" If this is deemed not portable enough in the future, it should be easy enough to find/replace. --- helpers/lh_binary_local-includes | 2 +- helpers/lh_binary_net | 2 +- helpers/lh_binary_syslinux | 2 +- helpers/lh_binary_tar | 2 +- helpers/lh_chroot_local-includes | 2 +- helpers/lh_source_debian-live | 2 +- helpers/lh_source_net | 2 +- helpers/lh_source_tar | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/helpers/lh_binary_local-includes b/helpers/lh_binary_local-includes index 04e429e..57918bd 100755 --- a/helpers/lh_binary_local-includes +++ b/helpers/lh_binary_local-includes @@ -42,7 +42,7 @@ Check_lockfile .lock # Creating lock file Create_lockfile .lock -if ls -A config/binary_local-includes/ | grep . > /dev/null 2>&1 +if ls -A config/binary_local-includes/ | grep -qs . then # Copying includes cd config/binary_local-includes diff --git a/helpers/lh_binary_net b/helpers/lh_binary_net index 3b5076e..9dae63f 100755 --- a/helpers/lh_binary_net +++ b/helpers/lh_binary_net @@ -78,7 +78,7 @@ case "${LH_NET_TARBALL}" in ;; gzip) - if gzip --help | grep -q "\-\-rsyncable" + if gzip --help | grep -qs "\-\-rsyncable" then tar cf binary-net.tar "$(basename ${OLDPWD})/${ROOT_DIR}" "$(basename ${OLDPWD})/tftpboot" gzip --rsyncable --best binary-net.tar diff --git a/helpers/lh_binary_syslinux b/helpers/lh_binary_syslinux index 57304e3..f0338ae 100755 --- a/helpers/lh_binary_syslinux +++ b/helpers/lh_binary_syslinux @@ -280,7 +280,7 @@ Configure_syslinux_templates () # Syslinux v3.31 in etch does not support include statements if [ "${LH_DISTRIBUTION}" = "etch" ] then - while grep -q ^include ${SCREEN_PATH}/syslinux.cfg + while grep -qs ^include ${SCREEN_PATH}/syslinux.cfg do INCLUDES=$(grep ^include ${SCREEN_PATH}/syslinux.cfg |awk '{print $2}') diff --git a/helpers/lh_binary_tar b/helpers/lh_binary_tar index 7560bce..2b3df64 100755 --- a/helpers/lh_binary_tar +++ b/helpers/lh_binary_tar @@ -50,7 +50,7 @@ Create_lockfile .lock # Remove old binary rm -f binary.tar.gz -if gzip --help | grep -q '\-\-rsyncable' +if gzip --help | grep -qs '\-\-rsyncable' then tar cf binary-tar.tar binary gzip --rsyncable --best binary-tar.tar diff --git a/helpers/lh_chroot_local-includes b/helpers/lh_chroot_local-includes index 49d1c80..697c33b 100755 --- a/helpers/lh_chroot_local-includes +++ b/helpers/lh_chroot_local-includes @@ -42,7 +42,7 @@ Check_lockfile .lock # Creating lock file Create_lockfile .lock -if ls -A config/chroot_local-includes/ | grep . > /dev/null 2>&1 +if ls -A config/chroot_local-includes/ | grep -qs . then # Copying includes cd config/chroot_local-includes diff --git a/helpers/lh_source_debian-live b/helpers/lh_source_debian-live index c82ca29..cd252ce 100755 --- a/helpers/lh_source_debian-live +++ b/helpers/lh_source_debian-live @@ -60,7 +60,7 @@ cp -a config source/debian-live # Create tarball cd source -if gzip --help | grep -q '\-\-rsyncable' +if gzip --help | grep -qs '\-\-rsyncable' then tar cf debian-live-config_$(date +%Y%m%d.%s).tar debian-live gzip --rsyncable --best debian-live-config_$(date +%Y%m%d.%s).tar diff --git a/helpers/lh_source_net b/helpers/lh_source_net index 76c9f94..bd79792 100755 --- a/helpers/lh_source_net +++ b/helpers/lh_source_net @@ -59,7 +59,7 @@ then fi # Create tarball -if gzip --help | grep -q '\-\-rsyncable' +if gzip --help | grep -qs '\-\-rsyncable' then tar cf source-net.tar source gzip --rsyncable --best source-net.tar diff --git a/helpers/lh_source_tar b/helpers/lh_source_tar index df8be3b..c13e9a9 100755 --- a/helpers/lh_source_tar +++ b/helpers/lh_source_tar @@ -60,7 +60,7 @@ then fi # Create tarball -if gzip --help | grep -q '\-\-rsyncable' +if gzip --help | grep -qs '\-\-rsyncable' then tar cf source.tar source gzip --rsyncable --best source.tar -- cgit v1.0