]> git.ipfire.org Git - people/pmueller/ipfire-3.x.git/blobdiff - pakfire/patches/0006-Create-all-hash-objects-with-hashlib-s-new-function.patch
pakfire: Update to 0.9.25.
[people/pmueller/ipfire-3.x.git] / pakfire / patches / 0006-Create-all-hash-objects-with-hashlib-s-new-function.patch
diff --git a/pakfire/patches/0006-Create-all-hash-objects-with-hashlib-s-new-function.patch b/pakfire/patches/0006-Create-all-hash-objects-with-hashlib-s-new-function.patch
deleted file mode 100644 (file)
index 62228fd..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-From e3bcfd234622e951d22fbfab631173e7c2a57a6b Mon Sep 17 00:00:00 2001
-From: Michael Tremer <michael.tremer@ipfire.org>
-Date: Thu, 24 Jan 2013 02:41:26 +0100
-Subject: [PATCH 06/17] Create all hash objects with hashlib's "new" function.
-
----
- python/pakfire/client/builder.py    | 2 +-
- python/pakfire/packages/file.py     | 2 +-
- python/pakfire/packages/packager.py | 4 ++--
- python/pakfire/server.py            | 3 ++-
- python/pakfire/util.py              | 2 +-
- 5 files changed, 7 insertions(+), 6 deletions(-)
-
-diff --git a/python/pakfire/client/builder.py b/python/pakfire/client/builder.py
-index 9798cc4..9aefa1c 100644
---- a/python/pakfire/client/builder.py
-+++ b/python/pakfire/client/builder.py
-@@ -408,7 +408,7 @@ class ClientBuilder(object):
-                               # Check if the download checksum matches (if provided).
-                               if self.build_source_hash512:
--                                      h = hashlib.sha512()
-+                                      h = hashlib.new("sha512")
-                                       f = open(tmpfile, "rb")
-                                       while True:
-                                               buf = f.read(BUFFER_SIZE)
-diff --git a/python/pakfire/packages/file.py b/python/pakfire/packages/file.py
-index 55f9694..990f6f7 100644
---- a/python/pakfire/packages/file.py
-+++ b/python/pakfire/packages/file.py
-@@ -211,7 +211,7 @@ class FilePackage(base.Package):
-                                               continue
-                                       # Calc hash of the current configuration file.
--                                      config_hash1 = hashlib.sha512()
-+                                      config_hash1 = hashlib.new("sha512")
-                                       f = open(target)
-                                       while True:
-                                               buf = f.read(BUFFER_SIZE)
-diff --git a/python/pakfire/packages/packager.py b/python/pakfire/packages/packager.py
-index a456602..c8e1c78 100644
---- a/python/pakfire/packages/packager.py
-+++ b/python/pakfire/packages/packager.py
-@@ -104,7 +104,7 @@ class Packager(object):
-                       # Calculating the hash sum of the added file
-                       # and store it in the chksums file.
-                       f = open(filename)
--                      h = hashlib.sha512()
-+                      h = hashlib.new("sha512")
-                       while True:
-                               buf = f.read(BUFFER_SIZE)
-                               if not buf:
-@@ -164,7 +164,7 @@ class Packager(object):
-                       # Calculate SHA512 hash of regular files.
-                       if m.isreg():
-                               mobj = datafile.extractfile(m)
--                              h = hashlib.sha512()
-+                              h = hashlib.new("sha512")
-                               while True:
-                                       buf = mobj.read(BUFFER_SIZE)
-diff --git a/python/pakfire/server.py b/python/pakfire/server.py
-index 64e3dd5..edc070f 100644
---- a/python/pakfire/server.py
-+++ b/python/pakfire/server.py
-@@ -82,7 +82,8 @@ class Source(object):
-       @property
-       def path(self):
--              h = hashlib.sha1(self.url)
-+              h = hashlib.new("sha1")
-+              h.update(self.url)
-               # XXX path is to be changed
-               return "/var/cache/pakfire/sources/%s" % h.hexdigest()
-diff --git a/python/pakfire/util.py b/python/pakfire/util.py
-index 9fa011a..84128cd 100644
---- a/python/pakfire/util.py
-+++ b/python/pakfire/util.py
-@@ -197,7 +197,7 @@ def format_speed(s):
-       return "%sB/s" % format_size(s)
- def calc_hash1(filename=None, data=None):
--      h = hashlib.sha1()
-+      h = hashlib.new("sha1")
-       if filename:
-               f = open(filename)
--- 
-1.8.1.2
-