forked from pool/rpmlint
OBS-URL: https://build.opensuse.org/package/show/devel:openSUSE:Factory:rpmlint/rpmlint?expand=0&rev=522
This commit is contained in:
parent
8982407c4d
commit
4b1206101f
@ -1,7 +1,7 @@
|
||||
From 33b3aab641f6f71f33fd87f1e1b41ea2e74f48e3 Mon Sep 17 00:00:00 2001
|
||||
From: Dirk Mueller <dirk@dmllr.de>
|
||||
Date: Sun, 1 Oct 2017 14:36:40 +0200
|
||||
Subject: [PATCH 7/7] Validate Appdata also when appstream-util is unavailable
|
||||
Subject: [PATCH] Validate Appdata also when appstream-util is unavailable
|
||||
|
||||
When the dependency isn't installed, we can at least still
|
||||
validate whether the input is valid XML or not. As we're
|
||||
@ -11,10 +11,10 @@ enough.
|
||||
AppDataCheck.py | 14 ++++++++++----
|
||||
1 file changed, 10 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/AppDataCheck.py b/AppDataCheck.py
|
||||
index 20302d8..b714f31 100644
|
||||
--- a/AppDataCheck.py
|
||||
+++ b/AppDataCheck.py
|
||||
Index: rpmlint-rpmlint-1.10/AppDataCheck.py
|
||||
===================================================================
|
||||
--- rpmlint-rpmlint-1.10.orig/AppDataCheck.py
|
||||
+++ rpmlint-rpmlint-1.10/AppDataCheck.py
|
||||
@@ -10,6 +10,7 @@ import AbstractCheck
|
||||
import Config
|
||||
from Filter import addDetails, printError
|
||||
@ -23,14 +23,13 @@ index 20302d8..b714f31 100644
|
||||
|
||||
STANDARD_BIN_DIRS = ['/bin/', '/sbin/', '/usr/bin/', '/usr/sbin/']
|
||||
DEFAULT_APPDATA_CHECKER = ('appstream-util', 'validate-relax')
|
||||
@@ -32,13 +33,18 @@ class AppDataCheck(AbstractCheck.AbstractFilesCheck):
|
||||
checker = appdata_checker
|
||||
if checker[0] == "appstream-util" and not self.network_enabled:
|
||||
checker += ("--nonet",)
|
||||
- print(checker)
|
||||
@@ -28,12 +29,18 @@ class AppDataCheck(AbstractCheck.Abstrac
|
||||
def check_file(self, pkg, filename):
|
||||
root = pkg.dirName()
|
||||
f = root + filename
|
||||
+ validation_failed = False
|
||||
try:
|
||||
st = getstatusoutput(checker + (f,))
|
||||
st = getstatusoutput(appdata_checker + (f,))
|
||||
+ # Return code nonzero?
|
||||
+ validation_failed = (st[0] != 0)
|
||||
except OSError:
|
||||
@ -46,6 +45,3 @@ index 20302d8..b714f31 100644
|
||||
printError(pkg, 'invalid-appdata-file', filename)
|
||||
|
||||
|
||||
--
|
||||
2.14.1
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user