mirror of
https://github.com/moparisthebest/pacman
synced 2024-11-12 04:15:06 -05:00
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>
This commit is contained in:
parent
2374c81e55
commit
3559306546
@ -80,6 +80,13 @@ check_force () {
|
||||
|
||||
# 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
|
||||
|
@ -1107,6 +1107,15 @@ This is free software; see the source for copying conditions.\n\
|
||||
There is NO WARRANTY, to the extent permitted by law.\n")"
|
||||
}
|
||||
|
||||
# PROGRAM START
|
||||
|
||||
# determine whether we have gettext; make it a no-op if we do not
|
||||
if [ ! $(type -t gettext) ]; then
|
||||
gettext() {
|
||||
echo "$@"
|
||||
}
|
||||
fi
|
||||
|
||||
ARGLIST=$@
|
||||
|
||||
#preserve environment variables
|
||||
|
@ -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
|
||||
|
@ -252,6 +252,13 @@ db_write_entry()
|
||||
|
||||
# PROGRAM START
|
||||
|
||||
# determine whether we have gettext; make it a no-op if we do not
|
||||
if [ ! $(type -t gettext) ]; then
|
||||
gettext() {
|
||||
echo "$@"
|
||||
}
|
||||
fi
|
||||
|
||||
# check for help flags
|
||||
if [ "$1" = "-h" -o "$1" = "--help" ]; then
|
||||
usage
|
||||
|
@ -95,6 +95,13 @@ db_remove_entry() {
|
||||
|
||||
# PROGRAM START
|
||||
|
||||
# determine whether we have gettext; make it a no-op if we do not
|
||||
if [ ! $(type -t gettext) ]; then
|
||||
gettext() {
|
||||
echo "$@"
|
||||
}
|
||||
fi
|
||||
|
||||
# check for help flags
|
||||
if [ "$1" = "-h" -o "$1" = "--help" ]; then
|
||||
usage
|
||||
|
@ -79,6 +79,13 @@ check_force () {
|
||||
|
||||
# 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
|
||||
|
Loading…
Reference in New Issue
Block a user