FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > ArchLinux > ArchLinux Pacman Development

 
 
LinkBack Thread Tools
 
Old 02-18-2008, 02:24 AM
Dan McGee
 
Default 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.

Signed-off-by: Dan McGee <dan@archlinux.org>
---

This issue comes up a lot it seems, so I hope this simple check can fix
things up for good. Can anyone see anything wrong with doing this? Quick
tests locally seemed to make me think it works? Just rename some gettext calls
to something you know does not exist, and change the patch below accordingly
to test. Someone with a bit more bash knowledge and checking more complex
strings with echo would be good to have here.

I'd like to push this to 3.1.2 if there are no issues, as it is an easy
and straightforward fix.

-Dan

scripts/gensync.sh.in | 7 +++++++
scripts/makepkg.sh.in | 9 +++++++++
scripts/pacman-optimize.sh.in | 9 +++++++++
scripts/repo-add.sh.in | 7 +++++++
scripts/repo-remove.sh.in | 7 +++++++
scripts/updatesync.sh.in | 7 +++++++
6 files changed, 46 insertions(+), 0 deletions(-)

diff --git a/scripts/gensync.sh.in b/scripts/gensync.sh.in
index eb1ef3a..d5dec27 100644
--- a/scripts/gensync.sh.in
+++ b/scripts/gensync.sh.in
@@ -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
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 090ba5d..ed4794f 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -1107,6 +1107,15 @@ This is free software; see the source for copying conditions.

There is NO WARRANTY, to the extent permitted by law.
")"
}

+# 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
diff --git a/scripts/pacman-optimize.sh.in b/scripts/pacman-optimize.sh.in
index 21afd27..0cd108b 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
diff --git a/scripts/repo-add.sh.in b/scripts/repo-add.sh.in
index efd3bc0..63d94d3 100644
--- a/scripts/repo-add.sh.in
+++ b/scripts/repo-add.sh.in
@@ -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
diff --git a/scripts/repo-remove.sh.in b/scripts/repo-remove.sh.in
index fe230b0..47a0d5a 100644
--- a/scripts/repo-remove.sh.in
+++ b/scripts/repo-remove.sh.in
@@ -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
diff --git a/scripts/updatesync.sh.in b/scripts/updatesync.sh.in
index 58ae0d5..5f5cc6c 100644
--- a/scripts/updatesync.sh.in
+++ b/scripts/updatesync.sh.in
@@ -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
--
1.5.4.1


_______________________________________________
pacman-dev mailing list
pacman-dev@archlinux.org
http://archlinux.org/mailman/listinfo/pacman-dev
 
Old 02-18-2008, 02:27 AM
"Dan McGee"
 
Default scripts: allow usage when gettext is not installed

On Feb 17, 2008 9:24 PM, Dan McGee <dan@archlinux.org> wrote:
> 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.
>
> Signed-off-by: Dan McGee <dan@archlinux.org>
> ---
>
> This issue comes up a lot it seems, so I hope this simple check can fix
> things up for good. Can anyone see anything wrong with doing this? Quick
> tests locally seemed to make me think it works? Just rename some gettext calls
> to something you know does not exist, and change the patch below accordingly
> to test. Someone with a bit more bash knowledge and checking more complex
> strings with echo would be good to have here.
>
> I'd like to push this to 3.1.2 if there are no issues, as it is an easy
> and straightforward fix.

Refs that I forgot to mention:
http://bugs.archlinux.org/task/9214
http://bugs.archlinux.org/task/9607

_______________________________________________
pacman-dev mailing list
pacman-dev@archlinux.org
http://archlinux.org/mailman/listinfo/pacman-dev
 

Thread Tools




All times are GMT. The time now is 07:26 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org