From: Michael Tremer Date: Thu, 4 Mar 2021 23:45:26 +0000 (+0000) Subject: util: Drop some unused functions X-Git-Tag: 0.9.28~1285^2~632 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6dd393f2d95499dda7c12ebf44de7884fd898f8d;p=pakfire.git util: Drop some unused functions Signed-off-by: Michael Tremer --- diff --git a/src/pakfire/util.py b/src/pakfire/util.py index f0dfd6f53..f6929fd9a 100644 --- a/src/pakfire/util.py +++ b/src/pakfire/util.py @@ -19,11 +19,9 @@ # # ############################################################################### -import hashlib import os import random import shutil -import signal import string import sys import time @@ -129,23 +127,6 @@ def rm(path, *args, **kargs): else: raise -def calc_hash1(filename=None, data=None): - h = hashlib.new("sha1") - - if filename: - f = open(filename) - buf = f.read(BUFFER_SIZE) - while buf: - h.update(buf) - buf = f.read(BUFFER_SIZE) - - f.close() - - elif data: - h.update(data) - - return h.hexdigest() - def text_wrap(s, length=65): if not s: return "" @@ -185,18 +166,3 @@ def text_wrap(s, length=65): #return "\n".join(lines) return lines - -def scriptlet_interpreter(scriptlet): - """ - This function returns the interpreter of a scriptlet. - """ - # XXX handle ELF? - interpreter = None - - for line in scriptlet.splitlines(): - if line.startswith("#!/"): - interpreter = line[2:] - interpreter = interpreter.split()[0] - break - - return interpreter