summaryrefslogtreecommitdiffstats
path: root/scripts/pacman-optimize.sh.in
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2008-02-18 04:15:06 +0100
committerDan McGee <dan@archlinux.org>2008-02-18 04:25:41 +0100
commit355930654693b416725e170ad0cb14d0251626e4 (patch)
tree8981df01d6518eb67f6e359e399b9b9465bf5e74 /scripts/pacman-optimize.sh.in
parent2374c81e55abc0f7252fad7eb53d2b75bb33f750 (diff)
downloadpacman-355930654693b416725e170ad0cb14d0251626e4.tar.gz
pacman-355930654693b416725e170ad0cb14d0251626e4.tar.xz
scripts: allow usage when gettext is not installed
Address the issue of our scripts not working so great when gettext is not available. This has come up in multiple bug reports, and is relatively easy to address by adding a simple check and a stub function if gettext was not found that simply echos the original message. Addresses concerns from FS#9214 and FS#9607. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'scripts/pacman-optimize.sh.in')
-rw-r--r--scripts/pacman-optimize.sh.in9
1 files changed, 9 insertions, 0 deletions
diff --git a/scripts/pacman-optimize.sh.in b/scripts/pacman-optimize.sh.in
index 21afd276..0cd108b7 100644
--- a/scripts/pacman-optimize.sh.in
+++ b/scripts/pacman-optimize.sh.in
@@ -70,6 +70,15 @@ die_r() {
die "$@"
}
+# PROGRAM START
+
+# determine whether we have gettext; make it a no-op if we do not
+if [ ! $(type -t gettext) ]; then
+ gettext() {
+ echo "$@"
+ }
+fi
+
if [ "$1" = "-h" -o "$1" = "--help" ]; then
usage
exit 0