summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2013-11-03 12:33:22 -0500
committerLuke Shumaker <LukeShu@sbcglobal.net>2013-11-03 12:33:22 -0500
commit12a139ee5fb29a727c330fa61372f3d8d5fe7ab7 (patch)
treec098288e8ba47d1c339fba34e1d5e319a73c17ae
parentc28a7d64bd9f10236a255c284442b1526c6b7990 (diff)
treepkg: internationalize (sometimes changing the format of a message)
Changes in message format: - Terminal-titles now begin with capital letters - "error!" -> "Error!" - "done" -> "Done" - signal handler errors changed from (treepkg) MESSAGE (leftovers on BUILDDIR) to treepkg: MESSAGE (leftovers on BUILDDIR)
-rwxr-xr-xsrc/treepkg14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/treepkg b/src/treepkg
index 5c1312d..f7cc338 100755
--- a/src/treepkg
+++ b/src/treepkg
@@ -26,8 +26,8 @@ term_title "$(basename $0)"
# End inmediately but print an useful message
trap_exit() {
- term_title "error!"
- error "($(basename $0)) $@ (leftovers on ${BUILDDIR})"
+ term_title "${0##*/}: $(_ 'Error!')"
+ error "%s: %s (leftovers on %s" "${0##*/}" "$*" "${BUILDDIR}"
exit 1
}
@@ -79,7 +79,7 @@ guess_repo() {
}
if [ ! -f PKGBUILD ]; then
- error "Missing PKGBUILD ($PWD)"
+ error "Missing PKGBUILD (%s)" "$PWD"
exit 1
fi
@@ -179,7 +179,7 @@ if [ ${DEPTH} -eq 0 ]; then
${VERBOSE} && msg "Starting build" || true
if ${BUILD}; then
- ${VERBOSE} && msg "Build tree stored in ${BUILDORDER}" || true
+ ${VERBOSE} && msg "Build tree stored in %s" "${BUILDORDER}" || true
# Build everything sorting the build dir
# The reverse order ensures we start by the deepest packages
@@ -189,7 +189,7 @@ if [ ${DEPTH} -eq 0 ]; then
# Skip if already built (faster than calling is_build again)
if [ -f "${BUILDDIR}/${_pkg}/built_ok" ]; then continue; fi
- ${VERBOSE} && msg "Building ${_pkg/_/ }" || true
+ ${VERBOSE} && msg "Building %s" "${_pkg/_/ }" || true
# Remove leading zeros and space if any
term_title "$(echo ${_pkg/_/ } | sed "s/^0\+ \?//")"
@@ -214,11 +214,11 @@ if [ ${DEPTH} -eq 0 ]; then
fi
if ${CLEANUP} ; then
- msg2 "Removing ${BUILDDIR}"
+ msg2 "Removing %s" "${BUILDDIR}"
rm -rf "${BUILDDIR}"
fi
fi
-term_title "done"
+term_title "$(_ Done)"
exit $?