Use check function instead of from_url

The check function in pkg_integrity will look for
a signature (or sha256 if a gem) inside the folder
where a package is processed
This commit is contained in:
Alex Jaramillo
2016-11-18 20:44:18 +00:00
parent 5f9d3a381f
commit 6d92759a74
2 changed files with 5 additions and 2 deletions
+1 -1
View File
@@ -225,7 +225,7 @@ def main():
print("\n")
if args.integrity == True:
pkg_integrity.from_url(args.url, build.download_path)
pkg_integrity.check(args.url, build.download_path)
while 1:
build.package()
+4 -1
View File
@@ -146,7 +146,7 @@ class GPGVerifier(Verifier):
return True
else:
msg = "Unable to download file {} http code {}"
print_error(msg.format(self.key_url, code))
self.print_result(False, msg.format(self.key_url, code))
def verify(self):
print("Verifying GPG signature\n")
@@ -206,6 +206,9 @@ class GEMShaVerifier(Verifier):
def verify(self):
gemname = os.path.basename(self.package_path).replace('.gem', '')
print("Verifying SHA256 checksum\n")
if os.path.exists(self.package_path) is False:
self.print_result(False, 'GEM was not found {}'.format(self.package_path))
return
name, _ = re.split('-\d+\.', gemname)
number = gemname.replace(name + '-', '')
geminfo = self.get_rubygems_info(name)