Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 28 Jul 2017 01:59:53 +0000 (UTC)
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r321636 - head/tools/tools/nanobsd
Message-ID:  <201707280159.v6S1xr9P099662@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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"
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201707280159.v6S1xr9P099662>