From 56384e572d419a48439a90b9481a715a13a109c8 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 5 Jan 2014 17:09:11 -0500 Subject: src/lib/: set TEXTDOMAIN differently for internal messages This allows us to fix the long-standing bug that libremessages forces TEXTDOMAIN=libretools --- src/lib/librelib | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) (limited to 'src/lib/librelib') diff --git a/src/lib/librelib b/src/lib/librelib index a58f5d3..3b05e37 100755 --- a/src/lib/librelib +++ b/src/lib/librelib @@ -16,18 +16,31 @@ default_libdir=/usr/lib/libretools -if ! type gettext &>/dev/null; then - gettext() { echo "$@"; } +if type gettext &>/dev/null; then + _() { gettext "$@"; } +else + _() { echo "$@"; } fi +_l() { + TEXTDOMAIN='librelib' TEXTDOMAINDIR='/usr/share/locale' "$@" +} + print() { - mesg=$1 + local mesg="$(_ "$1")" shift - printf -- "$(gettext "$mesg")\n" "$@" + printf -- "$mesg\n" "$@" +} + +_html_whitespace_collapse() { + [[ $# == 0 ]] || panic + tr '\n' ' ' | sed -r -e 's/\t/ /g' -e 's/ +/ /g' } prose() { - print "$@" | fmt -su + [[ $# -ge 1 ]] || panic + local mesg="$(_ "$(_html_whitespace_collapse <<<"$1")")"; shift + printf -- "$mesg" "$@" | fmt -u } cmd=${0##*/} @@ -54,11 +67,11 @@ usage() { main() { if [[ $# != 1 ]]; then - usage >&2 + _l usage >&2 return 2 fi if [[ $1 == '-h' ]]; then - usage + _l usage return 0; fi @@ -76,7 +89,7 @@ main() { return 0; fi done - print '%s: could not find library: %s' "$cmd" "$lib" >> /dev/stderr + _l print '%s: could not find library: %s' "$cmd" "$lib" >> /dev/stderr return 1 } -- cgit v1.2.3-2-g168b From b129824bfc9c5c85cadf98dfb724405d63dfc6c3 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 20 Jan 2014 00:59:48 -0500 Subject: normalize to use >&2 instead of /dev/stderr --- src/lib/librelib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/lib/librelib') diff --git a/src/lib/librelib b/src/lib/librelib index 3b05e37..c21532b 100755 --- a/src/lib/librelib +++ b/src/lib/librelib @@ -89,7 +89,7 @@ main() { return 0; fi done - _l print '%s: could not find library: %s' "$cmd" "$lib" >> /dev/stderr + _l print '%s: could not find library: %s' "$cmd" "$lib" >&2 return 1 } -- cgit v1.2.3-2-g168b From ea11eca851e1b54e36d310f4d69e099f169191e8 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 2 Feb 2014 00:05:22 -0500 Subject: I forgot to bump the copyright year on all the files I've touched this year --- src/lib/librelib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/lib/librelib') diff --git a/src/lib/librelib b/src/lib/librelib index c21532b..e9c8c8b 100755 --- a/src/lib/librelib +++ b/src/lib/librelib @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# Copyright (c) 2013 by Luke Shumaker +# Copyright (c) 2013-2014 by Luke Shumaker # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by -- cgit v1.2.3-2-g168b From c43f0808583070a22e904cd650e8ed17fe781806 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 2 Feb 2014 00:20:19 -0500 Subject: Normalize to use the string "Copyright (C)" --- src/lib/librelib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/lib/librelib') diff --git a/src/lib/librelib b/src/lib/librelib index e9c8c8b..d0a06e5 100755 --- a/src/lib/librelib +++ b/src/lib/librelib @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# Copyright (c) 2013-2014 by Luke Shumaker +# Copyright (C) 2013-2014 by Luke Shumaker # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by -- cgit v1.2.3-2-g168b From d25f30f25ce61367c81133c9cd01fe3169d8f6c0 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Fri, 21 Mar 2014 14:39:06 -0400 Subject: Do an audit of copyright and license claims --- src/lib/librelib | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/lib/librelib') diff --git a/src/lib/librelib b/src/lib/librelib index d0a06e5..63d9a26 100755 --- a/src/lib/librelib +++ b/src/lib/librelib @@ -1,5 +1,7 @@ #!/usr/bin/env bash -# Copyright (C) 2013-2014 by Luke Shumaker +# Copyright (C) 2013-2014 Luke Shumaker +# +# License: GNU GPLv3+ # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by -- cgit v1.2.3-2-g168b