File exec-absolute-path.patch of Package rpmlint.1785
Link: https://github.com/rpm-software-management/rpmlint/commit/f85186d8e219c4f86b6067579e50fce8e5eae602
From f85186d8e219c4f86b6067579e50fce8e5eae602 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ville=20Skytt=C3=A4?= <ville.skytta@iki.fi>
Date: Fri, 2 Aug 2013 23:10:24 +0300
Subject: [PATCH] Fix handling of Exec= with an absolute path.
https://bugzilla.redhat.com/991278
---
MenuXDGCheck.py | 21 +++++++++++++--------
1 file changed, 13 insertions(+), 8 deletions(-)
Index: rpmlint-1.5/MenuXDGCheck.py
===================================================================
--- rpmlint-1.5.orig/MenuXDGCheck.py
+++ rpmlint-1.5/MenuXDGCheck.py
@@ -48,13 +48,18 @@ class MenuXDGCheck(AbstractCheck.Abstrac
if self.cfp.has_option('Desktop Entry','Exec'):
binary = self.cfp.get('Desktop Entry','Exec').split(' ',1)[0]
- for i in STANDARD_BIN_DIRS:
- if os.path.exists(root + i + binary):
- # no need to check if the binary is +x, rpmlint does it
- # in another place
- found = True
- if not found and binary:
- printWarning(pkg, 'desktopfile-without-binary', filename, binary)
+ if binary:
+ if binary.startswith('/'):
+ found = os.path.exists(root + binary)
+ else:
+ for i in STANDARD_BIN_DIRS:
+ if os.path.exists(root + i + binary):
+ # no need to check if the binary is +x, rpmlint does it
+ # in another place
+ found = True
+ break
+ if not found:
+ printWarning(pkg, 'desktopfile-without-binary', filename, binary)
check = MenuXDGCheck()