From 6eb0b5bb26a86d4a52db96dfa1aea5e97793cafe Mon Sep 17 00:00:00 2001
From: jdh8d <jdh8d@git.zephyr-software.com>
Date: Tue, 6 Feb 2018 20:48:11 +0000
Subject: [PATCH] clean-all update to deal with pedi cleanup when clean-all of
 a sub-module.

Former-commit-id: ef291229559c9588a94a5fd492ca883d37650aff
---
 clean-all.sh | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/clean-all.sh b/clean-all.sh
index 1b86d26ad..66c45d56d 100755
--- a/clean-all.sh
+++ b/clean-all.sh
@@ -72,10 +72,15 @@ fi
 
 cd $PEASOUP_UMBRELLA_DIR
 
-# clean up installation
-$PEDI_HOME/pedi -c -m manifest.txt
-if [ -d "$PS_INSTALL" ]; then
-	echo "removing $PS_INSTALL"
-	rm -fr "$PS_INSTALL"
+# clean up installation if this module is the root of the install.
+# skip pedi cleanup if we are part of a larger project, as future builds
+# won't know how to install properly.  
+if [[ $(head -1 manifest.txt.config) == $(pwd) ]] ; then 
+
+	$PEDI_HOME/pedi -c -m manifest.txt
+	if [ -d "$PS_INSTALL" ]; then
+		echo "removing $PS_INSTALL"
+		rm -fr "$PS_INSTALL"
+	fi
 fi
 
-- 
GitLab