Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package osc for openSUSE:Factory checked in 
at 2024-07-08 19:08:58
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/osc (Old)
 and      /work/SRC/openSUSE:Factory/.osc.new.2080 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "osc"

Mon Jul  8 19:08:58 2024 rev:198 rq:1186123 version:1.8.3

Changes:
--------
--- /work/SRC/openSUSE:Factory/osc/osc.changes  2024-07-02 18:19:33.450242440 
+0200
+++ /work/SRC/openSUSE:Factory/.osc.new.2080/osc.changes        2024-07-08 
19:09:25.937311884 +0200
@@ -1,0 +2,11 @@
+Mon Jul  8 07:16:37 UTC 2024 - Daniel Mach <daniel.m...@suse.com>
+
+- 1.8.3
+  - Command-line:
+    - Change 'repairwc' command to always run all repair steps
+  - Library:
+    - Make most of the fields in KeyinfoPubkey and KeyinfoSslcert models 
optional
+    - Fix colorize() to avoid wrapping empty string into color escape sequences
+    - Provide default values for kwargs.get/pop in get_results() function
+
+-------------------------------------------------------------------

Old:
----
  osc-1.8.2.tar.gz

New:
----
  osc-1.8.3.tar.gz

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

Other differences:
------------------
++++++ osc.spec ++++++
--- /var/tmp/diff_new_pack.V4DCpj/_old  2024-07-08 19:09:26.633337339 +0200
+++ /var/tmp/diff_new_pack.V4DCpj/_new  2024-07-08 19:09:26.637337485 +0200
@@ -67,7 +67,7 @@
 %endif
 
 Name:           osc
-Version:        1.8.2
+Version:        1.8.3
 Release:        0
 Summary:        Command-line client for the Open Build Service
 License:        GPL-2.0-or-later

++++++ PKGBUILD ++++++
--- /var/tmp/diff_new_pack.V4DCpj/_old  2024-07-08 19:09:26.665338509 +0200
+++ /var/tmp/diff_new_pack.V4DCpj/_new  2024-07-08 19:09:26.669338656 +0200
@@ -1,6 +1,6 @@
 pkgname=osc
-pkgver=1.8.2
-pkgrel=63005f5c57b69f5389cabb6ca5a033ed
+pkgver=1.8.3
+pkgrel=927801cbe8605f2056cba6665c6e5bde
 pkgdesc="Command-line client for the Open Build Service"
 arch=('x86_64')
 url="https://www.github.com/openSUSE/osc";

++++++ debian.changelog ++++++
--- /var/tmp/diff_new_pack.V4DCpj/_old  2024-07-08 19:09:26.709340119 +0200
+++ /var/tmp/diff_new_pack.V4DCpj/_new  2024-07-08 19:09:26.713340265 +0200
@@ -1,4 +1,4 @@
-osc (1.8.2-0) unstable; urgency=low
+osc (1.8.3-0) unstable; urgency=low
 
   * Placeholder
 

++++++ osc-1.8.2.tar.gz -> osc-1.8.3.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/osc-1.8.2/NEWS new/osc-1.8.3/NEWS
--- old/osc-1.8.2/NEWS  2024-07-02 13:54:34.000000000 +0200
+++ new/osc-1.8.3/NEWS  2024-07-08 09:11:02.000000000 +0200
@@ -1,3 +1,11 @@
+- 1.8.3
+  - Command-line:
+    - Change 'repairwc' command to always run all repair steps
+  - Library:
+    - Make most of the fields in KeyinfoPubkey and KeyinfoSslcert models 
optional
+    - Fix colorize() to avoid wrapping empty string into color escape sequences
+    - Provide default values for kwargs.get/pop in get_results() function
+
 - 1.8.2
   - Library:
     - Change 'repairwc' command to fix missing .osc/_osclib_version
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/osc-1.8.2/osc/__init__.py 
new/osc-1.8.3/osc/__init__.py
--- old/osc-1.8.2/osc/__init__.py       2024-07-02 13:54:34.000000000 +0200
+++ new/osc-1.8.3/osc/__init__.py       2024-07-08 09:11:02.000000000 +0200
@@ -13,7 +13,7 @@
 
 
 from .util import git_version
