diff --git a/bin/gbuild b/bin/gbuild index d11b5aa..4516b6c 100755 --- a/bin/gbuild +++ b/bin/gbuild @@ -31,6 +31,8 @@ def info(str) end def build_one_configuration(suite, arch, build_desc, reference_datetime) + FileUtils.rm_f("var/build.log") + bits = @bitness[arch] or raise "unknown architecture ${arch}" suitearch = "#{suite}-#{arch}" diff --git a/share/gitian-updater b/share/gitian-updater index 8894572..b69aae1 100755 --- a/share/gitian-updater +++ b/share/gitian-updater @@ -26,6 +26,7 @@ import urllib2 import libxml2 import argparse import yaml +from hashlib import sha256 from zipfile import ZipFile from distutils.version import LooseVersion @@ -35,6 +36,16 @@ have_injected_config = injected_config != inject_config_string quiet = 0 +def sha256sum(path): + h = sha256() + f = open(path) + while True: + buf = f.read(10240) + if buf == "": + break + h.update(buf) + return h.hexdigest() + def sanitize_path(dir_name, name, where): if re.search(r'[^/\w.-]', name): raise ValueError, "unsanitary path in %s"%(where) @@ -94,8 +105,7 @@ def get_assertions(temp_dir, unpack_dir, file_names): release = None to_check = {} for file_name in file_names: - shasum = subprocess.Popen(["sha256sum", '-b', os.path.join(unpack_dir, file_name)], stdout=subprocess.PIPE).communicate()[0][0:64] - sums[file_name] = shasum + sums[file_name] = sha256sum(os.path.join(unpack_dir, file_name)) to_check[file_name] = 1 out_manifest = False