Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package zypper-changelog-plugin for 
openSUSE:Factory checked in at 2022-12-08 16:52:02
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/zypper-changelog-plugin (Old)
 and      /work/SRC/openSUSE:Factory/.zypper-changelog-plugin.new.1835 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "zypper-changelog-plugin"

Thu Dec  8 16:52:02 2022 rev:5 rq:1041318 version:0.3

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/zypper-changelog-plugin/zypper-changelog-plugin.changes
  2022-11-16 15:43:56.335964665 +0100
+++ 
/work/SRC/openSUSE:Factory/.zypper-changelog-plugin.new.1835/zypper-changelog-plugin.changes
        2022-12-08 16:52:09.559782276 +0100
@@ -1,0 +2,5 @@
+Thu Dec  8 06:20:17 UTC 2022 - Zoltan Balogh <zbal...@suse.com>
+
+- Fixing bsc#1206081 -  The zypper changelog plugin fails for packages not 
installed
+
+-------------------------------------------------------------------

Old:
----
  zypper-changelog-plugin-0.2.tar.gz

New:
----
  zypper-changelog-plugin-0.3.tar.gz

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

Other differences:
------------------
++++++ zypper-changelog-plugin.spec ++++++
--- /var/tmp/diff_new_pack.Eu3s4Y/_old  2022-12-08 16:52:10.071784902 +0100
+++ /var/tmp/diff_new_pack.Eu3s4Y/_new  2022-12-08 16:52:10.079784943 +0100
@@ -17,13 +17,13 @@
 
 
 Name:           zypper-changelog-plugin
-Version:        0.2
+Version:        0.3
 Release:        0
 Summary:        Changelog listing tool
 License:        GPL-2.0-only
 Group:          System/Packages
 URL:            https://github.com/bzoltan1/zypper-changelog-plugin.git
-Source:         zypper-changelog-plugin-0.2.tar.gz
+Source:         zypper-changelog-plugin-0.3.tar.gz
 Requires:       /usr/bin/python3
 Requires:       python3-requests
 BuildArch:      noarch

++++++ zypper-changelog-plugin-0.2.tar.gz -> zypper-changelog-plugin-0.3.tar.gz 
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/zypper-changelog-plugin-0.2/zypper-changelog 
new/zypper-changelog-plugin-0.3/zypper-changelog
--- old/zypper-changelog-plugin-0.2/zypper-changelog    2022-11-11 
09:02:55.815362460 +0100
+++ new/zypper-changelog-plugin-0.3/zypper-changelog    2021-01-17 
17:12:02.848290488 +0100
@@ -1,4 +1,4 @@
-#!/usr/bin/python3
+#!/usr/bin/env python3
 # -*- coding: utf-8 -*-
 # Copyright © 2018 SUSE LLC
 #
@@ -34,12 +34,11 @@
 
 
 def log_text(text):
-    if args.debug:
-        print(text)
+    print(text)
 
 
 def parse_args():
-    p = ArgumentParser(prog='zypper changelog',
+    p = ArgumentParser(prog='zypper-changelog',
                        description='Shows the changelog' +
                        'of one ore more packages.',
                        formatter_class=argparse.RawDescriptionHelpFormatter)
@@ -56,15 +55,15 @@
                    help="Package name \
                               or regular expression to match packages.")
     p.add_argument("-r", "--repositories",
-                   dest="repos", default="ALL",
-                   help="Comma separated list of repositories \
+                   dest="repos", default="oss",
+                   help="Comma separated list of repositores \
                               to search for changelogs.")
     p.add_argument("-a", "--all",
                    dest="all", default=False,
                    action='store_true',
                    help="Lists changelogs for all packages")
     p.add_argument("-u", "--update",
-                   dest="update", default=True,
+                   dest="update", default=False,
                    action='store_true',
                    help="Lists changelogs for all packages to be updated")
     if len(sys.argv[1:]) == 0:
@@ -91,7 +90,6 @@
     arch = ''
     zypp_process = subprocess.Popen(["zypper",
                                      "-x",
-                                     "--non-interactive",
                                      "list-updates"],
                                     stdout=subprocess.PIPE,
                                     stderr=subprocess.PIPE)
