X-Git-Url: https://git.tld-linux.org/?a=blobdiff_plain;f=TLD_Builder%2Futil.py;h=af6b8f12bd2e8ca3022a2215f4b1cd19bac7e3e2;hb=a68953c88fba6e657febf9cb06273f44288f759c;hp=b6bcc2460ff2053fc5494f72e3c6215b6efcbc78;hpb=98894bf10f64d2133335f23117234f9f9ebefe0d;p=tld-builder.git diff --git a/TLD_Builder/util.py b/TLD_Builder/util.py index b6bcc24..af6b8f1 100644 --- a/TLD_Builder/util.py +++ b/TLD_Builder/util.py @@ -32,15 +32,6 @@ def pkg_name(nvr): def msg(m): sys.stderr.write(m) -def sendfile(src, dst): - cnt = 0 - while 1: - s = src.read(10000) - if s == "" or s == b"": break - cnt += len(s) - dst.write(s) - return cnt - def append_to(log, msg): f = open(log, "a") f.write("%s\n" % msg) @@ -112,3 +103,6 @@ def to_str(s): return s else: raise TypeError("Expected bytes or string, but got %s." % type(s)) + +def cmp(a, b): + return (a > b) - (a < b)