Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package bugzilla for openSUSE:Factory 
checked in at 2021-09-11 22:24:30
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/bugzilla (Old)
 and      /work/SRC/openSUSE:Factory/.bugzilla.new.1899 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "bugzilla"

Sat Sep 11 22:24:30 2021 rev:7 rq:918440 version:5.0.6

Changes:
--------
--- /work/SRC/openSUSE:Factory/bugzilla/bugzilla.changes        2020-12-13 
17:31:09.396435761 +0100
+++ /work/SRC/openSUSE:Factory/.bugzilla.new.1899/bugzilla.changes      
2021-09-11 22:25:00.411414782 +0200
@@ -1,0 +2,6 @@
+Tue Aug 31 06:31:13 UTC 2021 - Steve Kowalik <steven.kowa...@suse.com>
+
+- Add modernize-bugzilla-submit.patch:
+  - Port bugzilla-submit to Python 3. 
+
+-------------------------------------------------------------------

New:
----
  modernize-bugzilla-submit.patch

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

Other differences:
------------------
++++++ bugzilla.spec ++++++
--- /var/tmp/diff_new_pack.1rZ2xu/_old  2021-09-11 22:25:00.871415235 +0200
+++ /var/tmp/diff_new_pack.1rZ2xu/_new  2021-09-11 22:25:00.875415239 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package bugzilla
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2021 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -29,6 +29,7 @@
 Source4:        %{name}.conf
 Source5:        %{name}-rpmlintrc
 Patch1:         fix_whine_error.patch
+Patch2:         modernize-bugzilla-submit.patch
 BuildRequires:  apache-rpm-macros
 BuildRequires:  fdupes
 BuildRequires:  pkgconfig(systemd)
@@ -123,9 +124,8 @@
 
 %prep
 %setup -q
-%patch1 -p1
+%autopatch -p1
 # rpmlint
-sed -i -e 's|\/usr\/bin\/env python|\/usr\/bin\/python|g' 
contrib/bugzilla-submit/bugzilla-submit
 sed -i -e 's|\/usr\/bin\/env perl|\/usr\/bin\/perl|g' contrib/perl-fmt
 #
 tar -xzf %{SOURCE2}  --directory "template"

++++++ modernize-bugzilla-submit.patch ++++++
Index: bugzilla-5.0.6/contrib/bugzilla-submit/bugzilla-submit
===================================================================
--- bugzilla-5.0.6.orig/contrib/bugzilla-submit/bugzilla-submit
+++ bugzilla-5.0.6/contrib/bugzilla-submit/bugzilla-submit
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
@@ -26,16 +26,12 @@ def error(m):
     sys.stderr.flush()
     sys.exit(1)
 
-version = string.split(string.split(sys.version)[0], ".")[:2]
-if map(int, version) < [2, 3]:
-    error("you must upgrade to Python 2.3 or higher to use this script.")
+import urllib.request, urllib.parse, urllib.error, re, os, netrc, 
email.Parser, optparse
 
-import urllib, re, os, netrc, email.Parser, optparse
-
-class ErrorURLopener(urllib.URLopener):
+class ErrorURLopener(urllib.request.URLopener):
     """URLopener that handles HTTP 404s"""
     def http_error_404(self, url, fp, errcode, errmsg, headers, *extra):
-        raise ValueError, errmsg # 'File Not Found'
+        raise ValueError(errmsg) # 'File Not Found'
 
 # Set up some aliases -- partly to hide the less friendly fieldnames
 # behind the names actually used for them in the stock web page presentation,
@@ -59,7 +55,7 @@ def header_to_field(hdr):
     return hdr
 
 def field_to_header(hdr):
-    hdr = "-".join(map(lambda x: x.capitalize(), hdr.split("_")))
+    hdr = "-".join([x.capitalize() for x in hdr.split("_")])
     for (alias, name) in field_aliases:
         if hdr == name:
             hdr = alias
@@ -114,9 +110,9 @@ def get_credentials(bugzilla):
     authenticate_on = '"' + bugzilla + '"'
     try:
         credentials = netrc.netrc()
-    except netrc.NetrcParseError, e:
+    except netrc.NetrcParseError as e:
         error("ill-formed .netrc: %s:%s %s" % (e.filename, e.lineno, e.msg))
-    except IOError, e:
+    except IOError as e:
         error("missing .netrc file %s" % str(e).split()[-1])
     ret = credentials.authenticators(authenticate_on)
     if not ret:
@@ -177,12 +173,11 @@ def validate_fields(data):
     legal_fields = required_fields + (
         "assigned_to", "cc", "keywords", "dependson", "blocked",
     )
-    my_fields = data.keys()
-    for field in my_fields:
+    for field in data:
         if field not in legal_fields:
             error("invalid field: %s" % field_to_header(field))
     for field in required_fields:
-        if field not in my_fields:
+        if field not in data:
             error("required field missing: %s" % field_to_header(field))
     
     if not data['short_desc']:
@@ -197,7 +192,7 @@ def validate_fields(data):
 
 def submit_bug_POST(bugzilla, data):
     # Move the request over the wire
-    postdata = urllib.urlencode(data)
+    postdata = urllib.parse.urlencode(data)
     try:
         url = ErrorURLopener().open("%s/post_bug.cgi" % bugzilla, postdata)
     except ValueError:
@@ -270,10 +265,10 @@ def check_result_POST(ret, data):
               "is Bugzilla instance's top-level directory?" % bugzilla)
     m = re.search("Bug ([0-9]+) Submitted", ret)
     if not m:
-        print ret
+        print(ret)
         error("Internal error: bug id not found; please report a bug")
     id = m.group(1)
-    print "Bug %s posted." % id
+    print("Bug %s posted." % id)
 
 #
 #

Reply via email to