|
@@ -1,15 +1,20 @@
|
|
#!/bin/sh
|
|
#!/bin/sh
|
|
-#
|
|
|
|
-if [ "$#" -ne 0 ]; then
|
|
|
|
- echo "Run this script to relocate the buildroot SDK at that location"
|
|
|
|
|
|
+
|
|
|
|
+if [ "$#" -gt 1 ]; then
|
|
|
|
+ echo "Usage: $0 [path]"
|
|
|
|
+ echo "Run this script to relocate the buildroot SDK to the current location"
|
|
|
|
+ echo "If [path] is given, sets the location to [path] (without moving it)"
|
|
exit 1
|
|
exit 1
|
|
fi
|
|
fi
|
|
|
|
|
|
-LOCFILE="share/buildroot/sdk-location"
|
|
|
|
-FILEPATH="$(readlink -f "$0")"
|
|
|
|
-NEWPATH="$(dirname "${FILEPATH}")"
|
|
|
|
|
|
+cd "$(dirname "$(readlink -f "$0")")"
|
|
|
|
+if [ "$#" -eq 1 ]; then
|
|
|
|
+ NEWPATH="$1"
|
|
|
|
+else
|
|
|
|
+ NEWPATH="${PWD}"
|
|
|
|
+fi
|
|
|
|
|
|
-cd "${NEWPATH}"
|
|
|
|
|
|
+LOCFILE="share/buildroot/sdk-location"
|
|
if [ ! -r "${LOCFILE}" ]; then
|
|
if [ ! -r "${LOCFILE}" ]; then
|
|
echo "Previous location of the buildroot SDK not found!"
|
|
echo "Previous location of the buildroot SDK not found!"
|
|
exit 1
|
|
exit 1
|