Gettext update broke port - need help with fix
Simon Barner
barner at in.tum.de
Fri Aug 29 17:31:08 PDT 2003
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 == 1 { gsub (/\./, "", $4); \
gsub (/^0*/, "", $4); print $4}'
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=`xgettext ...`) and compare
that variable _numerically_ as in
------->
XGETTEXT_VER=`xgettext -V | awk 'NR == 1 { gsub (/\./, "", $$4);
gsub (/^0*/, "", $$4); print $$4}'`
.include <bsd.port.pre.mk>
.if ${XGETTEXT_VER} > 115
MAKE_ENV+= -DXGETTEXT_FLAGS=" --from-code "
.endif
foo:
@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
== or !=
"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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: Digital signature
Url : http://lists.freebsd.org/pipermail/freebsd-ports/attachments/20030830/6a1a0fa1/attachment.bin
More information about the freebsd-ports
mailing list