]> git.ipfire.org Git - pakfire.git/commitdiff
util: Drop some unused functions
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 4 Mar 2021 23:45:26 +0000 (23:45 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 4 Mar 2021 23:45:26 +0000 (23:45 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/pakfire/util.py

index f0dfd6f536c004ad9893996283b48c0860e307ca..f6929fd9a0a75d204309b7557ba8319509925a09 100644 (file)
 #                                                                             #
 ###############################################################################
 
-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