Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 30 Aug 2003 02:31:02 +0200
From:      Simon Barner <barner@in.tum.de>
To:        freebsd-ports@freebsd.org
Subject:   Gettext update broke port - need help with fix
Message-ID:  <20030830003102.GB11915@zi025.glhnet.mhn.de>

next in thread | raw e-mail | index | archive | help

--qDbXVdCdHGoSgWSk
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hi,

I saw that the new version of `gettext' (0.12.1) that is used by the ports
collection broke the www/aria port:

http://bento.freebsd.org/errorlogs/i386-4-latest/aria-1.0.0.log

The reason for this is that some of the port's source files contain C++
comments with non-ascii characters. These where ignored by the old
version of `xgettext' (0.11.5) but the new one needs an extra
command-line option (--from-source) in order to cope with those files.

Since this problem might happen in more than a few ports, a clean
solution is needed imo (one could of course add patches for each and
every troublesome comment, but I think we don't want that).

Passing that command-line option to the new version of `xgettext' looks
like a good approach. I was able to extract its version number with the
following command (I am sure there is a simpler solution, but well. I
found that one :-)

xgettext -V | awk 'NR =3D=3D 1 { gsub (/\./, "", $4); \
                   gsub (/^0*/, "", $4); print $4}'
				  =20
This yields 115 for the old 'xgettext' and 121 for the new one.

What I would like to do is to pass the result of that command into a
variable (with back-ticks, i.e. XGETTEXT_VER=3D`xgettext ...`) and compare
that variable _numerically_ as in

------->

XGETTEXT_VER=3D`xgettext -V | awk 'NR =3D=3D 1 { gsub (/\./, "", $$4);
                                 gsub (/^0*/, "", $$4); print $$4}'`

=2Einclude <bsd.port.pre.mk>
=20
=2Eif ${XGETTEXT_VER} > 115
MAKE_ENV+=3D      -DXGETTEXT_FLAGS=3D" --from-code "
=2Eendif
=20
foo:=20
        @echo ${MAKE_ENV}

<-------

But unfortunately, XGETTEXT_VER is always interpreted as a string:

make foo
"Makefile", line 37: warning: String comparison operator should be either
                     =3D=3D or !=3D
"Makefile", line 37: Malformed conditional (${XGETTEXT_VER} < 115)
Unterminated {} clause ""
"Makefile", line 37: Error in archive specification: ""
"Makefile", line 39: if-less endif
"Makefile", line 39: Need an operator
make: fatal errors encountered -- cannot continue

I searched the archives, but I still don't know how to handle this...
Please help :-)

Regards,
 Simon

--qDbXVdCdHGoSgWSk
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (FreeBSD)

iD8DBQE/T/BGCkn+/eutqCoRAs5eAKCJWdP3TBjldzpPXs1Ywhw4ebGI2ACgk3H8
jFZ+nkWoUrP38fsFl/9l8RM=
=t2uC
-----END PGP SIGNATURE-----

--qDbXVdCdHGoSgWSk--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030830003102.GB11915>