From owner-svn-src-head@freebsd.org Fri Jul 28 01:59:55 2017 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 20D4BDB63B5; Fri, 28 Jul 2017 01:59:55 +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 458716D6E1; Fri, 28 Jul 2017 01:59:54 +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 v6S1xrua099663; Fri, 28 Jul 2017 01:59:53 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6S1xr9P099662; Fri, 28 Jul 2017 01:59:53 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201707280159.v6S1xr9P099662@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 28 Jul 2017 01:59:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321636 - head/tools/tools/nanobsd X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/tools/tools/nanobsd X-SVN-Commit-Revision: 321636 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.23 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: Fri, 28 Jul 2017 01:59:55 -0000 Author: imp Date: Fri Jul 28 01:59:53 2017 New Revision: 321636 URL: https://svnweb.freebsd.org/changeset/base/321636 Log: Properly expand shell glob characters in NANO_PACKAGE_LIST. The defualt NANO_PACKAGE_LIST is *, which fails to work properly. Expand glob characters and make sure that we install the special pkg package first. Sponsored by: Netflix Submitted by: wout at canodus dot be PR: 219405 MFC After: 3 days Modified: head/tools/tools/nanobsd/defaults.sh Modified: head/tools/tools/nanobsd/defaults.sh ============================================================================== --- head/tools/tools/nanobsd/defaults.sh Fri Jul 28 01:17:38 2017 (r321635) +++ head/tools/tools/nanobsd/defaults.sh Fri Jul 28 01:59:53 2017 (r321636) @@ -780,7 +780,6 @@ cust_pkgng ( ) ( echo "FAILED: need a pkg/ package for bootstrapping" exit 2 fi - NANO_PACKAGE_LIST="${_NANO_PKG_PACKAGE} ${NANO_PACKAGE_LIST}" # Mount packages into chroot mkdir -p ${NANO_WORLDDIR}/_.p @@ -788,14 +787,25 @@ cust_pkgng ( ) ( trap "umount ${NANO_WORLDDIR}/_.p ; rm -rf ${NANO_WORLDDIR}/_.p" 1 2 15 EXIT - # Install packages - todo="$(echo "${NANO_PACKAGE_LIST}" | awk '{ print NF }')" - echo "=== TODO: $todo" - echo "${NANO_PACKAGE_LIST}" - echo "===" - for _PKG in ${NANO_PACKAGE_LIST}; do - CR "${PKGCMD} add /_.p/${_PKG}" - done + # Install pkg-* package + CR "${PKGCMD} add /_.p/${_NANO_PKG_PACKAGE}" + + ( + # Expand any glob characters in pacakge list + cd "${NANO_PACKAGE_DIR}" + _PKGS=`find ${NANO_PACKAGE_LIST} -not -name "${_NANO_PKG_PACKAGE}" -print | sort | uniq` + + # Show todo + todo=`echo "$_PKGS" | wc -l` + echo "=== TODO: $todo" + echo "$_PKGS" + echo "===" + + # Install packages + for _PKG in $_PKGS; do + CR "${PKGCMD} add /_.p/${_PKG}" + done + ) CR0 "${PKGCMD} info"