LIBOGG="libogg-1.1.4"
LIBOIL="liboil-0.3.17"
LIBOPENJPEG="libopenjpeg-1.2"
-LIBPCAP="libpcap-1.0.0"
+LIBPCAP="libpcap-1.1.1"
LIBPNG="libpng-1.2.44"
LIBPROXY="libproxy-0.2.3"
LIBPTHREAD_STUBS="libpthread-stubs-0.3"
OPENJADE="openjade-1.3.2"
OPENLDAP="openldap-2.3.38"
OPENSP="OpenSP-1.5.2"
-OPENSSH="openssh-5.6p1"
+OPENSSH="openssh-5.8p1"
OPENSSL="openssl-1.0.0b"
OPENSSL_ROOT_CERTS="BLFS-ca-bundle-3.12.8.0"
{
# HTTP: will return "ERROR 404: Not Found"
# FTP: will say "File not found" or "No such file"
- if grep --ignore-case -e "not found" -e "no such file" ${WGET_LOG_FILE} \
- 1> /dev/null 2>&1; then
+ if grep -q --ignore-case -e "not found" -e "no such file" ${WGET_LOG_FILE}; \
+ then
#echo "404 NOTFOUND"
return 0
fi
# Failure: if it was a connection timeout, don't try for other file
# extensions.
- if grep "failed: Connection timed out" ${WGET_LOG_FILE} \
- 1> /dev/null 2>&1; then
+ if grep -q "failed: Connection timed out" ${WGET_LOG_FILE}; then
echo "Error, wget reported: Connection timed out"
return 1
fi
# Rename any patch fetched (in fpkg call) and replace SOURCE by TARGET
# in patch name.
- if ls ${LFS_PKG_DIR}/${SRC_FILENAME}-*.patch 1> /dev/null 2>&1; then
- echo "CMD=${SRC_FILENAME} ${PACK} ${LFS_PKG_DIR}/${SRC_FILENAME}-*.patch"
- rename ${SRC_FILENAME} ${PACK} ${LFS_PKG_DIR}/${SRC_FILENAME}-*.patch
+ local PATCHES_LIST="${LFS_PKG_DIR}/${SRC_FILENAME}-*.patch"
+ if ls ${PATCHES_LIST} 1> /dev/null 2>&1; then
+ echo "CMD=${SRC_FILENAME} ${PACK} ${PATCHES_LIST}"
+ rename ${SRC_FILENAME} ${PACK} ${PATCHES_LIST}
fi
fi
}
if [ "x${IPKG_MODE}" != "xnoac" ]; then
# Add option --disable-dependency-tracking if supported
if cat ${LFS_TMP}/${PACKAGE}/configure | \
- grep "disable-dependency-tracking" 1> /dev/null 2>&1; then
+ grep -q "disable-dependency-tracking"; then
CONFIGURE_OPTS="\
${CONFIGURE_OPTS} \
--disable-dependency-tracking"
fi
# Checking if variable exists
- if ! grep "${VARIABLE}=" ${FILE} 1> /dev/null 2>&1; then
+ if ! grep -q "${VARIABLE}=" ${FILE}; then
echo "${FUNCNAME}(), variable not found: ${VARIABLE}"
return 1
fi
# Checking if variable is already exported when it is defined
- if grep "${VARIABLE}=" ${FILE} | grep "export " 1> /dev/null 2>&1; then
+ if grep "${VARIABLE}=" ${FILE} | grep -q "export "; then
echo "${FUNCNAME}(), variable already exported in definition: ${VARIABLE}"
return 0
fi
# Checking if variable is already exported, in
# a "export VARIABLE1 VARIABLE2..." statement
- if grep "export " ${FILE} | grep " ${VARIABLE}" 1> /dev/null 2>&1; then
+ if grep "export " ${FILE} | grep -q " ${VARIABLE}"; then
echo "${FUNCNAME}(), variable already exported in export list: ${VARIABLE}"
return 0
fi
fi
# Checking if variable exists
- if ! grep "${VARIABLE}=" ${FILE} 1> /dev/null 2>&1; then
+ if ! grep -q "${VARIABLE}=" ${FILE}; then
echo "${VARIABLE}=\"${VALUE}\"" >> ${FILE}
return $?
fi
# Checking if variable contains the new value
- if grep "${VARIABLE}=" ${FILE} | grep "${VALUE}" 1> /dev/null 2>&1; then
+ if grep "${VARIABLE}=" ${FILE} | grep -q "${VALUE}"; then
echo "${FUNCNAME}(), variable ${VARIABLE} already contains value: ${VALUE}"
return 0
fi
# We search for the variable name starting at the beginning of the line
# For example, this ensures that if the variable name is PATH, then
# PATH=... matches but not MANPATH=...
- if grep "^${VARIABLE}=\"" ${FILE} 1> /dev/null 2>&1; then
+ if grep -q "^${VARIABLE}=\"" ${FILE}; then
# Variable value is enclosed by double-quotes
sed -i "s!\(^${VARIABLE}=\".*\)\(\"\)!\1${SEP}${VALUE}\"!" ${FILE}
else
# at the beginning of a line.
# For example, this ensures that if the variable name is PATH, then
# PATH=... matches but not MANPATH=...
- if grep "^export ${VARIABLE}=\"" ${FILE} 1> /dev/null 2>&1; then
+ if grep -q "^export ${VARIABLE}=\"" ${FILE}; then
# Variable value is enclosed by double-quotes
sed -i "s!\(^export ${VARIABLE}=\".*\)\(\"\)!\1${SEP}${VALUE}\"!" ${FILE}
else
fi
# Checking if string exists
- if grep "${STRING}" ${FILE} 1> /dev/null 2>&1; then
+ if grep -q "${STRING}" ${FILE}; then
echo "${FUNCNAME}(), string already defined: ${STRING}"
return 0
fi
fi
# Checking if variable contains the new value
- if egrep "^${VARIABLE}" ${FILE} | grep "${VALUE}" 1> /dev/null 2>&1; then
+ if egrep "^${VARIABLE}" ${FILE} | grep -q "${VALUE}"; then
echo "${FUNCNAME}(), variable ${VARIABLE} already contains value: ${VALUE}"
return 0
fi
shift
done
- if ! cat /etc/group | egrep "^${groupname}:" 1> /dev/null 2>&1; then
+ if ! cat /etc/group | egrep -q "^${groupname}:"; then
groupadd ${arguments}
fi
}
shift
done
- if ! cat /etc/passwd | egrep "^${username}:" 1> /dev/null 2>&1; then
+ if ! cat /etc/passwd | egrep -q "^${username}:"; then
useradd ${arguments}
fi
}
PACKAGE_LOG=${LFS_LOG_DIR}/${HVLABEL}.log
# Checking if package was previously successfully installed
- if grep "^${HVLABEL} successfully installed" ${LFS_LOG_FILE} \
- 1> /dev/null 2>&1; then
+ if grep -q "^${HVLABEL} successfully installed" ${LFS_LOG_FILE}; then
return $EXIT_SUCCESS
fi
if [ "x${SCRMODE}" = "xonce" ]; then
# Checking if package was previously successfully installed
- if grep "^${HVLABEL} successfully installed" ${LFS_LOG_FILE} 1> /dev/null 2>&1; then
+ if grep -q "^${HVLABEL} successfully installed" ${LFS_LOG_FILE}; then
return $EXIT_SUCCESS
fi
fi
# We cannot always automatically create the user 'lfs' because the installation
# media can be a CD-ROM (read-only) If installing from some kind of live-CD,
# simply install as root without the LFS user :)
-if ! grep "lfs" /etc/passwd 1> /dev/null 2>&1; then
+if ! grep -q "lfs" /etc/passwd; then
groupadd -f lfs
# The option '-k /dev/null' prevents possible copying of files from a
# skeleton directory (default is /etc/skel).
if [ ${?} -ne 0 ]; then
sleep 2
- if statusproc ${base} | grep "not running" 1> /dev/null 2>&1; then
+ if statusproc ${base} | grep -q "not running"; then
return ${EXIT_CODE_FAILURE}
fi
fi
fi
-if ! mount | grep ${MOUNTPOINT} 1> /dev/null 2>&1; then
+if ! mount | grep -q ${MOUNTPOINT}; then
mount ${MOUNTPOINT} || exit 1
fi
# Try to read ATIP infos for CD disks to estimate capacity...
MEDIA_ATIP_INFOS=$(cdrecord dev=${MEDIA_DEV} -atip 2>&1)
-if echo ${MEDIA_ATIP_INFOS} | grep "ATIP info from disk" 1> /dev/null 2>&1; then
+if echo ${MEDIA_ATIP_INFOS} | grep -q "ATIP info from disk"; then
MEDIA_SIZE=${CD_MEDIA_SIZE}
MEDIA_TYPE="CD"
echo "CD disk detected"
-elif echo ${MEDIA_ATIP_INFOS} | grep "Found DVD media but" 1> /dev/null 2>&1; then
+elif echo ${MEDIA_ATIP_INFOS} | grep -q "Found DVD media but"; then
MEDIA_SIZE=${DVD_MEDIA_SIZE}
MEDIA_TYPE="DVD"
echo "DVD disk detected"
-elif echo ${MEDIA_ATIP_INFOS} | grep "cdrecord: No disk / Wrong disk" 1> /dev/null 2>&1; then
+elif echo ${MEDIA_ATIP_INFOS} | grep -q "cdrecord: No disk / Wrong disk"; then
echo "No disk inserted, aborting"
exit 1
else
esac
# Mounting the media to verify burned capacity
-if ! grep ${MEDIA_DEV} /etc/mtab 1> /dev/null 2>&1; then
+if ! grep -q ${MEDIA_DEV} /etc/mtab; then
mount ${MEDIA_DEV} ${MEDIA_DIR} || exit 1
fi
echo 'main(){}' > dummy.c
gcc dummy.c -Wl,--verbose &> dummy.log
-if ! readelf -l a.out | grep 'Requesting program interpreter: /lib/ld-linux.*.so.2' 1> /dev/null 2>&1 ; then
+if ! readelf -l a.out | \
+ grep -q 'Requesting program interpreter: /lib/ld-linux.*.so.2'; then
echo "String 'Requesting program interpreter: /lib/ld-linux.*.so.2' not found"
exit 1
fi
log_script_name "$0 $*"
dbus_start() {
- if statusproc dbus-daemon | grep "not running" 1> /dev/null 2>&1; then
+ if statusproc dbus-daemon | grep -q "not running"; then
if [ -f /var/run/dbus/pid ]; then
rm /var/run/dbus/pid
fi
X11_FONTS_DIR="/usr/share/fonts/X11"
-if ! grep "${X11_FONTS_DIR}" /etc/fonts/local.conf 1> /dev/null 2>&1; then
+if ! grep -q "${X11_FONTS_DIR}" /etc/fonts/local.conf; then
# Adding X fonts directory to local configuration file
- sed -i -e "s!\(</fontconfig>\)! <dir>${X11_FONTS_DIR}</dir>\n\1!" /etc/fonts/local.conf
+ sed -i -e "s!\(</fontconfig>\)! <dir>${X11_FONTS_DIR}</dir>\n\1!" \
+ /etc/fonts/local.conf
fi
# Updating cache database.
pushd ${DEST_DIR} >> ${LFS_LOG_FILE}
# The "driver" md5 file maybe empty if the nouveau driver was selected
- if cat ${LFS_PKG_DIR}/${MOD_NAME}/${module}.md5 | grep "[0-9]" 1> /dev/null 2>&1; then
+ if cat ${LFS_PKG_DIR}/${MOD_NAME}/${module}.md5 | grep -q "[0-9]"; then
md5sum -c ${LFS_PKG_DIR}/${MOD_NAME}/${module}.md5 >> ${LFS_LOG_FILE}
if [ $? -ne 0 ]; then
echo " md5sum error for ${module}"
start()
{
- if statusproc clamd | grep "not running" 1> /dev/null 2>&1; then
+ if statusproc clamd | grep -q "not running"; then
# Not taking any chances, removing left-over files
rm -f ${SOCKET_DIR}/clamd.{sock,pid} || return 1
fi
sleep 1
- if statusproc clamav-milter | grep "not running" 1> /dev/null 2>&1; then
+ if statusproc clamav-milter | grep -q "not running"; then
# Not taking any chances, removing left-over files
rm -f ${SOCKET_DIR}/clmilter.sock || return 1
fi
# Option "--postmaster-only" is to send warnings only to postmaster.
- loadproc /usr/sbin/clamav-milter --local --outgoing --headers --postmaster-only ${SOCKET_DIR}/clmilter.sock
+ loadproc /usr/sbin/clamav-milter --local --outgoing --headers \
+ --postmaster-only ${SOCKET_DIR}/clmilter.sock
return $?
}
# There's a problem with the ISAPI DSO module caused from compiling with
# GCC-4.1.2.
# Commenting out the module from the configuration:
- if grep "LoadModule isapi_module" /etc/apache/httpd.conf \
- 1> /dev/null 2>&1; then
+ if grep -q "LoadModule isapi_module" /etc/apache/httpd.conf; then
sed -i -e "s/^LoadModule isapi_module/# &/" /etc/apache/httpd.conf
fi
# Modifying the listening port if an alternate one is specified.
if [ -n "${HTTPD_PORT}" ]; then
- if ! grep "Listen ${HTTPD_PORT}" /etc/apache/httpd.conf \
- 1> /dev/null 2>&1; then
+ if ! grep -q "Listen ${HTTPD_PORT}" /etc/apache/httpd.conf; then
# Adding alternate port to default port of 80
sed -i -e "s%\(Listen 80\)%\1\nListen ${HTTPD_PORT}%" \
/etc/apache/httpd.conf
rmdir ${LFS_TMP}/fonts
chown -v -R root:root ${GS_FONTS_PATH}
- if ! grep "${GS_FONTS_PATH}" /etc/fonts/local.conf 1> /dev/null 2>&1; then
+ if ! grep -q "${GS_FONTS_PATH}" /etc/fonts/local.conf; then
# Adding Ghostscript fonts directory to local configuration file
sed -i -e "s!\(</fontconfig>\)! <dir>${GS_FONTS_PATH}</dir>\n\1!" \
/etc/fonts/local.conf
# To enable PHP support in the Apache web server, a new AddType directive
# must be added to the httpd.conf file.
- if ! grep "application/x-httpd-php" /etc/apache/httpd.conf \
- 1> /dev/null 2>&1; then
+ if ! grep -q "application/x-httpd-php" /etc/apache/httpd.conf; then
echo "AddType application/x-httpd-php .php" >> /etc/apache/httpd.conf
fi
- if ! grep "DirectoryIndex" /etc/apache/httpd.conf | grep "index.php" \
- 1> /dev/null 2>&1; then
+ if ! grep -q "DirectoryIndex" /etc/apache/httpd.conf | grep "index.php"; then
sed -i -e "s!\(^DirectoryIndex index.html.*\)!\1 index.php!g" \
/etc/apache/httpd.conf
fi