Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package bam for openSUSE:Factory checked in 
at 2022-10-14 15:41:26
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/bam (Old)
 and      /work/SRC/openSUSE:Factory/.bam.new.2275 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "bam"

Fri Oct 14 15:41:26 2022 rev:7 rq:1010359 version:0.5.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/bam/bam.changes  2021-01-04 19:10:39.839467823 
+0100
+++ /work/SRC/openSUSE:Factory/.bam.new.2275/bam.changes        2022-10-14 
15:42:09.855880825 +0200
@@ -1,0 +2,8 @@
+Thu Oct 13 02:11:35 UTC 2022 - Steve Kowalik <steven.kowa...@suse.com>
+
+- Add patch support-python3.patch:
+  * Support Python 3.
+- Switch BuildRequires to python3.
+- Correct URL. 
+
+-------------------------------------------------------------------

New:
----
  support-python3.patch

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

Other differences:
------------------
++++++ bam.spec ++++++
--- /var/tmp/diff_new_pack.hxpaKq/_old  2022-10-14 15:42:10.303881573 +0200
+++ /var/tmp/diff_new_pack.hxpaKq/_new  2022-10-14 15:42:10.307881579 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package bam
 #
-# Copyright (c) 2021 SUSE LLC
+# Copyright (c) 2022 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -21,14 +21,16 @@
 Release:        0
 Summary:        Lua-based build system
 License:        Zlib
-URL:            http://matricks.github.com/bam/
+URL:            https://github.com/matricks/bam
 Source:         
https://github.com/matricks/bam/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
 # PATCH-FIX-UPSTREAM bam-0.5.1-fix-compilation-order.patch -- 
https://github.com/matricks/bam/issues/116
 Patch0:         bam-0.5.1-fix-compilation-order.patch
+# PATCH-FIX-UPSTREAM 
https://github.com/matricks/bam/commit/b937572d157e660af98e224523ffb3fe5810ed2c
+Patch1:         support-python3.patch
 BuildRequires:  gcc-c++
 BuildRequires:  help2man
 BuildRequires:  pkgconfig
-BuildRequires:  python
+BuildRequires:  python3
 BuildRequires:  pkgconfig(lua5.3)
 
 %description
@@ -37,7 +39,7 @@
 
 %prep
 %setup -q
-%patch0 -p1
+%autopatch -p1
 
 %build
 export CFLAGS="%{optflags}"
@@ -50,6 +52,7 @@
 help2man --section=1 --name="fast and flexible build system" 
--version-string="VERSION_STRING" --no-info ./bam > 
%{buildroot}%{_mandir}/man1/bam.1
 
 %check
+export PYTHON="/usr/bin/python3"
 make %{?_smp_mflags} test
 
 %files

++++++ support-python3.patch ++++++
>From b937572d157e660af98e224523ffb3fe5810ed2c Mon Sep 17 00:00:00 2001
From: Felix Geyer <de...@fobos.de>
Date: Fri, 30 Aug 2019 19:08:35 +0200
Subject: [PATCH] Port scripts to Python 3

Compatibility with Python 2 is preserved.
---
 scripts/gendocs.py |  2 +-
 scripts/test.py    | 67 +++++++++++++++++++++++-----------------------
 scripts/tinydoc.py | 23 ++++++++--------
 3 files changed, 47 insertions(+), 45 deletions(-)

