Thu, 19 Dec 2002 20:38:12 +0000
[gaim-migrate @ 4317]
Cooley enough, @mac.com screen names can sign on without any additional
changes. There are a few problems, though. This fixes one of them:
-SNAC error saying "Not supported by host" or something similar at
signon, because gaim requests a redirect to the email notification
server, but this is not supported for ICQ and @mac.com accounts (I
don't know why ICQ accounts don't give the error). Anyway, so this
fixes the problem by only requesting the redirect if the screen name
has an email address associated with it. I made it so the auth
reply info is stored in the oscar session struct. There are some
other useful variables there, and I think it's just cleaner to
store the whole thing than the little bits and pieces.
I heard someone complain about your_uin@pager.icq.com spam, so I'm
thinking it'd be good if there were a way to disable those types of
messages. WinICQ has a nice little preferences thingy, I think.
I dunno, maybe I could add a checkbox to the account window?
| 3414 | 1 | #!/bin/sh |
|
3420
0e7662dfe9cc
[gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents:
3415
diff
changeset
|
2 | # |
|
0e7662dfe9cc
[gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents:
3415
diff
changeset
|
3 | # setup-gettext - Provides compatibility with versions of gettext |
|
0e7662dfe9cc
[gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents:
3415
diff
changeset
|
4 | # from the 0.10.x series and 0.11.x. |
|
0e7662dfe9cc
[gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents:
3415
diff
changeset
|
5 | # |
|
0e7662dfe9cc
[gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents:
3415
diff
changeset
|
6 | # Copyright (C) 2002 Christian Hammond. |
|
0e7662dfe9cc
[gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents:
3415
diff
changeset
|
7 | # |
|
0e7662dfe9cc
[gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents:
3415
diff
changeset
|
8 | # This program is free software; you can redistribute it and/or |
|
0e7662dfe9cc
[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 |
|
0e7662dfe9cc
[gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents:
3415
diff
changeset
|
10 | # published by the Free Software Foundation; either version 2 of |
|
0e7662dfe9cc
[gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents:
3415
diff
changeset
|
11 | # the License, or (at your option) any later version. |
|
0e7662dfe9cc
[gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents:
3415
diff
changeset
|
12 | # |
|
0e7662dfe9cc
[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, |
|
0e7662dfe9cc
[gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents:
3415
diff
changeset
|
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
0e7662dfe9cc
[gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents:
3415
diff
changeset
|
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
0e7662dfe9cc
[gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents:
3415
diff
changeset
|
16 | # GNU General Public License for more details. |
|
0e7662dfe9cc
[gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents:
3415
diff
changeset
|
17 | # |
|
0e7662dfe9cc
[gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents:
3415
diff
changeset
|
18 | # You should have received a copy of the GNU General Public |
|
0e7662dfe9cc
[gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents:
3415
diff
changeset
|
19 | # License along with this program; if not, write to the Free |
|
0e7662dfe9cc
[gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents:
3415
diff
changeset
|
20 | # Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, |
|
0e7662dfe9cc
[gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents:
3415
diff
changeset
|
21 | # MA 02111-1307 USA |
|
0e7662dfe9cc
[gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents:
3415
diff
changeset
|
22 | # |
| 3414 | 23 | |
|
3420
0e7662dfe9cc
[gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents:
3415
diff
changeset
|
24 | VERSION=0.1.3 |
|
0e7662dfe9cc
[gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents:
3415
diff
changeset
|
25 | |
|
0e7662dfe9cc
[gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents:
3415
diff
changeset
|
26 | VERBOSE=0 |
| 3414 | 27 | |
| 28 | parse_gettext_version() { | |
| 29 | GETTEXT_VERSION=`$GETTEXT_TOOL --version | sed -n 's/^.*\([0-9]\+\)\.\([0-9]\+\)\.\([0-9]\+\).*$/\1.\2.\3/p'` | |
| 30 | GETTEXT_MAJOR_VERSION=`echo $GETTEXT_VERSION | sed -n 's/^\([0-9]\+\).*/\1/p'` | |
| 31 | GETTEXT_MINOR_VERSION=`echo $GETTEXT_VERSION | sed -n 's/^[0-9]\+\.\([0-9]\+\).*/\1/p'` | |
| 32 | GETTEXT_MICRO_VERSION=`echo $GETTEXT_VERSION | sed -n 's/^[0-9]\+\.[0-9]\+\.\([0-9]\+\).*/\1/p'` | |
| 33 | } | |
| 34 | ||
| 35 | find_gettext() { | |
| 36 | GETTEXT_TOOL=autopoint | |
| 37 | ||
| 38 | (autopoint --version) < /dev/null > /dev/null 2>&1 || { | |
| 39 | GETTEXT_TOOL=gettextize | |
| 40 | ||
| 41 | (gettextize --version) < /dev/null > /dev/null 2>&1 || { | |
| 42 | GETTEXT_TOOL= | |
| 43 | } | |
| 44 | } | |
| 45 | } | |
| 46 | ||
|
3420
0e7662dfe9cc
[gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents:
3415
diff
changeset
|
47 | install() { |
|
0e7662dfe9cc
[gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents:
3415
diff
changeset
|
48 | [ -f configure.in ] && { |
|
0e7662dfe9cc
[gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents:
3415
diff
changeset
|
49 | cp configure.in .tmp-configure.in |
|
3421
ff874b76a0f0
[gaim-migrate @ 3443]
Christian Hammond <chipx86@chipx86.com>
parents:
3420
diff
changeset
|
50 | sed -e 's/^AM_GNU_GETTEXT\(.*\)$/AM_GNU_GETTEXT\1\ |
|
3420
0e7662dfe9cc
[gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents:
3415
diff
changeset
|
51 | AM_GNU_GETTEXT_VERSION(0.10.40)/' < .tmp-configure.in > configure.in |
|
0e7662dfe9cc
[gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents:
3415
diff
changeset
|
52 | rm .tmp-configure.in |
|
0e7662dfe9cc
[gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents:
3415
diff
changeset
|
53 | } |
|
0e7662dfe9cc
[gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents:
3415
diff
changeset
|
54 | |
|
0e7662dfe9cc
[gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents:
3415
diff
changeset
|
55 | [ -f configure.ac ] && { |
|
0e7662dfe9cc
[gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents:
3415
diff
changeset
|
56 | cp configure.ac .tmp-configure.ac |
|
3421
ff874b76a0f0
[gaim-migrate @ 3443]
Christian Hammond <chipx86@chipx86.com>
parents:
3420
diff
changeset
|
57 | sed -e 's/^AM_GNU_GETTEXT\(.*\)$/AM_GNU_GETTEXT\1\ |
|
3420
0e7662dfe9cc
[gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents:
3415
diff
changeset
|
58 | AM_GNU_GETTEXT_VERSION(0.10.40)/' < .tmp-configure.ac > configure.ac |
|
0e7662dfe9cc
[gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents:
3415
diff
changeset
|
59 | rm .tmp-configure.ac |
|
0e7662dfe9cc
[gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents:
3415
diff
changeset
|
60 | } |
|
0e7662dfe9cc
[gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents:
3415
diff
changeset
|
61 | |
|
0e7662dfe9cc
[gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents:
3415
diff
changeset
|
62 | [ -f autogen.sh ] && { |
|
0e7662dfe9cc
[gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents:
3415
diff
changeset
|
63 | cp autogen.sh .tmp-autogen.sh |
|
3422
3851ade84950
[gaim-migrate @ 3444]
Christian Hammond <chipx86@chipx86.com>
parents:
3421
diff
changeset
|
64 | 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
0e7662dfe9cc
[gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents:
3415
diff
changeset
|
65 | rm .tmp-autogen.sh |
|
0e7662dfe9cc
[gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents:
3415
diff
changeset
|
66 | } |
|
0e7662dfe9cc
[gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents:
3415
diff
changeset
|
67 | |
|
0e7662dfe9cc
[gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents:
3415
diff
changeset
|
68 | echo 'AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])' >> acinclude.m4 |
|
0e7662dfe9cc
[gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents:
3415
diff
changeset
|
69 | } |
|
0e7662dfe9cc
[gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents:
3415
diff
changeset
|
70 | |
| 3414 | 71 | backup_m4() { |
| 72 | [ -d m4 ] && mv m4 m4~ | |
| 73 | } | |
| 74 | ||
| 75 | restore_m4() { | |
| 76 | [ -d m4~ ] && { | |
| 77 | rm -rf m4 | |
| 78 | mv m4~ m4 | |
| 79 | } | |
| 80 | } | |
| 81 | ||
| 82 | restore_files() { | |
|
3420
0e7662dfe9cc
[gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents:
3415
diff
changeset
|
83 | [ -f configure.in~ ] && mv -f configure.in~ configure.in |
|
0e7662dfe9cc
[gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents:
3415
diff
changeset
|
84 | [ -f configure.ac~ ] && mv -f configure.ac~ configure.ac |
|
0e7662dfe9cc
[gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents:
3415
diff
changeset
|
85 | [ -f Makefile.am~ ] && mv -f Makefile.am~ Makefile.am |
| 3414 | 86 | } |
| 87 | ||
| 88 | abort() { | |
| 89 | restore_files | |
| 90 | restore_m4 | |
| 91 | ||
| 92 | exit 1 | |
| 93 | } | |
| 94 | ||
| 95 | # Main code | |
| 96 | ||
| 97 | find_gettext | |
| 98 | ||
| 99 | # See if a version of gettext and its tools are installed. | |
|
3420
0e7662dfe9cc
[gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents:
3415
diff
changeset
|
100 | if [ x$GETTEXT_TOOL = x ]; then |
| 3414 | 101 | echo |
| 102 | echo "You do not have a version of gettext installed." | |
|
3415
86eb830be476
[gaim-migrate @ 3434]
Christian Hammond <chipx86@chipx86.com>
parents:
3414
diff
changeset
|
103 | echo "Please download one from your local package repository or" |
| 3414 | 104 | echo "from ftp://ftp.gnu.org/pub/gnu/gettext/" |
| 105 | echo | |
| 106 | exit 1 | |
| 107 | fi | |
| 108 | ||
| 109 | parse_gettext_version | |
| 110 | ||
| 111 | NUMVAR=$# | |
| 112 | ||
| 113 | if [ $NUMVAR -gt 0 ]; then | |
| 114 | if [ $NUMVAR -gt 1 ]; then | |
| 115 | echo "Only one option at a time!" | |
| 116 | exit 1 | |
| 117 | ||
|
3420
0e7662dfe9cc
[gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents:
3415
diff
changeset
|
118 | elif [ $1 = "--gettext-tool" ]; then |
| 3414 | 119 | echo $GETTEXT_TOOL |
| 120 | exit 0 | |
| 121 | ||
|
3420
0e7662dfe9cc
[gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents:
3415
diff
changeset
|
122 | elif [ $1 = "--help" ]; then |
| 3414 | 123 | echo "setup-gettext v$VERSION" |
| 124 | echo "Usage:" | |
| 125 | echo " --gettext-tool Returns gettextize or autopoint, depending" | |
| 126 | echo " on the version of gettext installed." | |
| 127 | echo " --gettext-version Returns the version of gettext installed." | |
| 128 | echo " --gettext-major-version Returns the major version of gettext installed." | |
| 129 | echo " --gettext-minor-version Returns the minor version of gettext installed." | |
| 130 | echo " --gettext-micro-version Returns the micro version of gettext installed." | |
| 131 | echo " --help Displays this help screen." | |
| 132 | echo | |
| 133 | exit 0 | |
| 134 | ||
|
3420
0e7662dfe9cc
[gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents:
3415
diff
changeset
|
135 | elif [ $1 = "--version" ]; then |
| 3414 | 136 | echo $VERSION |
| 137 | exit 0 | |
| 138 | ||
|
3420
0e7662dfe9cc
[gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents:
3415
diff
changeset
|
139 | elif [ $1 = "--gettext-version" ]; then |
| 3414 | 140 | echo $GETTEXT_VERSION |
| 141 | exit 0 | |
| 142 | ||
|
3420
0e7662dfe9cc
[gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents:
3415
diff
changeset
|
143 | elif [ $1 = "--gettext-major-version" ]; then |
| 3414 | 144 | echo $GETTEXT_MAJOR_VERSION |
| 145 | exit 0 | |
| 146 | ||
|
3420
0e7662dfe9cc
[gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents:
3415
diff
changeset
|
147 | elif [ $1 = "--gettext-minor-version" ]; then |
| 3414 | 148 | echo $GETTEXT_MINOR_VERSION |
| 149 | exit 0 | |
| 150 | ||
|
3420
0e7662dfe9cc
[gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents:
3415
diff
changeset
|
151 | elif [ $1 = "--gettext-micro-version" ]; then |
| 3414 | 152 | echo $GETTEXT_MICRO_VERSION |
| 153 | exit 0 | |
|
3420
0e7662dfe9cc
[gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents:
3415
diff
changeset
|
154 | |
|
0e7662dfe9cc
[gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents:
3415
diff
changeset
|
155 | elif [ $1 = "--install" ]; then |
|
0e7662dfe9cc
[gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents:
3415
diff
changeset
|
156 | install |
|
0e7662dfe9cc
[gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents:
3415
diff
changeset
|
157 | echo "setup-gettext installed." |
|
0e7662dfe9cc
[gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents:
3415
diff
changeset
|
158 | exit 0 |
| 3414 | 159 | |
|
3420
0e7662dfe9cc
[gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents:
3415
diff
changeset
|
160 | elif [ $1 = "--happy-url" ]; then |
| 3414 | 161 | echo http://gaim.sf.net/forkgettext.jpg |
| 162 | exit 0 | |
|
3420
0e7662dfe9cc
[gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents:
3415
diff
changeset
|
163 | |
|
0e7662dfe9cc
[gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents:
3415
diff
changeset
|
164 | elif [ $1 = "--verbose" ]; then |
|
0e7662dfe9cc
[gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents:
3415
diff
changeset
|
165 | VERBOSE=1 |
| 3414 | 166 | |
| 167 | else | |
| 168 | echo "Invalid option '$1'" | |
| 169 | exit 1 | |
| 170 | fi | |
| 171 | fi | |
| 172 | ||
| 173 | # Okay, run the main stuff | |
|
3420
0e7662dfe9cc
[gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents:
3415
diff
changeset
|
174 | if [ "$GETTEXT_TOOL" = "autopoint" ]; then |
| 3414 | 175 | backup_m4 |
|
3420
0e7662dfe9cc
[gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents:
3415
diff
changeset
|
176 | [ $VERBOSE -eq 1 ] && echo " autopoint --force" |
| 3414 | 177 | echo n | autopoint --force || abort |
| 178 | restore_m4 | |
| 179 | else | |
| 180 | if [ $GETTEXT_MINOR_VERSION -eq 11 ]; then | |
| 181 | backup_m4 | |
| 182 | ||
| 183 | # Gettext is pure evil. It DEMANDS that we press Return no matter | |
| 184 | # what. This gets rid of their happy "feature" of doom. | |
|
3420
0e7662dfe9cc
[gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents:
3415
diff
changeset
|
185 | [ $VERBOSE -eq 1 ] && \ |
|
0e7662dfe9cc
[gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents:
3415
diff
changeset
|
186 | echo " gettextize --copy --force --intl --no-changelog" |
|
0e7662dfe9cc
[gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents:
3415
diff
changeset
|
187 | |
| 3414 | 188 | sed 's:read .*< /dev/tty::' `which gettextize` > .temp-gettextize |
| 189 | chmod +x .temp-gettextize | |
| 190 | echo n | ./.temp-gettextize --copy --force --intl --no-changelog || abort | |
| 191 | rm .temp-gettextize | |
| 192 | ||
| 193 | restore_files | |
| 194 | restore_m4 | |
| 195 | ||
|
3420
0e7662dfe9cc
[gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents:
3415
diff
changeset
|
196 | [ -f po/Makevars.template ] && mv po/Makevars.template po/Makevars |
| 3414 | 197 | else |
|
3420
0e7662dfe9cc
[gaim-migrate @ 3442]
Christian Hammond <chipx86@chipx86.com>
parents:
3415
diff
changeset
|
198 | [ $VERBOSE -eq 1 ] && echo " gettextize --copy --force" |
| 3414 | 199 | echo n | gettextize --copy --force || exit; |
| 200 | fi | |
| 201 | fi | |
| 202 |