summaryrefslogtreecommitdiffstats
path: root/src/opkbuild
diff options
context:
space:
mode:
Diffstat (limited to 'src/opkbuild')
-rw-r--r--src/opkbuild13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/opkbuild b/src/opkbuild
index d920da9..b3a5f84 100644
--- a/src/opkbuild
+++ b/src/opkbuild
@@ -31,12 +31,16 @@ print_usage()
error()
{
printf 'opkbuild: [%s] Error\n' "${1}"
+ if ${dbg}; then
+ printf 'opkbuild: Starting debugging shell...' >&2
+ /bin/sh
+ fi
cd ..
rm -Rf tmp 2> /dev/null
exit 1
}
-opts=$(getopt -n "${0}" -o 'r:p:' -- "${@}")
+opts=$(getopt -n "${0}" -o 'r:p:d' -- "${@}")
if [ ${?} -ne 0 ]; then
print_usage "${0}" >&2
exit 1;
@@ -52,6 +56,10 @@ while true; do
platform=${2}
shift 2
;;
+ -d)
+ dbg=true
+ shift
+ ;;
--)
shift
break
@@ -71,6 +79,9 @@ if [ ${?} -ne 0 ]; then
printf 'opkbuild: Error running command to gain UID 0\n' >&2
exit 1
fi
+if [ -z "${dbg}" ]; then
+ dbg=false
+fi
# Sanity checks.
printf 'opkbuild: Checking for sanity...\n'