From 7feaa9e2eb12361c05a00892e22f59f9e0468b94 Mon Sep 17 00:00:00 2001
From: Stefan Fiedler <stefan.fiedler@students.jku.at>
Date: Sun, 5 Aug 2007 19:47:46 +0000
Subject: [PATCH] Stefan Fiedler: 	scripts/Config: two fixes to the
 recent change: 	- don't override actual setting of ROCKCFG_EXPERT with
 default 		on the first config cycle 	- correctly pass
 -nobroken option to scripts/Create-PkgList 	also reset some dialog status
 variables on each config cycle

[2007071000390621907] (https://www.rocklinux.net/submaster)



git-svn-id: http://www.rocklinux.org/svn/rock-linux/trunk@8663 c5f82cb5-29bc-0310-9cd0-bff59a50e3bc
---
 scripts/Config      | 23 ++++++++++-------------
 scripts/config.func |  5 +++--
 2 files changed, 13 insertions(+), 15 deletions(-)

diff --git a/scripts/Config b/scripts/Config
index 357b32fc8..84e1736ad 100755
--- a/scripts/Config
+++ b/scripts/Config
@@ -151,15 +151,8 @@ touch config/$config/{config{,_usr},packages}
 rm -rf $swpdir
 cp -r config/$config $swpdir
 
-. $swpdir/config
-. $swpdir/config_usr
-
 current=""
-menu_this=0 ; menu_current=0 ; menu_counter=0
-menu_stack=x
-
-spacer="" ; expert=0 ; tabspace="5" ; tabspace_list=""
-commentnr=0 ; editfilenr=0
+menu_this=0 ; menu_current=0 ; menu_stack=x
 
 include ()
 {
@@ -182,6 +175,9 @@ export CFGTEMP_ARCH="$arch"
 export CFGTEMP_ID="$rockver"
 export ROCKCFG_EXPERT=0
 
+. $swpdir/config
+. $swpdir/config_usr
+
 include "architecture/*/preconfig.in"
 include "misc/*/preconfig.in"
 include "target/*/preconfig.in"
@@ -191,15 +187,16 @@ do_config_cycle=1
 recreate_packages=1
 while [ "$do_config_cycle" == 1 ] ; do
 	pkg_cmd="$ROCKCFG_ARCH"
-	[ "$ROCKCFG_DISABLE_BROKEN" = 1 ] && pkg_cmd="${pkg_cmd}-nobroken"
+	[ "$ROCKCFG_DISABLE_BROKEN" = 1 ] && pkg_cmd="${pkg_cmd} -nobroken"
+	pkg_cache="$swpdir/config.pcache.${pkg_cmd// }"
 
 	if [ "$old_pkg_cmd" != "$pkg_cmd" ] ; then
 		recreate_packages=1
 	fi
 	if [ "$recreate_packages" == 1 ] ; then
 		recreate_packages=0
-		if [ -f $swpdir/config.pcache.$pkg_cmd ] ; then
-			cp -a $swpdir/config.pcache.$pkg_cmd $swpdir/packages
+		if [ -f "$pkg_cache" ] ; then
+			cp -a "$pkg_cache" "$swpdir/packages"
 			pkgin
 		else
 			eval "./scripts/Create-PkgList $pkg_cmd" \
@@ -211,11 +208,11 @@ while [ "$do_config_cycle" == 1 ] ; do
 			fi
 			include "$swpdir/preconfig.in.tmp"
 			pkgout
-			cp -a $swpdir/packages $swpdir/config.pcache.$pkg_cmd
+			cp -a "$swpdir/packages" "$pkg_cache"
 		fi
 		old_pkg_cmd="$pkg_cmd"
 	else
-		cp -a $swpdir/config.pcache.$pkg_cmd $swpdir/packages
+		cp -a "$pkg_cache" "$swpdir/packages"
 		pkgin
 	fi
 
diff --git a/scripts/config.func b/scripts/config.func
index 83a46a4d0..b0894e2b5 100644
--- a/scripts/config.func
+++ b/scripts/config.func
@@ -483,8 +483,9 @@ block_end() {
 
 # has to be called at the beginning of each config cycle
 config_cycle() {
-	expert=0;
-	menu_counter=0;
+	expert=0
+	menu_counter=0 ; commentnr=0 ; editfilenr=0
+	spacer="" ; tabspace="5" ; tabspace_list=""
 }
 
 expert_begin() {