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. Signed-off-by: Chris Lamb <chris@chris-lamb.co.uk>
This commit is contained in:
parent
30bafdae57
commit
daec955a09
|
@ -42,7 +42,7 @@ Check_lockfile .lock
|
||||||
# Creating lock file
|
# Creating lock file
|
||||||
Create_lockfile .lock
|
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
|
then
|
||||||
# Copying includes
|
# Copying includes
|
||||||
cd config/binary_local-includes
|
cd config/binary_local-includes
|
||||||
|
|
|
@ -78,7 +78,7 @@ case "${LH_NET_TARBALL}" in
|
||||||
;;
|
;;
|
||||||
|
|
||||||
gzip)
|
gzip)
|
||||||
if gzip --help | grep -q "\-\-rsyncable"
|
if gzip --help | grep -qs "\-\-rsyncable"
|
||||||
then
|
then
|
||||||
tar cf binary-net.tar "$(basename ${OLDPWD})/${ROOT_DIR}" "$(basename ${OLDPWD})/tftpboot"
|
tar cf binary-net.tar "$(basename ${OLDPWD})/${ROOT_DIR}" "$(basename ${OLDPWD})/tftpboot"
|
||||||
gzip --rsyncable --best binary-net.tar
|
gzip --rsyncable --best binary-net.tar
|
||||||
|
|
|
@ -280,7 +280,7 @@ Configure_syslinux_templates ()
|
||||||
# Syslinux v3.31 in etch does not support include statements
|
# Syslinux v3.31 in etch does not support include statements
|
||||||
if [ "${LH_DISTRIBUTION}" = "etch" ]
|
if [ "${LH_DISTRIBUTION}" = "etch" ]
|
||||||
then
|
then
|
||||||
while grep -q ^include ${SCREEN_PATH}/syslinux.cfg
|
while grep -qs ^include ${SCREEN_PATH}/syslinux.cfg
|
||||||
do
|
do
|
||||||
INCLUDES=$(grep ^include ${SCREEN_PATH}/syslinux.cfg |awk '{print $2}')
|
INCLUDES=$(grep ^include ${SCREEN_PATH}/syslinux.cfg |awk '{print $2}')
|
||||||
|
|
||||||
|
|
|
@ -50,7 +50,7 @@ Create_lockfile .lock
|
||||||
# Remove old binary
|
# Remove old binary
|
||||||
rm -f binary.tar.gz
|
rm -f binary.tar.gz
|
||||||
|
|
||||||
if gzip --help | grep -q '\-\-rsyncable'
|
if gzip --help | grep -qs '\-\-rsyncable'
|
||||||
then
|
then
|
||||||
tar cf binary-tar.tar binary
|
tar cf binary-tar.tar binary
|
||||||
gzip --rsyncable --best binary-tar.tar
|
gzip --rsyncable --best binary-tar.tar
|
||||||
|
|
|
@ -42,7 +42,7 @@ Check_lockfile .lock
|
||||||
# Creating lock file
|
# Creating lock file
|
||||||
Create_lockfile .lock
|
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
|
then
|
||||||
# Copying includes
|
# Copying includes
|
||||||
cd config/chroot_local-includes
|
cd config/chroot_local-includes
|
||||||
|
|
|
@ -60,7 +60,7 @@ cp -a config source/debian-live
|
||||||
# Create tarball
|
# Create tarball
|
||||||
cd source
|
cd source
|
||||||
|
|
||||||
if gzip --help | grep -q '\-\-rsyncable'
|
if gzip --help | grep -qs '\-\-rsyncable'
|
||||||
then
|
then
|
||||||
tar cf debian-live-config_$(date +%Y%m%d.%s).tar debian-live
|
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
|
gzip --rsyncable --best debian-live-config_$(date +%Y%m%d.%s).tar
|
||||||
|
|
|
@ -59,7 +59,7 @@ then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Create tarball
|
# Create tarball
|
||||||
if gzip --help | grep -q '\-\-rsyncable'
|
if gzip --help | grep -qs '\-\-rsyncable'
|
||||||
then
|
then
|
||||||
tar cf source-net.tar source
|
tar cf source-net.tar source
|
||||||
gzip --rsyncable --best source-net.tar
|
gzip --rsyncable --best source-net.tar
|
||||||
|
|
|
@ -60,7 +60,7 @@ then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Create tarball
|
# Create tarball
|
||||||
if gzip --help | grep -q '\-\-rsyncable'
|
if gzip --help | grep -qs '\-\-rsyncable'
|
||||||
then
|
then
|
||||||
tar cf source.tar source
|
tar cf source.tar source
|
||||||
gzip --rsyncable --best source.tar
|
gzip --rsyncable --best source.tar
|
||||||
|
|
Loading…
Reference in New Issue