[packages/pldnotify: 5/7] Move name mismatch check to RPMSpec class
glen
glen at pld-linux.org
Wed Feb 24 10:07:50 CET 2021
commit dd7aee4f44232c6f9550c89b13139cd662527145
Author: Elan Ruusamäe <glen at pld-linux.org>
Date: Wed Feb 24 10:45:30 2021 +0200
Move name mismatch check to RPMSpec class
pldnotify.py | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
---
diff --git a/pldnotify.py b/pldnotify.py
index c14aebd..7aa9f94 100755
--- a/pldnotify.py
+++ b/pldnotify.py
@@ -16,6 +16,7 @@ class RPMSpec:
self._header = None
self._name = None
self._version = None
+ self.check_sanity()
def get_spec_header(self):
if not self._header:
@@ -53,6 +54,13 @@ class RPMSpec:
raise ValueError("%s: spec with no version" % self._specfile)
return self._version
+ def check_sanity(self):
+ name = path.splitext(path.basename(self._specfile))[0]
+ if self.name != name:
+ print("WARNING: name mismatch: %s!=%s" % (self.name, name))
+
+ print("%s: %s" % (self.name, self.version))
+
class AbstractChecker:
pass
@@ -117,12 +125,6 @@ class Checker:
self.debug = debug
self.spec = RPMSpec(specfile)
- name = path.splitext(path.basename(specfile))[0]
- if self.spec.name != name:
- print("WARNING: name mismatch: %s!=%s" % (self.spec.name, name))
-
- print("%s: %s" % (self.spec.name, self.spec.version))
-
def find_latest(self):
current = None
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/pldnotify.git/commitdiff/f944e2d9d8031849f241d4e905825d6ae1e235e4
More information about the pld-cvs-commit
mailing list