annotate setup-gettext @ 12645:fc28451f5d96

[gaim-migrate @ 14983] SF Patch #1314512 from Sadrul (who has a patch for everything) "This patch introduces a flag for protocol plugins that support offline messages (like Y!M and ICQ). This was encouraged by the following conversation: <sadrul> should offline buddies be listed/enabled in the send-to menu? <rekkanoryo> i would think only for protocols that support offline messaging, if it's indicated that the buddy is offline -- <snip> -- <Bleeter> sadrul: personally, I'd like to see a 'supports offline' flag of some description <Bleeter> one could then redirect (via plugins) through email or alternative methods <Bleeter> just a thought <Paco-Paco> yeah, that sounds like a reasonble thing to have This patch uses this flag to disable the buddies in the send-to menu who are offline and the protocol doesn't support offline messages." I made this make the label insensitive instead of the whole menuitem. This should address SimGuy's concerns about inconsistency (i.e. you could create a conversation with someone via the buddy list that you couldn't create via the Send To menu). I also hacked up some voodoo to show the label as sensitive when moused-over, as that looks better (given the label-insensitive thing is itself a hack). I think this works quite well. BUG NOTE: This makes more obvious an existing bug. The Send To menu isn't updated when buddies sign on or off or change status (at least under some circumstances). We need to fix that anyway, so I'm not going to let it hold up this commit. Switching tabs will clear it up. I'm thinking we just might want to build the contents of that menu when it is selected. That would save us a mess of inefficient signal callbacks that update the Send To menus in open windows all the time. AIM NOTE: This assumes that AIM can't offline message. That's not strictly true. You can message invisible users on AIM. However, by design, we can't tell when a user is invisible without resorting to dirty hackery. In practice, this isn't a problem, as you can still select the AIM user from the menu. And really, how often will you be choosing the Invisible contact, rather than the user going Invisible in the middle of a conversation or IMing you while they're Invisible? JABBER NOTE: This assumes that Jabber can always offline message. This isn't strictly true. Sadrul said: I have updated Jabber according to this link which seems to talk about how to determine the existence offline-message support in a server: http://www.jabber.org/jeps/jep-0013.html#discover However, jabber.org doesn't seem to send the required info. So I am not sure about it. He later said: I talked to Nathan and he said offline message support is mostly assumed for most jabber servers. GTalk doesn't yet support it, but they are working on it. So I have made jabber to always return TRUE. If there is truly no way to detect offline messaging capability, then this is an acceptable solution. We could special case Google Talk because of its popularity, and remove that later. It's probably not worth it though. MSN NOTE: This assumes that MSN can never offline message. That's effectively true, but to be technically correct, MSN can offline message if there's already a switchboard conversation open with a user. We could write an offline_message function in the MSN prpl to detect that, but it'd be of limited usefulness, especially given that under most circumstances (where this might matter), the switchboard connection will be closed almost immediately. CVS NOTE: I'm writing to share a tragic little story. I have a PC that I use for Gaim development. One day, I was writing a commit message on it, when all of a suddent it went berserk. The screen started flashing, and the whole commit message just disappeared. All of it. And it was a good commit message! I had to cram and rewrite it really quickly. Needless to say, my rushed commit message wasn't nearly as good, and I blame the PC for that. Seriously, though, what kind of version control system loses your commit message on a broken connection to the server? Stupid! committer: Tailor Script <tailor@pidgin.im>
author Richard Laager <rlaager@wiktel.com>
date Fri, 23 Dec 2005 19:26:04 +0000
parents 8ed35c29007f
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3414
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1 #!/bin/sh
3420
bd05f8566531 [gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents: 3415
diff changeset
2 #
bd05f8566531 [gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents: 3415
diff changeset
3 # setup-gettext - Provides compatibility with versions of gettext
6749
c92584ee753d [gaim-migrate @ 7281]
Christian Hammond <chipx86@chipx86.com>
parents: 4563
diff changeset
4 # from the 0.10.x, 0.11.x, and 0.12.x series.
3420
bd05f8566531 [gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents: 3415
diff changeset
5 #
bd05f8566531 [gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents: 3415
diff changeset
6 # Copyright (C) 2002 Christian Hammond.
bd05f8566531 [gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents: 3415
diff changeset
7 #
bd05f8566531 [gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents: 3415
diff changeset
8 # This program is free software; you can redistribute it and/or
bd05f8566531 [gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents: 3415
diff changeset
9 # modify it under the terms of the GNU General Public License as
bd05f8566531 [gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents: 3415
diff changeset
10 # published by the Free Software Foundation; either version 2 of
bd05f8566531 [gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents: 3415
diff changeset
11 # the License, or (at your option) any later version.
bd05f8566531 [gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents: 3415
diff changeset
12 #
bd05f8566531 [gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents: 3415
diff changeset
13 # This program is distributed in the hope that it will be useful,
bd05f8566531 [gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents: 3415
diff changeset
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
bd05f8566531 [gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents: 3415
diff changeset
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
bd05f8566531 [gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents: 3415
diff changeset
16 # GNU General Public License for more details.
bd05f8566531 [gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents: 3415
diff changeset
17 #
bd05f8566531 [gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents: 3415
diff changeset
18 # You should have received a copy of the GNU General Public
bd05f8566531 [gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents: 3415
diff changeset
19 # License along with this program; if not, write to the Free
bd05f8566531 [gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents: 3415
diff changeset
20 # Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
bd05f8566531 [gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents: 3415
diff changeset
21 # MA 02111-1307 USA
bd05f8566531 [gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents: 3415
diff changeset
22 #
3414
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
23
8065
afd6b3185274 [gaim-migrate @ 8761]
Christian Hammond <chipx86@chipx86.com>
parents: 6749
diff changeset
24 VERSION=0.1.6
3420
bd05f8566531 [gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents: 3415
diff changeset
25
bd05f8566531 [gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents: 3415
diff changeset
26 VERBOSE=0
3414
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
27
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
28 parse_gettext_version() {
10446
904d03bfccce [gaim-migrate @ 11711]
Ethan Blanton <elb@pidgin.im>
parents: 8065
diff changeset
29 GETTEXT_VERSION=`$GETTEXT_TOOL --version | sed -n 's/^.*\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\).*$/\1.\2.\3/p'`
11301
a09a5d64f33f [gaim-migrate @ 13501]
Luke Schierer <lschiere@pidgin.im>
parents: 10446
diff changeset
30 test -z "$GETTEXT_VERSION" && GETTEXT_VERSION=`$GETTEXT_TOOL --version | sed -n 's/^.*\([0-9]\+\)\.\([0-9]\+\).*$/\1.\2/p'`
10446
904d03bfccce [gaim-migrate @ 11711]
Ethan Blanton <elb@pidgin.im>
parents: 8065
diff changeset
31 GETTEXT_MAJOR_VERSION=`echo $GETTEXT_VERSION | cut -d. -f1`
904d03bfccce [gaim-migrate @ 11711]
Ethan Blanton <elb@pidgin.im>
parents: 8065
diff changeset
32 GETTEXT_MINOR_VERSION=`echo $GETTEXT_VERSION | cut -d. -f2`
904d03bfccce [gaim-migrate @ 11711]
Ethan Blanton <elb@pidgin.im>
parents: 8065
diff changeset
33 GETTEXT_MICRO_VERSION=`echo $GETTEXT_VERSION | cut -d. -f3`
3414
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
34 }
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
35
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
36 find_gettext() {
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
37 GETTEXT_TOOL=autopoint
6749
c92584ee753d [gaim-migrate @ 7281]
Christian Hammond <chipx86@chipx86.com>
parents: 4563
diff changeset
38
3414
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
39 (autopoint --version) < /dev/null > /dev/null 2>&1 || {
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
40 GETTEXT_TOOL=gettextize
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
41
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
42 (gettextize --version) < /dev/null > /dev/null 2>&1 || {
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
43 GETTEXT_TOOL=
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
44 }
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
45 }
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
46 }
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
47
3420
bd05f8566531 [gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents: 3415
diff changeset
48 install() {
bd05f8566531 [gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents: 3415
diff changeset
49 [ -f configure.in ] && {
bd05f8566531 [gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents: 3415
diff changeset
50 cp configure.in .tmp-configure.in
3421
3efe967c8524 [gaim-migrate @ 3443]
Christian Hammond <chipx86@chipx86.com>
parents: 3420
diff changeset
51 sed -e 's/^AM_GNU_GETTEXT\(.*\)$/AM_GNU_GETTEXT\1\
3420
bd05f8566531 [gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents: 3415
diff changeset
52 AM_GNU_GETTEXT_VERSION(0.10.40)/' < .tmp-configure.in > configure.in
bd05f8566531 [gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents: 3415
diff changeset
53 rm .tmp-configure.in
bd05f8566531 [gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents: 3415
diff changeset
54 }
bd05f8566531 [gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents: 3415
diff changeset
55
bd05f8566531 [gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents: 3415
diff changeset
56 [ -f configure.ac ] && {
bd05f8566531 [gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents: 3415
diff changeset
57 cp configure.ac .tmp-configure.ac
3421
3efe967c8524 [gaim-migrate @ 3443]
Christian Hammond <chipx86@chipx86.com>
parents: 3420
diff changeset
58 sed -e 's/^AM_GNU_GETTEXT\(.*\)$/AM_GNU_GETTEXT\1\
3420
bd05f8566531 [gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents: 3415
diff changeset
59 AM_GNU_GETTEXT_VERSION(0.10.40)/' < .tmp-configure.ac > configure.ac
bd05f8566531 [gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents: 3415
diff changeset
60 rm .tmp-configure.ac
bd05f8566531 [gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents: 3415
diff changeset
61 }
bd05f8566531 [gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents: 3415
diff changeset
62
bd05f8566531 [gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents: 3415
diff changeset
63 [ -f autogen.sh ] && {
bd05f8566531 [gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents: 3415
diff changeset
64 cp autogen.sh .tmp-autogen.sh
3422
cd42bf49e2bb [gaim-migrate @ 3444]
Christian Hammond <chipx86@chipx86.com>
parents: 3421
diff changeset
65 sed -e 's/\(gettextize\|autopoint\) --version/.\/setup-gettext --gettext-tool/1' -e 's/^\(echo.*|[\t ]*\)\?\(gettextize\|autopoint\) -.*$/.\/setup-gettext/1' < .tmp-autogen.sh > autogen.sh
3420
bd05f8566531 [gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents: 3415
diff changeset
66 rm .tmp-autogen.sh
bd05f8566531 [gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents: 3415
diff changeset
67 }
bd05f8566531 [gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents: 3415
diff changeset
68
4563
d6491dc2b7b2 [gaim-migrate @ 4844]
Christian Hammond <chipx86@chipx86.com>
parents: 3422
diff changeset
69 echo 'dnl Added by setup-gettext. Do not remove this' >> acinclude.m4
d6491dc2b7b2 [gaim-migrate @ 4844]
Christian Hammond <chipx86@chipx86.com>
parents: 3422
diff changeset
70 echo 'dnl unless you know what you are doing.' >> acinclude.m4
3420
bd05f8566531 [gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents: 3415
diff changeset
71 echo 'AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])' >> acinclude.m4
bd05f8566531 [gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents: 3415
diff changeset
72 }
bd05f8566531 [gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents: 3415
diff changeset
73
3414
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
74 backup_m4() {
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
75 [ -d m4 ] && mv m4 m4~
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
76 }
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
77
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
78 restore_m4() {
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
79 [ -d m4~ ] && {
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
80 rm -rf m4
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
81 mv m4~ m4
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
82 }
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
83 }
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
84
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
85 restore_files() {
3420
bd05f8566531 [gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents: 3415
diff changeset
86 [ -f configure.in~ ] && mv -f configure.in~ configure.in
bd05f8566531 [gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents: 3415
diff changeset
87 [ -f configure.ac~ ] && mv -f configure.ac~ configure.ac
bd05f8566531 [gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents: 3415
diff changeset
88 [ -f Makefile.am~ ] && mv -f Makefile.am~ Makefile.am
3414
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
89 }
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
90
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
91 abort() {
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
92 restore_files
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
93 restore_m4
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
94
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
95 exit 1
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
96 }
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
97
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
98 # Main code
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
99
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
100 find_gettext
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
101
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
102 # See if a version of gettext and its tools are installed.
6749
c92584ee753d [gaim-migrate @ 7281]
Christian Hammond <chipx86@chipx86.com>
parents: 4563
diff changeset
103 if test x$GETTEXT_TOOL = x; then
3414
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
104 echo
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
105 echo "You do not have a version of gettext installed."
3415
d7c90e6ecc23 [gaim-migrate @ 3434]
Christian Hammond <chipx86@chipx86.com>
parents: 3414
diff changeset
106 echo "Please download one from your local package repository or"
3414
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
107 echo "from ftp://ftp.gnu.org/pub/gnu/gettext/"
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
108 echo
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
109 exit 1
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
110 fi
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
111
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
112 parse_gettext_version
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
113
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
114 NUMVAR=$#
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
115
6749
c92584ee753d [gaim-migrate @ 7281]
Christian Hammond <chipx86@chipx86.com>
parents: 4563
diff changeset
116 if test $NUMVAR -gt 0; then
c92584ee753d [gaim-migrate @ 7281]
Christian Hammond <chipx86@chipx86.com>
parents: 4563
diff changeset
117 if test $NUMVAR -gt 1; then
3414
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
118 echo "Only one option at a time!"
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
119 exit 1
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
120
6749
c92584ee753d [gaim-migrate @ 7281]
Christian Hammond <chipx86@chipx86.com>
parents: 4563
diff changeset
121 elif test $1 = "--gettext-tool"; then
3414
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
122 echo $GETTEXT_TOOL
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
123 exit 0
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
124
6749
c92584ee753d [gaim-migrate @ 7281]
Christian Hammond <chipx86@chipx86.com>
parents: 4563
diff changeset
125 elif test $1 = "--help"; then
3414
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
126 echo "setup-gettext v$VERSION"
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
127 echo "Usage:"
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
128 echo " --gettext-tool Returns gettextize or autopoint, depending"
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
129 echo " on the version of gettext installed."
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
130 echo " --gettext-version Returns the version of gettext installed."
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
131 echo " --gettext-major-version Returns the major version of gettext installed."
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
132 echo " --gettext-minor-version Returns the minor version of gettext installed."
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
133 echo " --gettext-micro-version Returns the micro version of gettext installed."
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
134 echo " --help Displays this help screen."
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
135 echo
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
136 exit 0
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
137
6749
c92584ee753d [gaim-migrate @ 7281]
Christian Hammond <chipx86@chipx86.com>
parents: 4563
diff changeset
138 elif test $1 = "--version"; then
3414
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
139 echo $VERSION
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
140 exit 0
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
141
6749
c92584ee753d [gaim-migrate @ 7281]
Christian Hammond <chipx86@chipx86.com>
parents: 4563
diff changeset
142 elif test $1 = "--gettext-version"; then
3414
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
143 echo $GETTEXT_VERSION
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
144 exit 0
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
145
6749
c92584ee753d [gaim-migrate @ 7281]
Christian Hammond <chipx86@chipx86.com>
parents: 4563
diff changeset
146 elif test $1 = "--gettext-major-version"; then
3414
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
147 echo $GETTEXT_MAJOR_VERSION
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
148 exit 0
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
149
6749
c92584ee753d [gaim-migrate @ 7281]
Christian Hammond <chipx86@chipx86.com>
parents: 4563
diff changeset
150 elif test $1 = "--gettext-minor-version"; then
3414
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
151 echo $GETTEXT_MINOR_VERSION
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
152 exit 0
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
153
6749
c92584ee753d [gaim-migrate @ 7281]
Christian Hammond <chipx86@chipx86.com>
parents: 4563
diff changeset
154 elif test $1 = "--gettext-micro-version"; then
3414
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
155 echo $GETTEXT_MICRO_VERSION
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
156 exit 0
6749
c92584ee753d [gaim-migrate @ 7281]
Christian Hammond <chipx86@chipx86.com>
parents: 4563
diff changeset
157
c92584ee753d [gaim-migrate @ 7281]
Christian Hammond <chipx86@chipx86.com>
parents: 4563
diff changeset
158 elif test $1 = "--install"; then
3420
bd05f8566531 [gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents: 3415
diff changeset
159 install
bd05f8566531 [gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents: 3415
diff changeset
160 echo "setup-gettext installed."
bd05f8566531 [gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents: 3415
diff changeset
161 exit 0
3414
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
162
6749
c92584ee753d [gaim-migrate @ 7281]
Christian Hammond <chipx86@chipx86.com>
parents: 4563
diff changeset
163 elif test $1 = "--happy-url"; then
3414
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
164 echo http://gaim.sf.net/forkgettext.jpg
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
165 exit 0
6749
c92584ee753d [gaim-migrate @ 7281]
Christian Hammond <chipx86@chipx86.com>
parents: 4563
diff changeset
166
c92584ee753d [gaim-migrate @ 7281]
Christian Hammond <chipx86@chipx86.com>
parents: 4563
diff changeset
167 elif test $1 = "--verbose"; then
3420
bd05f8566531 [gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents: 3415
diff changeset
168 VERBOSE=1
3414
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
169
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
170 else
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
171 echo "Invalid option '$1'"
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
172 exit 1
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
173 fi
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
174 fi
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
175
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
176 # Okay, run the main stuff
6749
c92584ee753d [gaim-migrate @ 7281]
Christian Hammond <chipx86@chipx86.com>
parents: 4563
diff changeset
177 if test "$GETTEXT_TOOL" = "autopoint"; then
3414
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
178 backup_m4
3420
bd05f8566531 [gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents: 3415
diff changeset
179 [ $VERBOSE -eq 1 ] && echo " autopoint --force"
3414
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
180 echo n | autopoint --force || abort
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
181 restore_m4
6749
c92584ee753d [gaim-migrate @ 7281]
Christian Hammond <chipx86@chipx86.com>
parents: 4563
diff changeset
182
8065
afd6b3185274 [gaim-migrate @ 8761]
Christian Hammond <chipx86@chipx86.com>
parents: 6749
diff changeset
183 if test $GETTEXT_MINOR_VERSION -ge 12; then
6749
c92584ee753d [gaim-migrate @ 7281]
Christian Hammond <chipx86@chipx86.com>
parents: 4563
diff changeset
184 cp po/Makefile.in.in po/.tmp-Makefile.in.in
12503
8ed35c29007f [gaim-migrate @ 14815]
Stu Tomlinson <stu@nosnilmot.com>
parents: 11301
diff changeset
185 sed -e 's#\*) echo "\$(top_builddir)/\$(MKINSTALLDIRS)" ;; esac#\.\/\*) echo "\$(top_builddir)/\$(MKINSTALLDIRS)" ;; \*) echo "\$(MKINSTALLDIRS)" ;; esac#1' < po/.tmp-Makefile.in.in > po/Makefile.in.in
6749
c92584ee753d [gaim-migrate @ 7281]
Christian Hammond <chipx86@chipx86.com>
parents: 4563
diff changeset
186 rm po/.tmp-Makefile.in.in
c92584ee753d [gaim-migrate @ 7281]
Christian Hammond <chipx86@chipx86.com>
parents: 4563
diff changeset
187 fi
3414
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
188 else
6749
c92584ee753d [gaim-migrate @ 7281]
Christian Hammond <chipx86@chipx86.com>
parents: 4563
diff changeset
189 if test $GETTEXT_MINOR_VERSION -eq 11; then
3414
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
190 backup_m4
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
191
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
192 # Gettext is pure evil. It DEMANDS that we press Return no matter
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
193 # what. This gets rid of their happy "feature" of doom.
3420
bd05f8566531 [gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents: 3415
diff changeset
194 [ $VERBOSE -eq 1 ] && \
bd05f8566531 [gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents: 3415
diff changeset
195 echo " gettextize --copy --force --intl --no-changelog"
bd05f8566531 [gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents: 3415
diff changeset
196
3414
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
197 sed 's:read .*< /dev/tty::' `which gettextize` > .temp-gettextize
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
198 chmod +x .temp-gettextize
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
199 echo n | ./.temp-gettextize --copy --force --intl --no-changelog || abort
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
200 rm .temp-gettextize
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
201
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
202 restore_files
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
203 restore_m4
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
204
3420
bd05f8566531 [gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents: 3415
diff changeset
205 [ -f po/Makevars.template ] && mv po/Makevars.template po/Makevars
3414
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
206 else
3420
bd05f8566531 [gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents: 3415
diff changeset
207 [ $VERBOSE -eq 1 ] && echo " gettextize --copy --force"
3414
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
208 echo n | gettextize --copy --force || exit;
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
209 fi
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
210 fi
4149e5e36eb9 [gaim-migrate @ 3433]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
211