Skip to content
This repository was archived by the owner on Aug 7, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions autospec/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,8 @@ def parse_build_results(self, filename, returncode, filemanager, config, require
elif infiles == 1 and "not matching the package arch" not in line:
# exclude blank lines from consideration...
file = line.strip()
if file in ("/usr", "/usr/"):
self.must_restart += 1
if file and file[0] == "/":
filemanager.push_file(file, content.name)

Expand Down
7 changes: 0 additions & 7 deletions autospec/count.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,8 @@ def sanitize_counts():
"""Validate test counts are within sane bounds."""
global total_tests
global total_pass
global total_fail
global total_xfail
global total_skip
global counted_tests
global counted_pass
global counted_fail
global counted_xfail
global counted_skip
if total_tests > 0 and total_pass == 0:
total_pass = total_tests - total_fail - total_skip - total_xfail

Expand Down Expand Up @@ -170,7 +164,6 @@ def parse_log(log, pkgname=''):
global total_fail
global total_xfail
global total_skip
global counted_tests
global counted_pass
global counted_fail
global counted_xfail
Expand Down
5 changes: 0 additions & 5 deletions autospec/license.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ def add_license(lic, translations, blacklist):
presence in the blacklist. Returns False if no license were added, True
otherwise.
"""
global licenses
global license_files
lic = lic.strip().strip(',')
result = False

Expand Down Expand Up @@ -208,9 +206,6 @@ def scan_for_licenses(srcdir, config, pkg_name):

def load_specfile(specfile):
"""Get licenses from the specfile content."""
global licenses
global license_files
global hashes
specfile.licenses = licenses if licenses else [default_license]
specfile.license_files = sorted(license_files)
specfile.hashes = hashes
7 changes: 3 additions & 4 deletions autospec/pkg_integrity.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def __init__(self, pubkey=None, home=None):
util.write_out(os.path.join(_gpghome, 'gpg.conf'), GNUPGCONF)
if pubkey is not None:
args = self.args + ['--import', pubkey]
output, err, code = self.exec_cmd(args)
_, err, code = self.exec_cmd(args)
if code == -9:
raise Exception('Command {} timeout after {} seconds'.format(' '.join(args), CMD_TIMEOUT))
elif code != 0:
Expand Down Expand Up @@ -212,16 +212,15 @@ def quit():
@staticmethod
def calc_sum(filepath, digest_algo):
"""Use digest_algo to calculate block sum of a file."""
BLOCK_SIZE = 4096
block_size = 4096
with open(filepath, 'rb') as fp:
digest = digest_algo()
for block in iter(lambda: fp.read(BLOCK_SIZE), b''):
for block in iter(lambda: fp.read(block_size), b''):
digest.update(block)
return digest.hexdigest()

def print_result(self, result, err_msg=''):
"""Display verification results."""
global EMAIL
package_name = ''
if self.url is not None:
package_name = os.path.basename(self.url)
Expand Down
1 change: 0 additions & 1 deletion autospec/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ def _file_write(self, s):

def translate(package):
"""Convert terms to their alternate definition."""
global dictionary
for item in dictionary:
if item.startswith(package + "="):
return item.split("=")[1]
Expand Down