forked from pool/rpmlint
Dirk Mueller
0596567a6c
handle xdg menu files without exec entry (bnc#833384) OBS-URL: https://build.opensuse.org/package/show/devel:openSUSE:Factory:rpmlint/rpmlint?expand=0&rev=201
28 lines
1.1 KiB
Diff
28 lines
1.1 KiB
Diff
diff --git a/MenuXDGCheck.py b/MenuXDGCheck.py
|
|
index 0996585..29085d5 100644
|
|
--- a/MenuXDGCheck.py
|
|
+++ b/MenuXDGCheck.py
|
|
@@ -40,13 +40,16 @@ class MenuXDGCheck(AbstractCheck.AbstractFilesCheck):
|
|
printError(pkg, 'non-utf8-desktopfile', filename)
|
|
|
|
self.cfp.read(f)
|
|
- binary = self.cfp.get('Desktop Entry','Exec').split(' ',1)[0]
|
|
+ binary = None
|
|
found = False
|
|
- 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 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)
|
|
|