Index: bam-0.5.1/scripts/gendocs.py
===================================================================
--- bam-0.5.1.orig/scripts/gendocs.py
+++ bam-0.5.1/scripts/gendocs.py
@@ -29,6 +29,6 @@ root.nodes += [ParseTextFile(Node("Licen
 
 # render files
 for o in outputs:
-       o.file = file(o.output_name(), "w")
+       o.file = open(o.output_name(), "w")
        o.render(root)
        o.file.close()
Index: bam-0.5.1/scripts/test.py
===================================================================
--- bam-0.5.1.orig/scripts/test.py
+++ bam-0.5.1/scripts/test.py
@@ -1,5 +1,6 @@
 #!/usr/bin/env python
 
+from __future__ import print_function
 import os, sys, shutil, subprocess
 
 extra_bam_flags = ""
@@ -36,8 +37,8 @@ def copytree(src, dst):
                                copytree(srcname, dstname)
                        else:
                                shutil.copy2(srcname, dstname)
-               except (IOError, os.error), why:
-                       print "Can't copy %s to %s: %s" % (`srcname`, 
`dstname`, str(why))
+               except (IOError, os.error) as why:
+                       print("Can't copy '%s' to '%s': %s" % (srcname, 
dstname, str(why)))
 
 
 def run_bam(testname, flags):
@@ -45,7 +46,7 @@ def run_bam(testname, flags):
        olddir = os.getcwd()
        os.chdir(output_path+"/"+testname)
        
-       p = subprocess.Popen(bam+" "+flags, stdout=subprocess.PIPE, shell=True, 
stderr=subprocess.STDOUT)
+       p = subprocess.Popen(bam+" "+flags, stdout=subprocess.PIPE, shell=True, 
stderr=subprocess.STDOUT, universal_newlines=True)
        report = p.stdout.readlines()
        p.wait()
        ret = p.returncode
@@ -64,8 +65,8 @@ def test(name, moreflags="", should_fail
        os.chdir(output_path+"/"+name)
        cmdline = bam+" -t -v "+extra_bam_flags+" " + moreflags
        
-       print name + ":",
-       p = subprocess.Popen(cmdline, stdout=subprocess.PIPE, shell=True, 
stderr=subprocess.STDOUT)
+       print(name + ":", end=" ")
+       p = subprocess.Popen(cmdline, stdout=subprocess.PIPE, shell=True, 
stderr=subprocess.STDOUT, universal_newlines=True)
        report = p.stdout.readlines()
        p.wait()
        ret = p.returncode
@@ -73,50 +74,50 @@ def test(name, moreflags="", should_fail
        os.chdir(olddir)
        
        if (should_fail and not ret) or (not should_fail and ret):
-               print " FAILED!"
+               print(" FAILED!")
                for l in report:
-                       print "\t", l,
+                       print("\t", l, end=" ")
                failed_tests += [name + "(returned %d)" % ret]
        else:
-               print " ok"
+               print(" ok")
 
 def difftest(name, flags1, flags2):
        global failed_tests
        if len(tests) and not name in tests:
                return
        testname = "difftest: %s '%s' vs '%s': "%(name, flags1, flags2)
-       print testname,
+       print(testname, end=" ")
        ret1, report1 = run_bam(name, flags1)
        ret2, report2 = run_bam(name, flags2)
        
        if ret1:
-               print "FAILED! '%s' returned %d" %(flags1, ret1)
+               print("FAILED! '%s' returned %d" %(flags1, ret1))
                failed_tests += [testname]
                return
        
        if ret2:
-               print "FAILED! '%s' returned %d" %(flags2, ret2)
+               print("FAILED! '%s' returned %d" %(flags2, ret2))
                failed_tests += [testname]
                return
        
        if len(report1) != len(report2):
-               print "FAILED! %d lines vs %d lines" % (len(report1), 
len(report2))
+               print("FAILED! %d lines vs %d lines" % (len(report1), 
len(report2)))
                failed_tests += [testname]
                return
        
        failed = 0
-       for i in xrange(0, len(report1)):
+       for i in range(0, len(report1)):
                if report1[i] != report2[i]:
                        if not failed:
-                               print "FAILED!"
-                       print "1:", report1[i].strip()
-                       print "2:", report2[i].strip()
+                               print("FAILED!")
+                       print("1:", report1[i].strip())
+                       print("2:", report2[i].strip())
                        failed += 1
                        
        if failed:
                failed_tests += [testname]
        else:
-               print "ok"
+               print("ok")
 
 def unittests():
        global failed_tests
@@ -129,7 +130,7 @@ def unittests():
        
        tests = []
        state = 0
-       for line in file('src/base.lua'):
+       for line in open('src/base.lua'):
                if state == 0:
                        if "@UNITTESTS" in line:
                                state = 1
@@ -157,16 +158,16 @@ def unittests():
        os.chdir(output_path+"/unit")
        
        for test in tests:
-               f = file("bam.lua", "w")
+               f = open("bam.lua", "w")
                if test.catch != None:
-                       print >>f, "print(\"CATCH:\", %s)"%(test.line)
+                       print("print(\"CATCH:\", %s)"%(test.line), file=f)
                else:
-                       print >>f, test.line
-               print >>f, 'DefaultTarget(PseudoTarget("Test"))'
+                       print(test.line, file=f)
+               print('DefaultTarget(PseudoTarget("Test"))', file=f)
                f.close()
 
-               print  "%s:"%(test.line),
-               p = subprocess.Popen(bam + " --dry", stdout=subprocess.PIPE, 
shell=True, stderr=subprocess.STDOUT)
+               print("%s:"%(test.line), end=" ")
+               p = subprocess.Popen(bam + " --dry", stdout=subprocess.PIPE, 
shell=True, stderr=subprocess.STDOUT, universal_newlines=True)
                report = p.stdout.readlines()
                p.wait()
                ret = p.returncode
@@ -174,7 +175,7 @@ def unittests():
                failed = False
                if ret != test.err:
                        failed = True
-                       print "FAILED! error %d != %d" % (test.err, ret)
+                       print("FAILED! error %d != %d" % (test.err, ret))
                
                if test.catch != None:
                        found = False
@@ -185,7 +186,7 @@ def unittests():
                                        if catched == test.catch:
                                                found = True
                                        else:
-                                               print "FAILED! catch '%s' != 
'%s'" % (test.catch, catched)
+                                               print("FAILED! catch '%s' != 
'%s'" % (test.catch, catched))
                                                
                        if not found:
                                failed = True
@@ -198,16 +199,16 @@ def unittests():
                        
                        if not found:
                                failed = True
-                               print "FAILED! could not find '%s' in output" % 
(test.find)
+                               print("FAILED! could not find '%s' in output" % 
(test.find))
                if failed or verbose:
                        if failed:
                                failed_tests += [test.line]
                        else:
-                               print "",
+                               print("", end=" ")
                        for l in report:
-                               print "\t", l.rstrip()
+                               print("\t", l.rstrip())
                else:
-                       print "ok"
+                       print("ok")
                        
 
        os.chdir(olddir)
@@ -245,11 +246,11 @@ test("import")
 test("multipleoutput")
 
 if len(failed_tests):
-       print "FAILED TESTS:"
+       print("FAILED TESTS:")
        for t in failed_tests:
-               print "\t"+t
+               print("\t"+t)
        sys.exit(1)
 else:
-       print "ALL TESTS PASSED!"
+       print("ALL TESTS PASSED!")
        sys.exit(0)
 
Index: bam-0.5.1/scripts/tinydoc.py
===================================================================
--- bam-0.5.1.orig/scripts/tinydoc.py
+++ bam-0.5.1/scripts/tinydoc.py
@@ -1,4 +1,5 @@
 
+from __future__ import print_function
 import re, time
 
 class Node:
@@ -47,20 +48,20 @@ class Output:
        
        def render_node_index(self, cur):
                if len(cur.index):
-                       print >>self.file, self.index_node_begin(cur)
+                       print(self.index_node_begin(cur), file=self.file)
                for node in cur.nodes:
                        self.render_node_index(node)
                if len(cur.index):
-                       print >>self.file, self.index_node_end(cur)
+                       print(self.index_node_end(cur), file=self.file)
        def render_node(self, cur):
                if len(cur.index):
-                       print >>self.file, self.format_header(cur)
-                       print >>self.file, self.format_body(cur)
+                       print(self.format_header(cur), file=self.file)
+                       print(self.format_body(cur), file=self.file)
                for node in cur.nodes:
                        self.render_node(node)
                        
        def index_nodes(self, cur, index=""):
-               for i in xrange(0, len(cur.nodes)):
+               for i in range(0, len(cur.nodes)):
                        if len(index):
                                cur.nodes[i].index = index + "." + str(i+1)
                        else:
@@ -73,14 +74,14 @@ class Output:
                
        def render(self, rootnode):
                self.index_nodes(rootnode)
-               print >>self.file, self.render_begin()
+               print(self.render_begin(), file=self.file)
                
-               print >>self.file, self.index_begin()
+               print(self.index_begin(), file=self.file)
                self.render_node_index(rootnode)
-               print >>self.file, self.index_end()
+               print(self.index_end(), file=self.file)
                
                self.render_node(rootnode)
-               print >>self.file, self.render_end()
+               print(self.render_end(), file=self.file)
 
 class HTMLOutput(Output):
        def render_begin(self):
@@ -225,7 +226,7 @@ class HTMLOutput(Output):
 
 def ParseTextFile(rootnode, filename, addbr=False):
        group = rootnode
-       for line in file(filename):
+       for line in open(filename):
                if group_tag in line:
                        group_name = 
line.split(group_tag)[-1].split(end_tag)[0].strip()
                        group = Node(group_name)
@@ -244,7 +245,7 @@ def ParseFile(rootnode, filename):
        # 2 = outputting function decl
        state = 0
        group = rootnode
-       for line in file(filename):
+       for line in open(filename):
                if state == 0:
                        if group_tag in line:
                                group_name = 
line.split(group_tag)[-1].split(end_tag)[0].strip()

Reply via email to