@@ -142,17 +140,14 @@
     package_list = args.packages.split(",")
 
 list_of_xml_files = []
+
 # Find the cache file of the repositories
 for root, dirs, files in os.walk("/var/cache/zypp/raw/"):
     for file in files:
         if file.endswith("primary.xml.gz"):
-            if args.repos=="ALL":
-                list_of_xml_files.append(os.path.join(root, file))
-            else:
-                for repository in repository_list:
-                    log_text("Enabled repository: %s" % repository)
-                    if repository in root:
-                        list_of_xml_files.append(os.path.join(root, file))
+            for repository in repository_list:
+                if repository in root:
+                    list_of_xml_files.append(os.path.join(root, file))
 
 ts = rpm.TransactionSet("", (rpm._RPMVSF_NOSIGNATURES or
                         rpm.RPMVSF_NOHDRCHK or
@@ -169,13 +164,10 @@
 stdout_value, stderr_value = zypp_process.communicate()
 repo_tree = ET.ElementTree(ET.fromstring(stdout_value))
 repo_root = repo_tree.getroot()
-
-
 for files in list_of_xml_files:
     for repo in repo_root.iter('repo'):
         if repo.get('alias') in files:
             mirror_url = repo.find('url').text
-            log_text("Mirror URL: %s" % mirror_url)
 
     zcat_process = subprocess.Popen(["zcat",
                                      "%s" % files],
@@ -212,14 +204,14 @@
             start = field.get('start')
             end = field.get('end')
             url = '%s/%s' % (mirror_url, package[10].get('href'))
-            log_text("URL to fetch the rpm header from: %s" % url)
+            log_text(url)
             try:
                 # Fetch the rpm header as it contains the changelogs
                 rpm_header = requests.get(url,
                                           headers={'Range':
-                                                   'bytes=0-%s' % (end)},
-                                          timeout=5)
-            except requests.ConnectionError as e:
+                                                   'bytes=0-%s' % (end)})
+                rpm_header.raise_for_status()
+            except requests.exceptions.HTTPError as e:
                 log_text(e)
                 continue
             # Dump the header to a temporary file as the ts.hdrFromFdno
@@ -243,14 +235,6 @@
             for (name, time, text) in zip(changelog_name,
                                           changelog_time,
                                           changelog_text):
-                # In some cases the rpm data is in bytes and need to be 
-                # converted to strings
-                if type(name) == bytes:
-                    name_str = name.decode("utf-8")
-                    name = name_str
-                if type(text) == bytes:
-                    text_str = text.decode("utf-8")
-                    text = text_str
                 dt = datetime.datetime.fromtimestamp(time).strftime("%a %b " +
                                                                     "%d %Y")
                 if args.commits:
@@ -259,12 +243,9 @@
                     changelog += "* %s %s\n%s\n\n" % (dt, name, text)
             if args.update:
                 local = str(local_changelog(package[0].text))
-                #text_file = open("local-%s" % package , "w")
-                #text_file.write(local)
-                #text_file.close()
                 diff = difflib.ndiff(local.split('\n'), changelog.split('\n'))
-                for line in diff:
-                    if line.startswith('+ '):
-                        print(line.replace('+ ', ''))
+                for l in diff:
+                    if l.startswith('+ '):
+                        print(l.replace('+ ', ''))
             else:
                 print(changelog)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/zypper-changelog-plugin-0.2/zypper-changelog-plugin.changes 
new/zypper-changelog-plugin-0.3/zypper-changelog-plugin.changes
--- old/zypper-changelog-plugin-0.2/zypper-changelog-plugin.changes     
2022-11-16 07:35:40.361361224 +0100
+++ new/zypper-changelog-plugin-0.3/zypper-changelog-plugin.changes     
2022-12-08 07:20:56.746357798 +0100
@@ -1,4 +1,9 @@
 -------------------------------------------------------------------
+Thu Dec  8 06:20:17 UTC 2022 - Zoltan Balogh <zbal...@suse.com>
+
+- Fixing #1206081 -  The zypper changelog plugin fails for packages not 
installed
+
+-------------------------------------------------------------------
 Wed Nov 16 06:35:11 UTC 2022 - Zoltan Balogh <zbal...@suse.com>
 
 - Update with few fixes after testing on Leap and SLES
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/zypper-changelog-plugin-0.2/zypper-changelog-plugin.spec 
new/zypper-changelog-plugin-0.3/zypper-changelog-plugin.spec
--- old/zypper-changelog-plugin-0.2/zypper-changelog-plugin.spec        
2022-11-16 07:30:01.986726181 +0100
+++ new/zypper-changelog-plugin-0.3/zypper-changelog-plugin.spec        
1970-01-01 01:00:00.000000000 +0100
@@ -1,50 +0,0 @@
-#
-# spec file for package zypper-changelog-plugin
-#
-# 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
-# upon. The license for this file, and modifications and additions to the
-# file, is the same license as for the pristine package itself (unless the
-# license for the pristine package is not an Open Source License, in which
-# case the license is the MIT License). An "Open Source License" is a
-# license that conforms to the Open Source Definition (Version 1.9)
-# published by the Open Source Initiative.
-
-# Please submit bugfixes or comments via https://bugs.opensuse.org/
-#
-
-
-Name:           zypper-changelog-plugin
-Version:        0.2 
-Release:        0 
-Summary:        Changelog listing tool
-License:        GPL-2.0-only
-Group:          System/Packages
-URL:            https://github.com/bzoltan1/zypper-changelog-plugin.git
-Source:         zypper-changelog-plugin-0.2.tar.gz
-Requires:       /usr/bin/python3
-Requires:       python3-requests
-BuildArch:      noarch
-
-%description
-This tool is to show the changelog of packages in the repository
-%prep
-%setup -q
-
-%build
-
-%install
-mkdir -p %{buildroot}%{_bindir}/
-install -m 755 zypper-changelog %{buildroot}%{_bindir}/zypper-changelog
-mkdir -p %{buildroot}/usr/lib/zypper/commands %{buildroot}/%{_mandir}/man8
-install -m 644 zypper-changelog.8 %{buildroot}/%{_mandir}/man8/
-
-%files
-%license LICENSE
-%doc README.md
-%{_bindir}/zypper-changelog
-%{_mandir}/man8/*
-
-%changelog
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/zypper-changelog-plugin-0.2/zypper-changelog.spec 
new/zypper-changelog-plugin-0.3/zypper-changelog.spec
--- old/zypper-changelog-plugin-0.2/zypper-changelog.spec       1970-01-01 
01:00:00.000000000 +0100
+++ new/zypper-changelog-plugin-0.3/zypper-changelog.spec       2020-05-06 
14:30:43.897154403 +0200
@@ -0,0 +1,43 @@
+#
+# spec file for package zypper-changelog
+#
+# Copyright (c) 2020 SUSE LLC
+#
+# All modifications and additions to the file contributed by third parties
+# remain the property of their copyright owners, unless otherwise agreed
+# upon. The license for this file, and modifications and additions to the
+# file, is the same license as for the pristine package itself (unless the
+# license for the pristine package is not an Open Source License, in which
+# case the license is the MIT License). An "Open Source License" is a
+# license that conforms to the Open Source Definition (Version 1.9)
+# published by the Open Source Initiative.
+
+# Please submit bugfixes or comments via https://bugs.opensuse.org/
+#
+
+
+Name:           zypper-changelog
+Version:        0.1 
+Release:        1%{?dist}
+Summary:        Changelog listing tool
+License:        GPL-2.0-or-later 
+URL:            https://github.com/bzoltan1/zypper-changelog.git
+Source:         zypper-changelog-0.1.tar.gz
+Requires:       python3
+BuildArch:      noarch
+
+%description
+This tool is to show the changelog of packages in the repository
+%prep
+%setup -q
+
+%install
+mkdir -p %{buildroot}%{_bindir}/
+install -m 755 zypper-changelog %{buildroot}%{_bindir}/zypper-changelog
+
+%files
+%doc README.md
+%license LICENSE
+%{_bindir}/zypper-changelog
+
+%changelog

Reply via email to