![](https://seccdn.libravatar.org/avatar/a7bcbbdadbe98519ce41f733dc441577.jpg?s=120&d=mm&r=g)
On 12/05/2016 03:35 AM, Dominique Leuenberger / DimStar wrote:
Larry
On Sun, 2016-12-04 at 21:47 -0600, Larry Finger wrote:
It is a little ugly, but with Tobias' help, I ended up with the following patch hunks for the spec file::
@@ -304,6 +307,9 @@ ###########################################
%prep +xserver_str=`rpm -q xorg-x11-server` +XSERVER_VERSION=`expr match "$xserver_str" '.*\(\([0-9]\.[0-9][0- 9]\.[0-9]\)\)'` +#XSERVER_VERSION=`echo $XSERVER_VERSION | sed -e 's/\.//g'` %setup -q -n VirtualBox-%{version} %patch1 -p1 %patch2 -p1 @@ -328,6 +334,11 @@ %patch113 -p1 %patch114 -p1 %patch115 -p1 +if [ "$XSERVER_VERSION" = "1.18.4" ] ; then + echo "Patch 116 not applied" +else +%patch116 -p1 +fi
That IS ugly :) and totally specialcases 1.18.4 compared to anybody building the package against 1.18.3 - which would fail.
The 'proper' things would be to either a) Make the patch in a way that it ca be applied unconditionally; hae the conditions inside the patch. Something like:
#if XORG_VERSION_CURRENT >= 11900000 #code for version >= 1.19 #else #code for version < 1.19 #endif
b) Apply the patch a bit less hackish..
if pkg-config --atleast-version 1.19 xorg-server; then %patch116 -p1 fi
Thanks, XORG_VERSION_CURRENT was exactly what I was looking for. That has been applied to the patch, and the spec file applies it unconditionally. Larry -- If I was stranded on an island and the only way to get off the island was to make a pretty UI, I’d die there. Linus Torvalds -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org