-__version__ = git_version.get_version('1.8.2')
+__version__ = git_version.get_version('1.8.3')
 
 
 # vim: sw=4 et
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/osc-1.8.2/osc/commandline.py 
new/osc-1.8.3/osc/commandline.py
--- old/osc-1.8.2/osc/commandline.py    2024-07-02 13:54:34.000000000 +0200
+++ new/osc-1.8.3/osc/commandline.py    2024-07-08 09:11:02.000000000 +0200
@@ -10106,8 +10106,10 @@
                     dirty_files = getattr(e, "dirty_files", [])
                     if '_apiurl' in dirty_files and (not apiurl or not 
opts.force_apiurl):
                         apiurl = get_apiurl(apiurls)
-                    prj = Project(i, getPackageList=False, wc_check=False)
-                    prj.wc_repair(apiurl)
+
+                prj = Project(i, getPackageList=False, wc_check=False)
+                prj.wc_repair(apiurl)
+
                 for p in prj.pacs_have:
                     if p in prj.pacs_broken:
                         continue
@@ -10127,8 +10129,11 @@
                 dirty_files = getattr(e, "dirty_files", [])
                 if '_apiurl' in dirty_files and (not apiurl or not 
opts.force_apiurl):
                     apiurl = get_apiurl(apiurls)
-                p = Package(pdir, wc_check=False)
-                p.wc_repair(apiurl)
+
+            p = Package(pdir, wc_check=False)
+            repaired = p.wc_repair(apiurl)
+
+            if repaired:
                 print(f'done. Please check the state of the wc (via \'osc 
status {i}\').')
             else:
                 print(f'osc: working copy \'{i}\' is not inconsistent', 
file=sys.stderr)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/osc-1.8.2/osc/core.py new/osc-1.8.3/osc/core.py
--- old/osc-1.8.2/osc/core.py   2024-07-02 13:54:34.000000000 +0200
+++ new/osc-1.8.3/osc/core.py   2024-07-08 09:11:02.000000000 +0200
@@ -4110,7 +4110,7 @@
     # hmm the function name is a bit too generic - something like
     # get_package_results_human would be better, but this would break the 
existing
     # api (unless we keep get_results around as well)...
-    format = kwargs.pop('format')
+    format = kwargs.pop('format', None)
     if format is None:
         format = '%(rep)-20s %(arch)-10s %(pkg)-30s %(status)s'
     r = []
@@ -4118,7 +4118,7 @@
     failed = False
     multibuild_packages = kwargs.pop('multibuild_packages', [])
     show_excluded = kwargs.pop('showexcl', False)
-    code_filter = kwargs.get('code')
+    code_filter = kwargs.get('code', None)
     for results in get_package_results(apiurl, project, package, **kwargs):
         r = []
         for res, is_multi in result_xml_to_dicts(results):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/osc-1.8.2/osc/obs_api/keyinfo_pubkey.py 
new/osc-1.8.3/osc/obs_api/keyinfo_pubkey.py
--- old/osc-1.8.2/osc/obs_api/keyinfo_pubkey.py 2024-07-02 13:54:34.000000000 
+0200
+++ new/osc-1.8.3/osc/obs_api/keyinfo_pubkey.py 2024-07-08 09:11:02.000000000 
+0200
@@ -4,27 +4,27 @@
 class KeyinfoPubkey(XmlModel):
     XML_TAG = "pubkey"
 
