[packages/pldnotify/py] fix name check if specfile is abspath

glen glen at pld-linux.org
Fri Dec 11 17:32:07 CET 2015


commit 1642bdc34da6b2c89780c684e935c6197486cbc1
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Fri Dec 11 18:32:02 2015 +0200

    fix name check if specfile is abspath

 pldnotify.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/pldnotify.py b/pldnotify.py
index 3eb5a97..e4d6605 100755
--- a/pldnotify.py
+++ b/pldnotify.py
@@ -4,6 +4,7 @@ import argparse
 import requests
 import rpm
 import sys
+from os import path
 
 """
 RPM Spec parser
@@ -64,7 +65,8 @@ class Checker:
         self.name = macros['name']
         self.version = macros['version']
 
-        if self.name != specfile[0:-5]:
+        name = path.splitext(path.basename(specfile))[0]
+        if self.name != name:
             print "WARNING: name mismatch: %s!=%s" % (self.name, name)
 
         print "%s: %s" % (self.name, self.version)
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/pldnotify.git/commitdiff/1642bdc34da6b2c89780c684e935c6197486cbc1



More information about the pld-cvs-commit mailing list