Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package dd_rescue for openSUSE:Factory 
checked in at 2021-05-20 19:24:35
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/dd_rescue (Old)
 and      /work/SRC/openSUSE:Factory/.dd_rescue.new.2988 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "dd_rescue"

Thu May 20 19:24:35 2021 rev:51 rq:893985 version:1.99.11

Changes:
--------
--- /work/SRC/openSUSE:Factory/dd_rescue/dd_rescue.changes      2021-05-02 
18:35:24.429129048 +0200
+++ /work/SRC/openSUSE:Factory/.dd_rescue.new.2988/dd_rescue.changes    
2021-05-20 19:24:52.113989689 +0200
@@ -1,0 +2,6 @@
+Mon May 17 09:47:33 UTC 2021 - Matej Cepl <mc...@suse.com>
+
+- Add no-python2.patch to remove the dependency on Python 2
+  (sf#ddrescue#4).
+
+-------------------------------------------------------------------

New:
----
  no-python2.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ dd_rescue.spec ++++++
--- /var/tmp/diff_new_pack.UmlzGq/_old  2021-05-20 19:24:52.569987818 +0200
+++ /var/tmp/diff_new_pack.UmlzGq/_new  2021-05-20 19:24:52.573987802 +0200
@@ -31,13 +31,16 @@
 Source1:        
http://garloff.de/kurt/linux/ddrescue/%{name}-%{version}.tar.bz2.asc
 Source2:        %{name}.keyring
 Source99:       %{name}.changes
+# PATCH-FIX-UPSTREAM no-python2.patch sf#ddrescue#4 mc...@suse.com
+# Remove dependency on python2
+Patch0:         no-python2.patch
 BuildRequires:  autoconf
 BuildRequires:  libattr-devel
 BuildRequires:  libopenssl-devel
 BuildRequires:  lzo-devel
 BuildRequires:  lzop
 BuildRequires:  pkgconfig
-BuildRequires:  python
+BuildRequires:  python3-base
 Requires:       bc
 Recommends:     dd_rescue-crypt
 Recommends:     dd_rescue-lzo
@@ -108,7 +111,8 @@
 data to the decompressor; the plugin is still young and might expose bugs.
 
 %prep
-%setup -q
+%autosetup -p1
+
 # Remove build time references so build-compare can do its work
 FAKE_BUILDTIME=$(LC_ALL=C date -u -r %{SOURCE99} '+%%H:%%M')
 FAKE_BUILDDATE=$(LC_ALL=C date -u -r %{SOURCE99} '+%%b %%e %%Y')



++++++ no-python2.patch ++++++
---
 calchmac.py |   46 +++++++++++++++++++++-------------------------
 1 file changed, 21 insertions(+), 25 deletions(-)

--- a/calchmac.py
+++ b/calchmac.py
@@ -1,43 +1,39 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 import hashlib
 import hmac
 import sys
 
 if len(sys.argv) < 4:
-       print >>sys.stderr, "Usage: calchmac.py ALG PASS FILE [FILE [..]]"
-       sys.exit(1)
+    print("Usage: calchmac.py ALG PASS FILE [FILE [..]]", file=sys.stderr)
+    sys.exit(1)
 
 algtbl = (("md5", hashlib.md5),
-         ("sha1", hashlib.sha1),
-         ("sha256", hashlib.sha256),
-         ("sha224", hashlib.sha224),
-         ("sha512", hashlib.sha512),
-         ("sha384", hashlib.sha384))
+          ("sha1", hashlib.sha1),
+          ("sha256", hashlib.sha256),
+          ("sha224", hashlib.sha224),
+          ("sha512", hashlib.sha512),
+          ("sha384", hashlib.sha384))
 
 
 alg = sys.argv[1]
 pwd = sys.argv[2]
-#salt1 = salt + "\0\0\0\x01"
+# salt1 = salt + "\0\0\0\x01"
 algo = None
 
 for (anm, aob) in algtbl:
-       if alg == anm:
-               algo = aob
-               break
+    if alg == anm:
+        algo = aob
+        break
 
 if not algo:
-       print >>sys.stderr, "Hash algorithm %s not found!" % alg
-       sys.exit(2)
+    print("Hash algorithm {} not found!".format(alg), file=sys.stderr)
+    sys.exit(2)
 
-#hmf = open("HMACS.%s" % alg, "w")
+# hmf = open("HMACS.%s" % alg, "w")
 for fnm in sys.argv[3:]:
-       f = file(fnm, "rb")
-       if not f:
-               print >>sys.stderr, "Could not open %s" % fnm
-               sys.exit(3)
-       #print fnm
-       fcont = f.read()
-       hm = hmac.HMAC(pwd, fcont, algo)
-       #print >>hmf, "%s *%s" % (hm.hexdigest(), fnm)
-       print "%s *%s" %(hm.hexdigest(), fnm)
-
+    with open(fnm, "rb") as f:
+        # print fnm
+        fcont = f.read()
+        hm = hmac.HMAC(pwd, fcont, algo)
+        # print >>hmf, "%s *%s" % (hm.hexdigest(), fnm)
+        print("{} *{}".format(hm.hexdigest(), fnm))

Reply via email to