+= in bourne scripts

Jeremy Huddleston jeremyhu at freedesktop.org
Fri Feb 13 13:17:40 PST 2009


I've been seeing some '+=' syntax in some bourne scripts lately, and I  
just wanted to point out that this is a no-no.  util-macros had it  
(and is fixed in master):
http://cgit.freedesktop.org/xorg/util/macros/commit/?id=96585612d17d31fa9dd0f5c260fc33f72be9a75f

And now I see that libX11/acinclude.m4 hass it as well:
http://trac.macports.org/ticket/18485

acinclude.m4 has:
for arg in "$[]@"; do
     case "$arg" in
         --mode=compile) modeok=true ;;
         --tag=CC|--tag=CXX) tagok=true ;;
         *) args+=("$arg")
     esac
done

This needs to be more compatible.  Unfortunately, I'm not really savy  
enough with bourne scripts (without bash-isms) to know the best way to  
fix this particular issue, but I'd like to see it addressed before the  
next libX11.  Anyone wanna point me in the right way?  I certainly  
don't think args = "$args $arg" is going to play nice with spaces in  
arg (which is what this was originally addressing)...




More information about the xorg-devel mailing list