Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F170008317
D58933.id184448.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D58933.id184448.diff
View Options
diff --git a/tools/tools/nanobsd/defaults.sh b/tools/tools/nanobsd/defaults.sh
--- a/tools/tools/nanobsd/defaults.sh
+++ b/tools/tools/nanobsd/defaults.sh
@@ -710,8 +710,7 @@
q
EOF
then
- echo "Regular expression pattern not found"
- exit 2
+ err "Regular expression pattern not found"
fi
[ -n "${NANO_NOPRIV_BUILD}" ] && chmod 444 etc/defaults/rc.conf
@@ -903,6 +902,12 @@
#
#######################################################################
+# Print an error message to stderr and exits with code 2
+err() {
+ echo "$@" >&2
+ exit 2
+}
+
#######################################################################
# Common Flash device geometries
#
@@ -960,8 +965,7 @@
NANO_MEDIASIZE=$(( $2 * 1000 * 1000 / 512 ))
;;
*)
- echo "Unknown USB flash device"
- exit 2
+ err "Unknown USB flash device"
;;
esac
}
@@ -1039,8 +1043,7 @@
_NANO_PKG_PACKAGE=$(basename "$x")
done
if [ -z "${_NANO_PKG_PACKAGE}" -o ! -f "${NANO_PACKAGE_DIR}/${_NANO_PKG_PACKAGE}" ]; then
- echo "FAILED: need a pkg/ package for bootstrapping"
- exit 2
+ err "FAILED: need a pkg/ package for bootstrapping"
fi
# Mount packages into chroot
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Sep 4, 5:57 AM (10 h, 14 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
36966054
Default Alt Text
D58933.id184448.diff (1 KB)
Attached To
Mode
D58933: nanobsd: Add an err() convenience function
Attached
Detach File
Event Timeline
Log In to Comment