[X2Go-Commits] [x2goserver] 02/05: x2goserver.spec: make sure that we don't go into branches just because a macro is not defined on our platform.

git-admin at x2go.org git-admin at x2go.org
Tue Mar 7 04:39:41 CET 2017


This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch release/4.0.1.x
in repository x2goserver.

commit e680c9d0e3075ecceaba93e57a91c704f2ccfbfb
Author: Mihai Moldovan <ionic at ionic.de>
Date:   Tue Mar 7 04:31:24 2017 +0100

    x2goserver.spec: make sure that we don't go into branches just because a macro is not defined on our platform.
---
 debian/changelog |  2 ++
 x2goserver.spec  | 15 ++++++++++-----
 2 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 0f0670d..53911e4 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -33,6 +33,8 @@ x2goserver (4.0.1.21-0x2go1) UNRELEASED; urgency=medium
     - Fix %{?fedora} macro usage.
     - Add the correct package name to the %posttrans scriptlet, we only need
       it for x2goserver-fmbindings.
+    - Make sure that we don't go into branches just because a macro is not
+      defined on our platform.
   * debian/po:
     - Tiny fixup on author name.
   * debian/control:
diff --git a/x2goserver.spec b/x2goserver.spec
index 2e82ee4..debb090 100644
--- a/x2goserver.spec
+++ b/x2goserver.spec
@@ -517,10 +517,15 @@ fi
 %if 0%{?suse_version} >= 1140
 %mime_database_post
 %desktop_database_post
-%elif 0%{?suse_version} || 0%{?fedora} < 24 || 0%{?rhel} < 8
+# We need the "weird" foo && foo < ... structure, because we only want to check the value
+# *if* the macro is defined. Otherwise it will decay to 0 which means that the branch
+# is always triggered - even on operating systems for which it should not be triggered.
+# For example, this branch would be taken on Fedora >= 24 if using a plain "0%{?rhel} < 8"
+# condition, since this ("0 < 8") would be true on a Fedora system.
+%elif 0%{?suse_version} || { 0%{?fedora} && 0%{?fedora} < 24 } || { 0%{?rhel} && 0%{?rhel} < 8 }
 /usr/bin/update-mime-database %{_datadir}/mime &1>/dev/null 2>/dev/null || :
 /usr/bin/update-desktop-database &1>/dev/null 2>/dev/null || :
-%elif 0%{?fedora} < 25
+%elif 0{?fedora} && 0%{?fedora} < 25
 /usr/bin/update-desktop-database &1>/dev/null 2>/dev/null || :
 # FC 24 and higher have deprecated the mime database update scriptlet and handle changes transparently.
 # FC 25 and higher have deprecated the desktop database update scriptlet and handle changes transparently.
@@ -531,17 +536,17 @@ if [ $1 -eq 0 ] ; then
 %if 0%{?suse_version} >= 1140
         %mime_database_postun
         %desktop_database_postun
-%elif 0%{?suse_version} || 0%{?fedora} < 24 || 0%{?rhel} < 8
+%elif 0%{?suse_version} || { 0%{?fedora} && 0%{?fedora} < 24 } || { 0%{?rhel} && 0%{?rhel} < 8 }
         /usr/bin/update-mime-database %{_datadir}/mime &1>/dev/null 2>/dev/null || :
         /usr/bin/update-desktop-database &1>/dev/null 2>/dev/null || :
-%elif 0%{?fedora} < 25
+%elif 0{?fedora} && 0%{?fedora} < 25
         /usr/bin/update-desktop-database &1>/dev/null 2>/dev/null || :
         # Check the post scriptlet for more information.
 %endif
 fi
 
 %posttrans fmbindings
-%if 0%{?fedora} < 24 || 0%{?rhel} < 8
+%if { 0%?{?fedora} && 0%{?fedora} < 24 } || { 0%{?rhel} && 0%{?rhel} < 8 }
 /usr/bin/update-mime-database %{?fedora:-n} %{_datadir}/mime &> /dev/null || :
 %endif
 

--
Alioth's /srv/git/code.x2go.org/x2goserver.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goserver.git


More information about the x2go-commits mailing list