From owner-svn-src-head@freebsd.org Mon Dec 7 10:24:39 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A91EA9B978E; Mon, 7 Dec 2015 10:24:39 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5BD1218AC; Mon, 7 Dec 2015 10:24:39 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB7AOcqL094297; Mon, 7 Dec 2015 10:24:38 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB7AOcjr094296; Mon, 7 Dec 2015 10:24:38 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201512071024.tB7AOcjr094296@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 7 Dec 2015 10:24:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291929 - head/tools/tools/nanobsd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2015 10:24:39 -0000 Author: imp Date: Mon Dec 7 10:24:38 2015 New Revision: 291929 URL: https://svnweb.freebsd.org/changeset/base/291929 Log: Make sure to quote the arg after -n and -z tests. Modified: head/tools/tools/nanobsd/defaults.sh (contents, props changed) Modified: head/tools/tools/nanobsd/defaults.sh ============================================================================== --- head/tools/tools/nanobsd/defaults.sh Mon Dec 7 07:22:21 2015 (r291928) +++ head/tools/tools/nanobsd/defaults.sh Mon Dec 7 10:24:38 2015 (r291929) @@ -270,7 +270,7 @@ tgt_dir2symlink () ( cd "${NANO_WORLDDIR}" rm -rf "$dir" ln -s "$symlink" "$dir" - if [ -n $NANO_METALOG ]; then + if [ -n "$NANO_METALOG" ]; then echo "./${dir} type=link mode=0777 link=${symlink}" >> ${NANO_METALOG} fi ) @@ -497,7 +497,7 @@ fixup_before_diskimage ( ) ( # impossible to trap, so go ahead remove the size= keyword. For this # narrow use, it doesn't buy us any protection and just gets in the way. # The dedup tool's output must be sorted due to limitations in awk. - if [ -n ${NANO_METALOG} ]; then + if [ -n "${NANO_METALOG}" ]; then pprint 2 "Fixing metalog" cp ${NANO_METALOG} ${NANO_METALOG}.pre (echo "/set uname=${NANO_DEF_UNAME} gname=${NANO_DEF_GNAME}" && @@ -751,7 +751,7 @@ create_diskimage ( ) ( nano_umount ${MNT} # Override the label from the first partition so we # don't confuse glabel with duplicates. - if [ -n ${NANO_LABEL} ]; then + if [ -n "${NANO_LABEL}" ]; then tunefs -L ${NANO_LABEL}"${NANO_SLICE_ALTROOT}a" /dev/${MD}${NANO_SLICE_ALTROOT}a fi fi @@ -760,12 +760,12 @@ create_diskimage ( ) ( populate_cfg_slice /dev/${MD}${NANO_SLICE_CFG} "${NANO_CFGDIR}" ${MNT} "${NANO_SLICE_CFG}" # Create Data slice, if any. - if [ -n $NANO_SLICE_DATA -a $NANO_SLICE_CFG = $NANO_SLICE_DATA -a \ - $NANO_DATASIZE -ne 0 ]; then + if [ -n "$NANO_SLICE_DATA" -a "$NANO_SLICE_CFG" = "$NANO_SLICE_DATA" -a \ + "$NANO_DATASIZE" -ne 0 ]; then pprint 2 "NANO_SLICE_DATA is the same as NANO_SLICE_CFG, fix." exit 2 fi - if [ $NANO_DATASIZE -ne 0 -a -n $NANO_SLICE_DATA ] ; then + if [ $NANO_DATASIZE -ne 0 -a -n "$NANO_SLICE_DATA" ] ; then populate_data_slice /dev/${MD}${NANO_SLICE_DATA} "${NANO_DATADIR}" ${MNT} "${NANO_SLICE_DATA}" fi