[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[PATCH 2/3] Support -n flag to run multistrap --simulate instead.



From: Yann Dirson <ydirson@free.fr>

Multistrap's include mechanism is hairy enough that users may need some
support to debug their configs.
---
 polystrap.sh |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/polystrap.sh b/polystrap.sh
index b051a7c..36cfd5b 100755
--- a/polystrap.sh
+++ b/polystrap.sh
@@ -26,7 +26,7 @@
 set -ex
 
 usage() {
-	echo "Usage: $0: [-s suite] [-a arch] [-d directory] [-m mirror] [-p packages] platform\n"
+	echo "Usage: $0: [-n] [-s suite] [-a arch] [-d directory] [-m mirror] [-p packages] platform\n"
 }
 
 export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true LC_ALL=C LANGUAGE=C LANG=C
@@ -37,13 +37,15 @@ if [ "$FAKEROOTKEY" = "" ]; then
         exit
 fi
 
-while getopts s:a:d:m:p: opt; do
+MSTRAP_SIM=
+while getopts s:a:d:m:p:n opt; do
 	case $opt in
 	s) _SUITE="$OPTARG";;
 	a) _ARCH="$OPTARG";;
 	d) _ROOTDIR="$OPTARG";;
 	m) _MIRROR="$OPTARG";;
 	p) _PACKAGES="$OPTARG";;
+	n) MSTRAP_SIM="--simulate";;
 	?) usage; exit 1;;
 	esac
 done
@@ -100,7 +102,9 @@ while read line; do
 done < $PLATFORM/multistrap.conf
 
 # download and extract packages
-multistrap -f "$MULTISTRAPCONF"
+multistrap $MSTRAP_SIM -f "$MULTISTRAPCONF"
+[ -z "$MSTRAP_SIM" ] || exit 0
+
 rm -f "$MULTISTRAPCONF"
 
 # backup ldconfig and ldd
-- 
1.7.5.4


Reply to: