BSD and Solaris sed use basic regular expressions. That meanss that [^.]+
construct used in xorgversion.m4 is doubly non portable.
Created attachment 8140 [details] [review]
proposed patch: use 'cut' instead.
Would be nice to fix for 7.2. xf86-video-nv 1.2.1 doesn't build on systems with
non-cgnu sed without this.
Thank you - this fixes the xf86-video-nv build failure on Solaris.
I've committed the fix to git, but the bug isn't really fixed until the packages
which use it are regenerated with the new macros installed, so I'm not marking as
(In reply to comment #1)
> Created an attachment (id=8140) 
> proposed patch: use 'cut' instead.
The patch was written to work w/ shorter version strings. The 'cut' version of
this patch doesn't work correctly:
dilinger@sticky:~/Desktop$ echo 1.2.3 | cut -d . -f 3
dilinger@sticky:~/Desktop$ echo 1.2 | cut -d . -f 3
dilinger@sticky:~/Desktop$ echo 1 | cut -d . -f 3
That last one should be ' ', not '1'. I think what we want here is 'cut -s'.
How portable is that?
cut -s works on Solaris:
alanc@alf:~ [7:25pm - 203] echo 1.2.3 | cut -s -d . -f 3
alanc@alf:~ [7:25pm - 204] echo 1.2 | cut -s -d . -f 3
alanc@alf:~ [7:25pm - 205] echo 1 | cut -s -d . -f 3
alanc@alf:~ [7:25pm - 206]
(In reply to comment #3)
> I've committed the fix to git, but the bug isn't really fixed until the packages
> which use it are regenerated with the new macros installed, so I'm not marking as
> fixed yet.
urgh. that's a hell of a lot of packages.
cut -s is standard. So no objection to use it.
However if some of the PACKAGE_VERSION_* macros end up empty, things like
drivers that use them to initialize integers in a structure will still fail. We
can leave with that I think.
Daniel, when I checked the source tarballs that I build for OpenBSD, there are
only a two of them which use the new macros: xf86-video-nv and xf86-video-mga.
These macros where added pretty recently to xorgversion.m4.
Not all packages - just those that use the definitions - I haven't done a full
scan, but thought that was currently limited to xf86-video-nv & xf86-video-mga.
Since these #defines were just added, not many packages have had time to adopt
Sorry about the phenomenal bug spam, guys. Adding xorg-team@ to the QA contact so bugs don't get lost in future.
packages have been regenerated now.