From owner-svn-src-head@freebsd.org Sat Jul 28 00:33:41 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9FB44105B94D; Sat, 28 Jul 2018 00:33:41 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 444EF70D13; Sat, 28 Jul 2018 00:33:41 +0000 (UTC) (envelope-from eadler@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 05A121F32D; Sat, 28 Jul 2018 00:33:41 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w6S0Xech006731; Sat, 28 Jul 2018 00:33:40 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w6S0XeqF006730; Sat, 28 Jul 2018 00:33:40 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201807280033.w6S0XeqF006730@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sat, 28 Jul 2018 00:33:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336799 - head/tools/build X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/tools/build X-SVN-Commit-Revision: 336799 X-SVN-Commit-Repository: base 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.27 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: Sat, 28 Jul 2018 00:33:41 -0000 Author: eadler Date: Sat Jul 28 00:33:40 2018 New Revision: 336799 URL: https://svnweb.freebsd.org/changeset/base/336799 Log: tools/build/beinstall.sh: Use some slightly better shell syntax; reduce duplication This is is a first pass at improving the be installer. Reviewed By: will Differential Revision: https://reviews.freebsd.org/D16081 Modified: head/tools/build/beinstall.sh Modified: head/tools/build/beinstall.sh ============================================================================== --- head/tools/build/beinstall.sh Fri Jul 27 23:38:31 2018 (r336798) +++ head/tools/build/beinstall.sh Sat Jul 28 00:33:40 2018 (r336799) @@ -69,7 +69,7 @@ cleanup() { errx() { cleanup - echo "error: $*" + echo "error: $@" exit 1 } @@ -107,16 +107,17 @@ if [ -e .git ] ; then [ $? -ne 0 ] && errx "Can't lookup git commit timestamp" commit_ts=$(date -r ${commit_time} '+%Y%m%d.%H%M%S') elif [ -d .svn ] ; then - if [ -f /usr/bin/svnlite ]; then - commit_ts=$( svnlite info --show-item last-changed-date | sed -e 's/\..*//' -e 's/T/./' -e 's/-//g' -e s'/://g' ) - elif [ -f /usr/local/bin/svn ]; then - commit_ts=$( svn info --show-item last-changed-date | sed -e 's/\..*//' -e 's/T/./' -e 's/-//g' -e s'/://g' ) - else - errx "Can't lookup Subversion commit timestamp" - fi + if [ -e /usr/bin/svnlite ]; then + svn=/usr/bin/svnlite + elif [ -e /usr/local/bin/svn ]; then + svn=/usr/local/bin/svn + else + errx "Unable to find subversion" + fi + commit_ts="$( "$svn" info --show-item last-changed-date | sed -e 's/\..*//' -e 's/T/./' -e 's/-//g' -e s'/://g' )" [ $? -ne 0 ] && errx "Can't lookup Subversion commit timestamp" else - errx "Unable to determine sandbox type" + errx "Unable to determine source control type" fi commit_ver=$(${objdir}/bin/freebsd-version/freebsd-version -u 2>/dev/null) @@ -137,8 +138,8 @@ beadm create ${BENAME} >/dev/null || errx "Unable to c beadm mount ${BENAME} ${BE_TMP}/mnt || errx "Unable to mount BE ${BENAME}." echo "Mounted ${BENAME} to ${BE_MNTPT}, performing install/update ..." -make $* DESTDIR=${BE_MNTPT} installkernel || errx "Installkernel failed!" -make $* DESTDIR=${BE_MNTPT} installworld || errx "Installworld failed!" +make "$@" DESTDIR=${BE_MNTPT} installkernel || errx "Installkernel failed!" +make "$@" DESTDIR=${BE_MNTPT} installworld || errx "Installworld failed!" if [ -n "${CONFIG_UPDATER}" ]; then "update_${CONFIG_UPDATER}"