From 12a139ee5fb29a727c330fa61372f3d8d5fe7ab7 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 3 Nov 2013 12:33:22 -0500 Subject: 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) --- src/treepkg | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src') 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 $? -- cgit v1.2.3-54-g00ecf