From 9e9835f4640a45cc758fa64de5923d7f836fe1f4 Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Mon, 23 Jan 2012 17:14:25 -0500 Subject: 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 Signed-off-by: Dan McGee --- scripts/pkgdelta.sh.in | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'scripts/pkgdelta.sh.in') diff --git a/scripts/pkgdelta.sh.in b/scripts/pkgdelta.sh.in index ef34c5bd..35be70ce 100644 --- a/scripts/pkgdelta.sh.in +++ b/scripts/pkgdelta.sh.in @@ -38,16 +38,16 @@ m4_include(library/output_format.sh) # print usage instructions usage() { printf "pkgdelta (pacman) %s\n\n" "$myver" - printf "$(gettext "Usage: pkgdelta [-q] \n")" - printf "$(gettext "\ + printf -- "$(gettext "Usage: pkgdelta [-q] \n")" + printf -- "$(gettext "\ pkgdelta will create a delta file between two packages.\n\ This delta file can then be added to a database using repo-add.\n\n")" - echo "$(gettext "Example: pkgdelta pacman-3.0.0.pkg.tar.gz pacman-3.0.1.pkg.tar.gz")" + printf -- "$(gettext "Example: pkgdelta pacman-3.0.0.pkg.tar.gz pacman-3.0.1.pkg.tar.gz")\n" } version() { printf "pkgdelta (pacman) %s\n\n" "$myver" - printf "$(gettext "\ + printf -- "$(gettext "\ Copyright (c) 2009 Xavier Chantry .\n\n\ This is free software; see the source for copying conditions.\n\ There is NO WARRANTY, to the extent permitted by law.\n")" -- cgit v1.2.3