-    keyid: str = Field(
+    keyid: Optional[str] = Field(
         xml_attribute=True,
     )
 
-    userid: str = Field(
+    userid: Optional[str] = Field(
         xml_attribute=True,
     )
 
-    algo: str = Field(
+    algo: Optional[str] = Field(
         xml_attribute=True,
     )
 
-    keysize: str = Field(
+    keysize: Optional[str] = Field(
         xml_attribute=True,
     )
 
-    expires: int = Field(
+    expires: Optional[int] = Field(
         xml_attribute=True,
     )
 
-    fingerprint: str = Field(
+    fingerprint: Optional[str] = Field(
         xml_attribute=True,
     )
 
@@ -34,6 +34,10 @@
 
     def get_expires_str(self) -> str:
         import datetime
+
+        if self.expires is None:
+            return ""
+
         return 
datetime.datetime.fromtimestamp(self.expires).strftime("%Y-%m-%d %H:%M:%S")
 
     def to_human_readable_string(self) -> str:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/osc-1.8.2/osc/obs_api/keyinfo_sslcert.py 
new/osc-1.8.3/osc/obs_api/keyinfo_sslcert.py
--- old/osc-1.8.2/osc/obs_api/keyinfo_sslcert.py        2024-07-02 
13:54:34.000000000 +0200
+++ new/osc-1.8.3/osc/obs_api/keyinfo_sslcert.py        2024-07-08 
09:11:02.000000000 +0200
@@ -8,7 +8,7 @@
         xml_attribute=True,
     )
 
-    serial: str = Field(
+    serial: Optional[str] = Field(
         xml_attribute=True,
     )
 
@@ -16,23 +16,23 @@
         xml_attribute=True,
     )
 
-    subject: str = Field(
+    subject: Optional[str] = Field(
         xml_attribute=True,
     )
 
-    algo: str = Field(
+    algo: Optional[str] = Field(
         xml_attribute=True,
     )
 
-    keysize: str = Field(
+    keysize: Optional[str] = Field(
         xml_attribute=True,
     )
 
-    begins: int = Field(
+    begins: Optional[int] = Field(
         xml_attribute=True,
     )
 
-    expires: int = Field(
+    expires: Optional[int] = Field(
         xml_attribute=True,
     )
 
@@ -46,10 +46,18 @@
 
     def get_begins_str(self) -> str:
         import datetime
+
+        if self.begins is None:
+            return ""
+
         return datetime.datetime.fromtimestamp(self.begins).strftime("%Y-%m-%d 
%H:%M:%S")
 
     def get_expires_str(self) -> str:
         import datetime
+
+        if self.expires is None:
+            return ""
+
         return 
datetime.datetime.fromtimestamp(self.expires).strftime("%Y-%m-%d %H:%M:%S")
 
     def to_human_readable_string(self) -> str:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/osc-1.8.2/osc/obs_scm/package.py 
new/osc-1.8.3/osc/obs_scm/package.py
--- old/osc-1.8.2/osc/obs_scm/package.py        2024-07-02 13:54:34.000000000 
+0200
+++ new/osc-1.8.3/osc/obs_scm/package.py        2024-07-08 09:11:02.000000000 
+0200
@@ -175,9 +175,11 @@
                 dirty_files.append(fname)
         return dirty_files
 
-    def wc_repair(self, apiurl: Optional[str] = None):
+    def wc_repair(self, apiurl: Optional[str] = None) -> bool:
         from ..core import get_source_file
 
+        repaired: bool = False
+
         store = Store(self.dir, check=False)
         store.assert_is_package()
 
@@ -195,6 +197,7 @@
             conf.parse_apisrv_url(None, apiurl)
             store.apiurl = apiurl
             self.apiurl = apiurl
+            repaired = True
 
         # all files which are present in the filelist have to exist in the 
storedir
         for f in self.filelist:
@@ -204,6 +207,7 @@
                 get_source_file(self.apiurl, self.prjname, self.name, f.name,
                                 targetfilename=os.path.join(self.storedir, 
f.name), revision=self.rev,
                                 mtime=f.mtime)
+                repaired = True
 
         for fname in store:
             if fname in Package.REQ_STOREFILES or fname in 
Package.OPT_STOREFILES or \
@@ -212,16 +216,21 @@
             elif fname not in self.filenamelist or fname in self.skipped:
                 # this file does not belong to the storedir so remove it
                 store.unlink(fname)
+                repaired = True
 
         for fname in self.to_be_deleted[:]:
             if fname not in self.filenamelist:
                 self.to_be_deleted.remove(fname)
                 self.write_deletelist()
+                repaired = True
 
         for fname in self.in_conflict[:]:
             if fname not in self.filenamelist:
                 self.in_conflict.remove(fname)
                 self.write_conflictlist()
+                repaired = True
+
+        return repaired
 
     def info(self):
         from ..core import info_templ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/osc-1.8.2/osc/obs_scm/project.py 
new/osc-1.8.3/osc/obs_scm/project.py
--- old/osc-1.8.2/osc/obs_scm/project.py        2024-07-02 13:54:34.000000000 
+0200
+++ new/osc-1.8.3/osc/obs_scm/project.py        2024-07-08 09:11:02.000000000 
+0200
@@ -139,13 +139,16 @@
                 dirty_files.append(fname)
         return dirty_files
 
-    def wc_repair(self, apiurl: Optional[str] = None):
+    def wc_repair(self, apiurl: Optional[str] = None) -> bool:
+        repaired: bool = False
+
         store = Store(self.dir, check=False)
         store.assert_is_project()
 
         # there was a time when osc did not write _osclib_version file; let's 
assume these checkouts have version 1.0
         if not store.exists("_osclib_version"):
             store.write_string("_osclib_version", "1.0")
+            repaired = True
 
         if not store.exists("_apiurl") or apiurl:
             if apiurl is None:
@@ -157,6 +160,9 @@
             conf.parse_apisrv_url(None, apiurl)
             store.apiurl = apiurl
             self.apiurl = apiurl
+            repaired = True
+
+        return repaired
 
     def checkout_missing_pacs(self, sinfos, expand_link=False, 
unexpand_link=False):
         from ..core import checkout_package
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/osc-1.8.2/osc/output/tty.py 
new/osc-1.8.3/osc/output/tty.py
--- old/osc-1.8.2/osc/output/tty.py     2024-07-02 13:54:34.000000000 +0200
+++ new/osc-1.8.3/osc/output/tty.py     2024-07-08 09:11:02.000000000 +0200
@@ -44,6 +44,9 @@
     if not color:
         return text
 
+    if not text:
+        return text
+
     result = ""
     for i in color.split(","):
         result += ESCAPE_CODES[i]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/osc-1.8.2/osc/util/git_version.py 
new/osc-1.8.3/osc/util/git_version.py
--- old/osc-1.8.2/osc/util/git_version.py       2024-07-02 13:54:34.000000000 
+0200
+++ new/osc-1.8.3/osc/util/git_version.py       2024-07-08 09:11:02.000000000 
+0200
@@ -9,7 +9,7 @@
     """
     # the `version` variable contents get substituted during `git archive`
     # it requires adding this to .gitattributes: <path to this file> 
export-subst
-    version = "1.8.2"
+    version = "1.8.3"
     if version.startswith(("$", "%")):
         # "$": version hasn't been substituted during `git archive`
         # "%": "Format:" and "$" characters get removed from the version 
string (a GitHub bug?)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/osc-1.8.2/tests/test_keyinfo.py 
new/osc-1.8.3/tests/test_keyinfo.py
--- old/osc-1.8.2/tests/test_keyinfo.py 1970-01-01 01:00:00.000000000 +0100
+++ new/osc-1.8.3/tests/test_keyinfo.py 2024-07-08 09:11:02.000000000 +0200
@@ -0,0 +1,43 @@
+import unittest
+
+from osc import obs_api
+
+
+class TestKeyinfo(unittest.TestCase):
+    def test_empty_pubkey(self):
+        ki = obs_api.Keyinfo()
+        ki.pubkey_list = [{"value": "<pubkey>"}]
+
+        expected = """
+Type        : GPG public key
+User ID     : 
+Algorithm   : 
+Key size    : 
+Expires     : 
+Fingerprint : 
+<pubkey>""".strip()
+        actual = ki.pubkey_list[0].to_human_readable_string()
+        self.assertEqual(expected, actual)
+
+    def test_empty_sslcert(self):
+        ki = obs_api.Keyinfo()
+        ki.sslcert_list = [{"value": "<pubkey>"}]
+
+        expected = """
+Type        : SSL certificate
+Subject     : 
+Key ID      : 
+Serial      : 
+Issuer      : 
+Algorithm   : 
+Key size    : 
+Begins      : 
+Expires     : 
+Fingerprint : 
+<pubkey>""".strip()
+        actual = ki.sslcert_list[0].to_human_readable_string()
+        self.assertEqual(expected, actual)
+
+
+if __name__ == "__main__":
+    unittest.main()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/osc-1.8.2/tests/test_output.py 
new/osc-1.8.3/tests/test_output.py
--- old/osc-1.8.2/tests/test_output.py  2024-07-02 13:54:34.000000000 +0200
+++ new/osc-1.8.3/tests/test_output.py  2024-07-08 09:11:02.000000000 +0200
@@ -74,6 +74,13 @@
 """.strip()
         self.assertEqual(str(t), expected)
 
+    def test_empty_value_no_color(self):
+        t = KeyValueTable()
+        t.add("Key", "", color="bold")
+
+        expected = "Key : "
+        self.assertEqual(str(t), expected)
+
 
 class TestPrintMsg(unittest.TestCase):
     def setUp(self):

++++++ osc.dsc ++++++
--- /var/tmp/diff_new_pack.V4DCpj/_old  2024-07-08 19:09:27.121355187 +0200
+++ /var/tmp/diff_new_pack.V4DCpj/_new  2024-07-08 19:09:27.125355333 +0200
@@ -1,6 +1,6 @@
 Format: 1.0
 Source: osc
-Version: 1.8.2-0
+Version: 1.8.3-0
 Binary: osc
 Maintainer: Adrian Schroeter <adr...@suse.de>
 Architecture: any

Reply via email to