summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorP. J. McDermott <pjm@nac.net>2012-10-16 19:17:07 (EDT)
committer P. J. McDermott <pjm@nac.net>2012-10-16 19:17:07 (EDT)
commit03cb315a9fdbf35913bddbe7e4f30e867c68bb65 (patch)
tree9d512d29b01da5e8e3fc4cb0f8e39dee2a874fe5
parent629d835a83936f64bc60081bf19fa0ce485228a8 (diff)
Make testsetup.sh print error and info messages.
-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 "${@}"