svn commit: r262790 - projects/release-embedded/release

Glen Barber gjb at FreeBSD.org
Wed Mar 5 17:00:38 UTC 2014


Author: gjb
Date: Wed Mar  5 17:00:37 2014
New Revision: 262790
URL: http://svnweb.freebsd.org/changeset/base/262790

Log:
  Use '-n' and '-z' instead of 'x$foo = x' tests.
  
  Prodded by:	emaste, imp
  Sponsored by:	The FreeBSD Foundation

Modified:
  projects/release-embedded/release/release.sh

Modified: projects/release-embedded/release/release.sh
==============================================================================
--- projects/release-embedded/release/release.sh	Wed Mar  5 16:42:33 2014	(r262789)
+++ projects/release-embedded/release/release.sh	Wed Mar  5 17:00:37 2014	(r262790)
@@ -113,14 +113,14 @@ SRCBRANCH="${SVNROOT}${SRCBRANCH}"
 DOCBRANCH="${SVNROOT}${DOCBRANCH}"
 PORTBRANCH="${SVNROOT}${PORTBRANCH}"
 
-if [ "x${EMBEDDEDBUILD}" != "x" ]; then
+if [ -n "${EMBEDDEDBUILD}" ]; then
 	WITH_DVD=
 	NODOC=yes
 fi
 
 # If PORTS is set and NODOC is unset, force NODOC=yes because the ports tree
 # is required to build the documentation set.
-if [ "x${NOPORTS}" != "x" ] && [ "x${NODOC}" = "x" ]; then
+if [ -n "${NOPORTS}" ] && [ -z "${NODOC}" ]; then
 	echo "*** NOTICE: Setting NODOC=1 since ports tree is required"
 	echo "            and NOPORTS is set."
 	NODOC=yes
@@ -130,10 +130,10 @@ fi
 # The release makefile verifies definedness of NOPORTS/NODOC variables
 # instead of their values.
 DOCPORTS=
-if [ "x${NOPORTS}" != "x" ]; then
+if [ -n "${NOPORTS}" ]; then
 	DOCPORTS="NOPORTS=yes "
 fi
-if [ "x${NODOC}" != "x" ]; then
+if [ -n "${NODOC}" ]; then
 	DOCPORTS="${DOCPORTS}NODOC=yes"
 fi
 
@@ -141,7 +141,7 @@ fi
 # this file, unless overridden by release.conf.  In most cases, these
 # will not need to be changed.
 CONF_FILES="__MAKE_CONF=${MAKE_CONF} SRCCONF=${SRC_CONF}"
-if [ "x${TARGET}" != "x" ] && [ "x${TARGET_ARCH}" != "x" ]; then
+if [ -n "${TARGET}" ] && [ -n "${TARGET_ARCH}" ]; then
 	ARCH_FLAGS="TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH}"
 else
 	ARCH_FLAGS=
@@ -157,11 +157,11 @@ RELEASE_RMAKEFLAGS="${ARCH_FLAGS} KERNCO
 
 # Force src checkout if configured
 FORCE_SRC_KEY=
-if [ "x${SRC_FORCE_CHECKOUT}" != "x" ]; then
+if [ -n "${SRC_FORCE_CHECKOUT}" ]; then
 	FORCE_SRC_KEY="--force"
 fi
 
-if [ ! ${CHROOTDIR} ]; then
+if [ -z "${CHROOTDIR}" ]; then
 	echo "Please set CHROOTDIR."
 	exit 1
 fi
@@ -176,14 +176,14 @@ set -e # Everything must succeed
 mkdir -p ${CHROOTDIR}/usr
 
 ${VCSCMD} ${FORCE_SRC_KEY} ${SRCBRANCH} ${CHROOTDIR}/usr/src
-if [ "x${NODOC}" = "x" ]; then
+if [ -z "${NODOC}" ]; then
 	${VCSCMD} ${DOCBRANCH} ${CHROOTDIR}/usr/doc
 fi
-if [ "x${NOPORTS}" = "x" ]; then
+if [ -z "${NOPORTS}" ]; then
 	${VCSCMD} ${PORTBRANCH} ${CHROOTDIR}/usr/ports
 fi
 
-if [ -z ${CHROOTBUILD_SKIP} ]; then
+if [ -z "${CHROOTBUILD_SKIP}" ]; then
 	cd ${CHROOTDIR}/usr/src
 	env ${CHROOT_MAKEENV} make ${CHROOT_WMAKEFLAGS} buildworld
 	env ${CHROOT_MAKEENV} make ${CHROOT_IMAKEFLAGS} installworld \
@@ -207,7 +207,7 @@ if [ -e ${SRC_CONF} ] && [ ! -c ${SRC_CO
 fi
 
 # Embedded builds do not use the 'make release' target.
-if [ "x${EMBEDDEDBUILD}" != "x" ]; then
+if [ -n "${EMBEDDEDBUILD}" ]; then
 	# If a crochet configuration file exists in *this* checkout of
 	# release/, copy it to the /tmp/external directory within the chroot.
 	# This allows building embedded releases without relying on updated
@@ -236,7 +236,7 @@ if [ -d ${CHROOTDIR}/usr/ports ]; then
 
 	## Trick the ports 'run-autotools-fixup' target to do the right thing.
 	_OSVERSION=$(sysctl -n kern.osreldate)
-	if [ -d ${CHROOTDIR}/usr/doc ] && [ "x${NODOC}" = "x" ]; then
+	if [ -d ${CHROOTDIR}/usr/doc ] && [ -z "${NODOC}" ]; then
 		PBUILD_FLAGS="OSVERSION=${_OSVERSION} BATCH=yes"
 		PBUILD_FLAGS="${PBUILD_FLAGS}"
 		chroot ${CHROOTDIR} make -C /usr/ports/textproc/docproj \


More information about the svn-src-projects mailing list