Hi,

Some time ago I've tried to fix sb2-config-debian, allowing recursive calls to it. This worked for empty environments, however, broke reinitializing existing ones. This patch should fix that.

Thanks
--
Karol Lewandowski | Samsung Poland R&D Center | Linux/Platform
>From 29e88c14b7849b3a078ff3e88814e9c7928e6eac Mon Sep 17 00:00:00 2001
From: Karol Lewandowski <[email protected]>
Date: Tue, 29 Mar 2011 17:15:24 +0200
Subject: [PATCH] Make it possible to reinitialize configured target

This commit fixes breakage caused by

  "Fix: Allow sb2-config-debian to be called recursively"

With these changes it wasn't possible to upgrade existing
Debian config - only to create it from scratch.
---
 utils/sb2-config-debian |   11 ++++-------
 1 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/utils/sb2-config-debian b/utils/sb2-config-debian
index 62d2b2f..8362a26 100755
--- a/utils/sb2-config-debian
+++ b/utils/sb2-config-debian
@@ -81,10 +81,10 @@ fi
 
 SBOX_CONFIG_DIR=~/.scratchbox2/$TARGET/sb2.config.d 
 
-if [ -f $SBOX_CONFIG_DIR/debian.conf -a ! -s $SBOX_CONFIG_DIR/debian.conf ]; then
-	# sb2-upgrade-config called us when creating initial environment
-	exit 0
-fi
+# Handle recursive execution gracefully
+# (due to sb2-upgrade-config).
+[ "$SBOX_CONFIG_DEBIAN_UPGRADE" ] && exit 0
+export SBOX_CONFIG_DEBIAN_UPGRADE=yes
 
 if [ -f $SBOX_CONFIG_DIR/gcc.config.sh ]; then
 	# configured with a cross-compiler;
@@ -157,9 +157,6 @@ if [ ! -f $SBOX_CONFIG_DIR/debian.conf ]; then
 	# file, otherwise "sb2" will fail to run because
 	# this config file is mandatory now.
 	#
-	# Create empty config file to allow us detect loops -
-	# "sb2-upgrade-config" needs to be called to upgrade ld*.conf
-	# files but it will also try to execute us again...
 	: >$SBOX_CONFIG_DIR/debian.conf
 fi
 
-- 
1.7.2.3

_______________________________________________
Scratchbox-devel mailing list
[email protected]
http://lists.scratchbox.org/cgi-bin/mailman/listinfo/scratchbox-devel

Reply via email to