Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package osc for openSUSE:Factory checked in at 2023-10-17 20:24:18 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/osc (Old) and /work/SRC/openSUSE:Factory/.osc.new.20540 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "osc" Tue Oct 17 20:24:18 2023 rev:183 rq:1118018 version:1.4.2 Changes: -------- --- /work/SRC/openSUSE:Factory/osc/osc.changes 2023-10-10 21:02:03.693914599 +0200 +++ /work/SRC/openSUSE:Factory/.osc.new.20540/osc.changes 2023-10-17 20:24:23.894021535 +0200 @@ -1,0 +2,12 @@ +Mon Oct 16 11:55:51 UTC 2023 - Daniel Mach <[email protected]> + +- 1.4.2 + - Command-line: + - Change NoPBTextMeter to display no output at all + - Fix retrieving the configured user in 'user' command + - Configuration: + - Restore 'passx' host option that contains an obfuscated password + - Fix retrieving a password in case a function returns another callable + - Fix retrieving config values in core.vc_export_env() + +------------------------------------------------------------------- Old: ---- osc-1.4.1.tar.gz New: ---- osc-1.4.2.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ osc.spec ++++++ --- /var/tmp/diff_new_pack.RsI8Cv/_old 2023-10-17 20:24:24.618046881 +0200 +++ /var/tmp/diff_new_pack.RsI8Cv/_new 2023-10-17 20:24:24.622047020 +0200 @@ -56,7 +56,7 @@ %endif Name: osc -Version: 1.4.1 +Version: 1.4.2 Release: 0 Summary: Command-line client for the Open Build Service License: GPL-2.0-or-later ++++++ PKGBUILD ++++++ --- /var/tmp/diff_new_pack.RsI8Cv/_old 2023-10-17 20:24:24.650048001 +0200 +++ /var/tmp/diff_new_pack.RsI8Cv/_new 2023-10-17 20:24:24.654048141 +0200 @@ -1,5 +1,5 @@ pkgname=osc -pkgver=1.4.1 +pkgver=1.4.2 pkgrel=0 pkgdesc="Command-line client for the Open Build Service" arch=('x86_64') ++++++ debian.changelog ++++++ --- /var/tmp/diff_new_pack.RsI8Cv/_old 2023-10-17 20:24:24.698049681 +0200 +++ /var/tmp/diff_new_pack.RsI8Cv/_new 2023-10-17 20:24:24.702049822 +0200 @@ -1,4 +1,4 @@ -osc (1.4.1-0) unstable; urgency=low +osc (1.4.2-0) unstable; urgency=low * Placeholder ++++++ osc-1.4.1.tar.gz -> osc-1.4.2.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/osc-1.4.1/NEWS new/osc-1.4.2/NEWS --- old/osc-1.4.1/NEWS 2023-10-10 20:06:27.000000000 +0200 +++ new/osc-1.4.2/NEWS 2023-10-16 13:54:06.000000000 +0200 @@ -1,3 +1,12 @@ +- 1.4.2 + - Command-line: + - Change NoPBTextMeter to display no output at all + - Fix retrieving the configured user in 'user' command + - Configuration: + - Restore 'passx' host option that contains an obfuscated password + - Fix retrieving a password in case a function returns another callable + - Fix retrieving config values in core.vc_export_env() + - 1.4.1 - Configuration: - Always display apiurl when asking for credentials diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/osc-1.4.1/osc/__init__.py new/osc-1.4.2/osc/__init__.py --- old/osc-1.4.1/osc/__init__.py 2023-10-10 20:06:27.000000000 +0200 +++ new/osc-1.4.2/osc/__init__.py 2023-10-16 13:54:06.000000000 +0200 @@ -13,7 +13,7 @@ from .util import git_version -__version__ = git_version.get_version('1.4.1') +__version__ = git_version.get_version('1.4.2') # vim: sw=4 et diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/osc-1.4.1/osc/commandline.py new/osc-1.4.2/osc/commandline.py --- old/osc-1.4.1/osc/commandline.py 2023-10-10 20:06:27.000000000 +0200 +++ new/osc-1.4.2/osc/commandline.py 2023-10-16 13:54:06.000000000 +0200 @@ -9113,12 +9113,12 @@ """ Show fullname and email of a buildservice user """ - usernames = opts.user apiurl = self.get_api_url() - if len(usernames) < 1: - if 'user' not in conf.config['api_host_options'][apiurl]: - raise oscerr.WrongArgs('your oscrc does not have your user name.') - usernames = (conf.config['api_host_options'][apiurl]['user'],) + usernames = opts.user + + if not usernames: + usernames = [conf.config["api_host_options"][apiurl]["user"]] + for name in usernames: user = get_user_data(apiurl, name, 'login', 'realname', 'email') if len(user) == 3: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/osc-1.4.1/osc/conf.py new/osc-1.4.2/osc/conf.py --- old/osc-1.4.1/osc/conf.py 2023-10-10 20:06:27.000000000 +0200 +++ new/osc-1.4.2/osc/conf.py 2023-10-16 13:54:06.000000000 +0200 @@ -104,6 +104,11 @@ # we use the password only from time to time to make a session cookie # and there's no need to keep the password in program memory longer than necessary result = self._data() + + # the function can also return a function, let's evaluate them recursively + while callable(result): + result = result() + if result is None: raise oscerr.OscIOError(None, "Unable to retrieve password") return result @@ -1742,6 +1747,8 @@ return creds_mgr if config['use_keyring'] and GENERIC_KEYRING: return credentials.get_keyring_credentials_manager(cp) + elif cp.get(url, "passx", fallback=None) is not None: + return credentials.ObfuscatedConfigFileCredentialsManager(cp, None) return credentials.PlaintextConfigFileCredentialsManager(cp, None) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/osc-1.4.1/osc/core.py new/osc-1.4.2/osc/core.py --- old/osc-1.4.1/osc/core.py 2023-10-10 20:06:27.000000000 +0200 +++ new/osc-1.4.2/osc/core.py 2023-10-16 13:54:06.000000000 +0200 @@ -8905,7 +8905,7 @@ for (tag, envs) in tag2envs.items(): env_present = [env for env in envs if env in os.environ] - config_present = tag in conf.config['api_host_options'][apiurl] + config_present = bool(conf.config['api_host_options'][apiurl].get(tag, None)) if not env_present and not config_present: missing_tags.append(tag) elif config_present: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/osc-1.4.1/osc/meter.py new/osc-1.4.2/osc/meter.py --- old/osc-1.4.1/osc/meter.py 2023-10-10 20:06:27.000000000 +0200 +++ new/osc-1.4.2/osc/meter.py 2023-10-16 13:54:06.000000000 +0200 @@ -41,13 +41,8 @@ class NoPBTextMeter: - _complained = False - def start(self, basename, size=None): - if not self._complained: - print('Please install the progressbar module') - NoPBTextMeter._complained = True - print('Processing: %s' % basename) + pass def update(self, *args, **kwargs): pass diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/osc-1.4.1/osc/util/git_version.py new/osc-1.4.2/osc/util/git_version.py --- old/osc-1.4.1/osc/util/git_version.py 2023-10-10 20:06:27.000000000 +0200 +++ new/osc-1.4.2/osc/util/git_version.py 2023-10-16 13:54:06.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.4.1" + version = "1.4.2" 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.4.1/tests/test_vc.py new/osc-1.4.2/tests/test_vc.py --- old/osc-1.4.1/tests/test_vc.py 1970-01-01 01:00:00.000000000 +0100 +++ new/osc-1.4.2/tests/test_vc.py 2023-10-16 13:54:06.000000000 +0200 @@ -0,0 +1,85 @@ +import importlib +import os +import unittest + +import osc.conf +from osc.core import vc_export_env + +from .common import GET +from .common import patch + + +class TestVC(unittest.TestCase): + def setUp(self): + importlib.reload(osc.conf) + + config = osc.conf.config + host_options = osc.conf.HostOptions( + config, apiurl="http://localhost", username="Admin" + ) + config.api_host_options[host_options["apiurl"]] = host_options + config["apiurl"] = host_options["apiurl"] + self.host_options = host_options + + def tearDown(self): + importlib.reload(osc.conf) + + @patch.dict(os.environ, {}, clear=True) + def test_vc_export_env_conf(self): + self.host_options.realname = "<REALNAME>" + self.host_options.email = "<EMAIL>" + vc_export_env("http://localhost") + expected = { + "VC_REALNAME": "<REALNAME>", + "VC_MAILADDR": "<EMAIL>", + "mailaddr": "<EMAIL>", + } + self.assertEqual(os.environ, expected) + + @patch.dict(os.environ, {}, clear=True) + @GET( + "http://localhost/person/Admin", + text="<person><login>Admin</login><email>root@localhost</email><realname>OBS Instance Superuser</realname></person>", + ) + def test_vc_export_env_conf_realname(self): + self.host_options.realname = "<REALNAME>" + vc_export_env("http://localhost") + expected = { + "VC_REALNAME": "<REALNAME>", + "VC_MAILADDR": "root@localhost", + "mailaddr": "root@localhost", + } + self.assertEqual(os.environ, expected) + + @patch.dict(os.environ, {}, clear=True) + @GET( + "http://localhost/person/Admin", + text="<person><login>Admin</login><email>root@localhost</email><realname>OBS Instance Superuser</realname></person>", + ) + def test_vc_export_env_conf_email(self): + self.host_options.email = "<EMAIL>" + vc_export_env("http://localhost") + expected = { + "VC_REALNAME": "OBS Instance Superuser", + "VC_MAILADDR": "<EMAIL>", + "mailaddr": "<EMAIL>", + } + self.assertEqual(os.environ, expected) + + @patch.dict(os.environ, {}, clear=True) + @GET( + "http://localhost/person/Admin", + text="<person><login>Admin</login><email>root@localhost</email><realname>OBS Instance Superuser</realname></person>", + ) + def test_vc_export_env_api_call(self): + vc_export_env("http://localhost") + expected = { + "VC_REALNAME": "OBS Instance Superuser", + "VC_MAILADDR": "root@localhost", + "mailaddr": "root@localhost", + } + self.assertEqual(os.environ, expected) + + +if __name__ == "__main__": + unittest.main() ++++++ osc.dsc ++++++ --- /var/tmp/diff_new_pack.RsI8Cv/_old 2023-10-17 20:24:25.182066625 +0200 +++ /var/tmp/diff_new_pack.RsI8Cv/_new 2023-10-17 20:24:25.182066625 +0200 @@ -1,6 +1,6 @@ Format: 1.0 Source: osc -Version: 1.4.1-0 +Version: 1.4.2-0 Binary: osc Maintainer: Adrian Schroeter <[email protected]> Architecture: any
