diff options
author | Dave Reisner <dreisner@archlinux.org> | 2012-01-23 17:14:25 -0500 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2012-01-30 21:31:38 -0600 |
commit | 9e9835f4640a45cc758fa64de5923d7f836fe1f4 (patch) | |
tree | a105d263cda79f687fed3a91fb4bfec4267c1eb6 /scripts/pacman-optimize.sh.in | |
parent | 7ff1b945f6c8b2286f04626be39291a7527119f4 (diff) | |
download | pacman-9e9835f4640a45cc758fa64de5923d7f836fe1f4.tar.xz |
scripts: always use printf with embedded gettext
This addresses two problems:
1) echo's behavior is inconsistent when dealing with flags, and can
potentially be problematic.
$ echo -n
$ echo -- -n
-- -n
2) Always using the end of options markers prevents translated strings
from throwing errors, as shown in FS#28069.
The remaining "inconsistencies" are because printf is being used in a
guaranteed safe manner, e.g.
printf '%s\n' "$(gettext "--this can never break")"
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'scripts/pacman-optimize.sh.in')
-rw-r--r-- | scripts/pacman-optimize.sh.in | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/scripts/pacman-optimize.sh.in b/scripts/pacman-optimize.sh.in index 5ff302e2..74af0e5d 100644 --- a/scripts/pacman-optimize.sh.in +++ b/scripts/pacman-optimize.sh.in @@ -33,11 +33,11 @@ m4_include(library/output_format.sh) usage() { printf "pacman-optimize (pacman) %s\n\n" "$myver" - printf "$(gettext "Usage: %s [pacman_db_root]")\n\n" "$0" - printf "$(gettext "\ + printf -- "$(gettext "Usage: %s [pacman_db_root]")\n\n" "$0" + printf -- "$(gettext "\ pacman-optimize is a little hack that should improve the performance\n\ of pacman when reading/writing to its filesystem-based database.\n\n")" - printf "$(gettext "\ + printf -- "$(gettext "\ Because pacman uses many small files to keep track of packages,\n\ there is a tendency for these files to become fragmented over time.\n\ This script attempts to relocate these small files into one\n\ @@ -48,7 +48,7 @@ does not have to move around the disk as much.\n")" version() { printf "pacman-optimize (pacman) %s\n" "$myver" - printf "$(gettext "\ + printf -- "$(gettext "\ Copyright (c) 2006-2011 Pacman Development Team <pacman-dev@archlinux.org>.\n\ Copyright (C) 2002-2006 Judd Vinet <jvinet@zeroflux.org>.\n\n\ This is free software; see the source for copying conditions.\n\ |