GNOME Bugzilla – Bug 669598
Trivial build fix
Last modified: 2012-02-08 13:33:05 UTC
Created attachment 207015 [details] [review] Trivial build fix patch (s/==/=/) test(1) uses '=' to test if strings are identical
Comment on attachment 207015 [details] [review] Trivial build fix patch (s/==/=/) correct MIME type and set patch flag which enables review functionality.
Review of attachment 207015 [details] [review]: The patch removes a bashism and I agree that is correct. Is this python.m4 something home grown or are we copying it from somewhere else?
My /usr/share/aclocal-1.11/python.m4 looks quite different, but at least does not have this bashism, so I guess that was fixed upstream a while ago. I pushed your patch, thanks!
I suspect it was home grown, but failed to trace it's history back to the origin when working on the win32 ports last year. The same macros are also used in the python.m4 files in glade and gobject-introspection. So, the bashism's where introduced with my win32 porting (sorry!) and the same fix should be applied for all 3 projects. I'll look into it. That said, have studied more .m4 files than I should since back then and these string equality tests are usually written like: if test "x$WHATEVER" = "x"; then whereas we now have: if test "x$WHATEVER" = x; then We should probably add the quotes too to be completely correct... PS Martin: the patch does not yet show up on http://git.gnome.org/browse/pygobject/log/
(In reply to comment #4) > if test "x$WHATEVER" = "x"; then > and > > if test "x$WHATEVER" = x; then > are completely equivalent, so it is not a correctness issue. We can obviusly still change them for consistency if we want
The whole syntax is very 1980-ish anyway. if [ -z "$WHATEVER" ] or [ "$WHATEVER" = "" ] are a bit more eye friendly :) > PS Martin: the patch does not yet show up on http://git.gnome.org/browse/pygobject/log/ It's there now, sorry.
(In reply to comment #4) > That said, have studied more .m4 files than I should since back > then and these string equality tests are usually written like: > > if test "x$WHATEVER" = "x"; then > > whereas we now have: > > if test "x$WHATEVER" = x; then I can't remember where but I recently saw if test x"$WHATEVER"= "x"; then which I thought was "imaginative", but also entirely correct... Thanks for pushing the patch :-)
(In reply to comment #6) > The whole syntax is very 1980-ish anyway. if [ -z "$WHATEVER" ] or [ > "$WHATEVER" = "" ] are a bit more eye friendly :) autoconf's shellology is always a fun read. [] is asking for trouble as it is the quote in m4, but this was the surprise: Posix also says that `test ! "STRING"', `test -n "STRING"' and `test -z "STRING"' work with any string, but many shells (such as Solaris, AIX 3.2, UNICOS 10.0.0.6, Digital Unix 4, etc.) get confused if STRING looks like an operator: $ test -n = test: argument expected $ test ! -n test: argument expected $ test -z ")"; echo $? 0 Thankfully my shells behaved correctly :-)