Hi Patrick,
This is not good. /bin/which is broken and therefore
dangerous. Try this for fun:
echo 'echo Hello World' >> ~/.cshrc
XGETTEXT=`/bin/which xgettext`
echo $XGETTEXT
If you really want to find something in the PATH,
it's better to write your own loop:
IFS=:
for dir in $PATH; do
test -x "$dir/xgettext" && XGETTEXT="$dir/xgettext"
done
export XGETTEXT
Unfortunately this does not guarantee that GNU xgettext will
be found, which is what you really want. So I would go one
step further and check that too:
# find GNU xgettext
IFS=:
for dir in $PATH; do
test -x "$dir/xgettext" && \
"$dir/xgettext" --version 2>&1 | egrep -s 'GNU gettext' && \
XGETTEXT="$dir/xgettext"
done
export XGETTEXT
Hopefully we can forget about this requirement when the GNU
gettext tool get integrated into opensolaris.
Laca
On Thu, 2008-01-17 at 21:10 +0100, Patrick Ale wrote:
> Alright,
>
> I tried the patch again and it works now. However another patch is
> needed as well, which I will post seperately for review.
> This patch is required to compile SUNWgnome-games.spec regardles from
> the fact if the other patch gets rejected or accepted.
>
> * SUNWgnome-games.spec: Use `which` to determine the xgettext to use.
> (Force users to source env.sh)
>
>
> --- SUNWgnome-games.spec (revision 12822)
> +++ SUNWgnome-games.spec (working copy)
> @@ -79,6 +79,7 @@
> export PATH="$PATH:"`dirname $CXX`
> export CXX=`basename $CXX`
> export ACLOCAL_FLAGS="-I /usr/share/aclocal"
> +export XGETTEXT=`which xgettext`
>
> %libggz.build -d %name-%version
> %ggz_client_libs.build -d %name-%version