summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xtestsetup.sh38
1 files changed, 29 insertions, 9 deletions
diff --git a/testsetup.sh b/testsetup.sh
index c1e3f59..e38f9a1 100755
--- a/testsetup.sh
+++ b/testsetup.sh
@@ -46,19 +46,31 @@ main()
build_arch="${1}"
build_plat="${2}"
- mkdir -p "${sysconfdir}"
- echo "${build_arch}" >"${sysconfdir}/proteanos_arch"
- echo "${build_plat}" >"${sysconfdir}/proteanos_plat"
-
- mkdir -p "${datadir}/opkbuild/archtab"
+ printf 'Generating build system configuration...\n'
+ mkdir -p "${sysconfdir}" || \
+ error 'Cannot make system configuration directory'
+ echo "${build_arch}" >"${sysconfdir}/proteanos_arch" || \
+ error 'Cannot write proteanos_arch'
+ echo "${build_plat}" >"${sysconfdir}/proteanos_plat" || \
+ error 'Cannot write proteanos_plat'
+
+ printf 'Generating distribution architecture data...\n'
+ mkdir -p "${datadir}/opkbuild/archtab" || \
+ error 'Cannot make architecture table directory'
printf 'x86_64-unknown-linux-gnu\nx86, i386\n' \
- >"${datadir}/opkbuild/archtab/core-linux-eglibc"
+ >"${datadir}/opkbuild/archtab/core-linux-eglibc" || \
+ error 'Cannot write architecture data'
printf 'i686-unknown-linux-gnu\nx86, i386\n' \
- >"${datadir}/opkbuild/archtab/i686-linux-eglibc"
+ >"${datadir}/opkbuild/archtab/i686-linux-eglibc" || \
+ error 'Cannot write architecture data'
printf 'i686-unknown-freebsd9.0\nx86, i386\n' \
- >"${datadir}/opkbuild/archtab/i686-kfreebsd-eglibc"
+ >"${datadir}/opkbuild/archtab/i686-kfreebsd-eglibc" || \
+ error 'Cannot write architecture data'
printf 'arm-cortex_a8-linux-gnueabi\narm\n' \
- >"${datadir}/opkbuild/archtab/cortexa8-linux-eglibc"
+ >"${datadir}/opkbuild/archtab/cortexa8-linux-eglibc" || \
+ error 'Cannot write architecture data'
+
+ printf 'Done!\n'
}
print_usage()
@@ -129,4 +141,12 @@ EOF
done
}
+error()
+{
+ printf '%s: Error: ' "${0##*/}"
+ printf "${@}"
+ printf '\n'
+ exit 1
+}
+
main "${@}"