summarylogtreecommitdiffstats
path: root/setup-unattended.patch
blob: 527cd8b42d2032d55ed0e6f618f28e186f66edc4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
--- setup.sh	2020-07-18 10:13:04.994912357 -0400
+++ setup.sh	2020-07-18 10:16:38.985654960 -0400
@@ -166,15 +166,7 @@
 			return
 		fi
 
-		echo "Do you want to register the Zephyr-sdk at location: $target_sdk_dir"
-		echo "  in the CMake package registry (y/n)?"
-
-		while read confirm; do
-			[ "$confirm" = "Y" -o "$confirm" = "y" -o "$confirm" = "n" \
-			-o "$confirm" = "N" ] && break
-			echo "Invalid input \"$confirm\", please input 'y' or 'n': "
-		done
-
+		read_confirm "registering Zephyr-sdk CMake module (at $target_sdk_dir)"
 		if [ "$confirm" = "y" -o "$confirm" = "Y" ]; then
 			if [ ! -d $ZEPHYR_SDK_REGISTRY_DIR ]; then
 				mkdir -p $ZEPHYR_SDK_REGISTRY_DIR
--- pkg/zephyr-sdk/opt/zephyr-sdk/setup.sh.orig	2020-07-18 10:27:09.440996750 -0400
+++ pkg/zephyr-sdk/opt/zephyr-sdk/setup.sh	2020-07-18 10:28:11.268841053 -0400
@@ -71,7 +71,10 @@
 			;;
 		-y )
 			confirm="y";
-			rc_confirm="y";
+			if [ -z "$rc_confirm" ]
+			then
+			  rc_confirm="y"
+			fi
 			;;
 		-rc )
 			rc_confirm="y";
--- pkg/zephyr-sdk/opt/zephyr-sdk/setup.sh.orig	2020-07-18 11:12:04.328724883 -0400
+++ pkg/zephyr-sdk/opt/zephyr-sdk/setup.sh	2020-07-18 11:12:40.741607822 -0400
@@ -158,7 +158,7 @@
 
 do_cmake_package()
 {
-	ZEPHYR_SDK_REGISTRY_DIR=$HOME/.cmake/packages/Zephyr-sdk
+	: ${ZEPHYR_SDK_REGISTRY_DIR:=$HOME/.cmake/packages/Zephyr-sdk}
 
 	type md5sum
 	if [ $? -eq 0 ]; then