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-05-05 15:57:40
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/osc (Old)
 and      /work/SRC/openSUSE:Factory/.osc.new.1533 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "osc"

Fri May  5 15:57:40 2023 rev:176 rq:1084818 version:1.1.2

Changes:
--------
--- /work/SRC/openSUSE:Factory/osc/osc.changes  2023-04-11 15:54:39.094031783 
+0200
+++ /work/SRC/openSUSE:Factory/.osc.new.1533/osc.changes        2023-05-05 
15:57:42.064228118 +0200
@@ -1,0 +2,21 @@
+Wed May  3 08:12:22 UTC 2023 - Daniel Mach <daniel.m...@suse.com>
+
+- 1.1.2
+  - Command-line:
+    - Add '--buildtool-opt' option passing options to underlying rpmbuild to 
the 'build' command
+    - Fix 'diff' command to support diffing selected files only
+    - Identify inherited packages in the 'dependson' command output
+    - Bring the '--debug' option back to the 'buildinfo' command
+    - Fix 'buildhistory' command by setting the type of the '--limit' option 
to int
+  - Library:
+    - Fix a traceback when failed to unlock a keyring
+    - Don't retry on 400 HTTP status code in core.server_diff()
+    - Clean-up the '.old' folder if an exception happens
+    - Document 'popt' attribute in the _link template
+    - Fix build.get_repo() to return only directory that contains 
'repodata/repomd.xml'
+  - Connection:
+    - Retry on receiving the following HTTP status codes: 400, 500, 502, 503, 
504
+    - Allow disabling retry on 400 HTTP status code
+    - Fix urlgrab to skip mirrors with invalid scheme
+
+-------------------------------------------------------------------

Old:
----
  osc-1.1.1.tar.gz

New:
----
  debian.manpages
  osc-1.1.2.tar.gz

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

Other differences:
------------------
++++++ osc.spec ++++++
--- /var/tmp/diff_new_pack.vARNms/_old  2023-05-05 15:57:42.928233068 +0200
+++ /var/tmp/diff_new_pack.vARNms/_new  2023-05-05 15:57:42.932233091 +0200
@@ -49,7 +49,7 @@
 %endif
 
 Name:           osc
-Version:        1.1.1
+Version:        1.1.2
 Release:        0
 Summary:        Command-line client for the Open Build Service
 License:        GPL-2.0-or-later

++++++ PKGBUILD ++++++
--- /var/tmp/diff_new_pack.vARNms/_old  2023-05-05 15:57:42.964233274 +0200
+++ /var/tmp/diff_new_pack.vARNms/_new  2023-05-05 15:57:42.968233297 +0200
@@ -1,5 +1,5 @@
 pkgname=osc
-pkgver=1.1.1
+pkgver=1.1.2
 pkgrel=0
 pkgdesc="Command-line client for the Open Build Service"
 arch=('x86_64')

++++++ debian.changelog ++++++
--- /var/tmp/diff_new_pack.vARNms/_old  2023-05-05 15:57:43.004233503 +0200
+++ /var/tmp/diff_new_pack.vARNms/_new  2023-05-05 15:57:43.008233526 +0200
@@ -1,2 +1,6 @@
-osc (1.1.1-0) unstable; urgency=low
+osc (1.1.2-1) unstable; urgency=low
+
+  * Placeholder
+
+ -- Adrian Schroeter <adr...@suse.de>  Wed, 05 Apr 2023 12:34:56 +0000
 

++++++ debian.control ++++++
--- /var/tmp/diff_new_pack.vARNms/_old  2023-05-05 15:57:43.036233687 +0200
+++ /var/tmp/diff_new_pack.vARNms/_new  2023-05-05 15:57:43.040233710 +0200
@@ -1,10 +1,11 @@
 Source: osc
-Priority: extra
+Priority: optional
 Maintainer: Adrian Schroeter <adr...@suse.de>
 Build-Depends:
     debhelper (>= 10),
     dh-python,
     python3-all (>=3.6),
+    python3-argparse-manpage,
     python3-cryptography,
     python3-setuptools,
     python3-urllib3
@@ -30,5 +31,5 @@
     sudo,
     xdg-utils
 Description: Command-line client for the Open Build Service
-    OpenSUSE Commander is a command-line client for the Open Build Service.
+ OpenSUSE Commander is a command-line client for the Open Build Service.
 

++++++ debian.manpages ++++++
osc.1

++++++ debian.rules ++++++
--- /var/tmp/diff_new_pack.vARNms/_old  2023-05-05 15:57:43.100234054 +0200
+++ /var/tmp/diff_new_pack.vARNms/_new  2023-05-05 15:57:43.104234077 +0200
@@ -1,17 +1,27 @@
 #!/usr/bin/make -f
 # Uncomment this to turn on verbose mode.
-#export DH_VERBOSE=1
+export DH_VERBOSE=1
 
 export PYBUILD_NAME=osc
 
 %:
        dh $@ --with python3 --buildsystem=pybuild
 
+override_dh_auto_build:
+       dh_auto_build
+       PYTHONPATH=. argparse-manpage \
+    --output=osc.1 \
+    --module=osc.commandline \
+    --function=get_parser \
+    --project-name=osc \
+    --author="Contributors to the osc project. See the project's GIT history 
for the complete list." \
+    --url="https://github.com/openSUSE/osc/";
+
 override_dh_auto_install:
        dh_auto_install
-       install -Dm0644 contrib/complete.csh debian/tmp/etc/profile.d/osc.csh
-       install -Dm0644 contrib/complete.sh 
debian/tmp/etc/bash_completion.d/osc.sh
-       install -Dm0755 contrib/osc.complete debian/tmp/usr/lib/osc/complete
+       install -Dm0644 contrib/complete.csh debian/osc/etc/profile.d/osc.csh
+       install -Dm0644 contrib/complete.sh 
debian/osc/etc/bash_completion.d/osc.sh
+       install -Dm0755 contrib/osc.complete debian/osc/usr/lib/osc/complete
 
 
 override_dh_auto_test:

++++++ osc-1.1.1.tar.gz -> osc-1.1.2.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/osc-1.1.1/NEWS new/osc-1.1.2/NEWS
--- old/osc-1.1.1/NEWS  2023-04-11 14:01:52.000000000 +0200
+++ new/osc-1.1.2/NEWS  2023-05-03 10:11:24.000000000 +0200
@@ -1,3 +1,21 @@
+- 1.1.2
+  - Command-line:
+    - Add '--buildtool-opt' option passing options to underlying rpmbuild to 
the 'build' command
+    - Fix 'diff' command to support diffing selected files only
+    - Identify inherited packages in the 'dependson' command output
+    - Bring the '--debug' option back to the 'buildinfo' command
+    - Fix 'buildhistory' command by setting the type of the '--limit' option 
to int
+  - Library:
+    - Fix a traceback when failed to unlock a keyring
+    - Don't retry on 400 HTTP status code in core.server_diff()
+    - Clean-up the '.old' folder if an exception happens
+    - Document 'popt' attribute in the _link template
+    - Fix build.get_repo() to return only directory that contains 
'repodata/repomd.xml'
+  - Connection:
+    - Retry on receiving the following HTTP status codes: 400, 500, 502, 503, 
504
+    - Allow disabling retry on 400 HTTP status code
+    - Fix urlgrab to skip mirrors with invalid scheme
+
 - 1.1.1
   - Command-line:
     - Fix 'creq' command that wasn't working at all
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/osc-1.1.1/osc/__init__.py 
new/osc-1.1.2/osc/__init__.py
--- old/osc-1.1.1/osc/__init__.py       2023-04-11 14:01:52.000000000 +0200
+++ new/osc-1.1.2/osc/__init__.py       2023-05-03 10:11:24.000000000 +0200
@@ -13,7 +13,7 @@
 
 
 from .util import git_version
-__version__ = git_version.get_version('1.1.1')
+__version__ = git_version.get_version('1.1.2')
 
 
 # vim: sw=4 et
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/osc-1.1.1/osc/_private/api_build.py 
new/osc-1.1.2/osc/_private/api_build.py
--- old/osc-1.1.1/osc/_private/api_build.py     2023-04-11 14:01:52.000000000 
+0200
+++ new/osc-1.1.2/osc/_private/api_build.py     2023-05-03 10:11:24.000000000 
+0200
@@ -20,7 +20,7 @@
         self.package = package
         self.repository = repository
         self.arch = arch
-        self._limit = limit
+        self._limit = int(limit)
         self.entries = self._get_entries()
 
     def _get_entries(self):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/osc-1.1.1/osc/babysitter.py 
new/osc-1.1.2/osc/babysitter.py
--- old/osc-1.1.1/osc/babysitter.py     2023-04-11 14:01:52.000000000 +0200
+++ new/osc-1.1.2/osc/babysitter.py     2023-05-03 10:11:24.000000000 +0200
@@ -36,6 +36,14 @@
         pass
 
 
+try:
+    from keyring.errors import KeyringLocked
+except ImportError:
+    # python-keyring is not installed
+    class KeyringLocked(Exception):
+        pass
+
+
 # the good things are stolen from Matt Mackall's mercurial
 
 
@@ -178,6 +186,8 @@
         print(f'{e.fname}:', e.msg, file=sys.stderr)
     except RPMError as e:
         print(e, file=sys.stderr)
+    except KeyringLocked as e:
+        print(e, file=sys.stderr)
     except CertVerificationError as e:
         print(e, file=sys.stderr)
     except urllib3.exceptions.MaxRetryError as e:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/osc-1.1.1/osc/build.py new/osc-1.1.2/osc/build.py
--- old/osc-1.1.1/osc/build.py  2023-04-11 14:01:52.000000000 +0200
+++ new/osc-1.1.2/osc/build.py  2023-05-03 10:11:24.000000000 +0200
@@ -456,30 +456,21 @@
 
 
 def get_repo(path):
-    """Walks up path looking for any repodata directories.
+    """
+    Walks up path looking for any repodata directories.
 
     :param path: path to a directory
-    :return: path to repository directory containing repodata directory
+    :return: path to repository directory containing repodata directory with 
repomd.xml file
     :rtype: str
     """
-    oldDirectory = None
-    currentDirectory = os.path.abspath(path)
-    repositoryDirectory = None
-
-    # while there are still parent directories
-    while currentDirectory != oldDirectory:
-        children = os.listdir(currentDirectory)
-
-        if "repodata" in children:
-            repositoryDirectory = currentDirectory
-            break
-
-        # ascend
-        oldDirectory = currentDirectory
-        currentDirectory = os.path.abspath(os.path.join(oldDirectory,
-                                                        os.pardir))
 
-    return repositoryDirectory
+    for root, dirs, files in os.walk(path):
+        if not "repodata" in dirs:
+            continue
+        if "repomd.xml" in os.listdir(os.path.join(root, "repodata")):
+            return root
+    return None
+
 
 
 def get_prefer_pkgs(dirs, wanted_arch, type, cpio):
@@ -1057,6 +1048,9 @@
     if opts.build_opt:
         buildargs += opts.build_opt
 
+    if opts.buildtool_opt:
+        buildargs += [f"--buildtool-opt={opt}" for opt in opts.buildtool_opt]
+
     # real arch of this machine
     # vs.
     # arch we are supposed to build for
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/osc-1.1.1/osc/commandline.py 
new/osc-1.1.2/osc/commandline.py
--- old/osc-1.1.1/osc/commandline.py    2023-04-11 14:01:52.000000000 +0200
+++ new/osc-1.1.2/osc/commandline.py    2023-05-03 10:11:24.000000000 +0200
@@ -84,10 +84,14 @@
             )
 
         # traverse the parent commands and add their options to the current 
command
+        commands = []
         cmd = self
         while cmd:
-            cmd.init_arguments()
+            commands.append(cmd)
             cmd = cmd.parent
+        # iterating backwards to give the command's options a priority over 
parent/global options
+        for cmd in reversed(commands):
+            cmd.init_arguments()
 
     def __repr__(self):
         return f"<osc plugin {self.full_name} at {self.__hash__():#x}>"
@@ -4642,9 +4646,10 @@
                 for i in pac.get_diff(rev1):
                     diff += b''.join(i)
             else:
+                files = args
                 diff += server_diff_noex(pac.apiurl, pac.prjname, pac.name, 
rev1,
                                          pac.prjname, pac.name, rev2,
-                                         not opts.plain, opts.missingok, 
opts.meta, not opts.unexpand)
+                                         not opts.plain, opts.missingok, 
opts.meta, not opts.unexpand, files=files)
         run_pager(diff)
 
     @cmdln.option('--issues-only', action='store_true',
@@ -6471,6 +6476,8 @@
 
         This is no guarantee, since the new build might have changed 
dependencies.
 
+        The packages marked with the [i] flag are inherited to the project.
+
         The arguments REPOSITORY and ARCH can be taken from the first two 
columns
         of the 'osc repos' output.
 
@@ -6515,13 +6522,15 @@
             repository = args[2]
             arch = args[3]
 
+        project_packages = meta_get_packagelist(apiurl, project, 
deleted=False, expand=False)
         xml = get_dependson(apiurl, project, repository, arch, packages, 
reverse)
 
         root = ET.fromstring(xml)
         for package in root.findall('package'):
             print(package.get('name'), ":")
             for dep in package.findall('pkgdep'):
-                print("  ", dep.text)
+                inherited = "   " if dep.text in project_packages else "[i]"
+                print(f"  {inherited} {dep.text}")
 
     @cmdln.option('--alternative-project', metavar='PROJECT',
                   help='specify the build target project')
@@ -7008,6 +7017,8 @@
                   help='define macro X with value Y')
     @cmdln.option('--build-opt', metavar='OPT', action='append',
                   help='pass option OPT to the build command')
+    @cmdln.option('--buildtool-opt', metavar='OPT', action='append',
+                  help='pass option OPT to the build tool command (rpmbuild)')
     @cmdln.option('--userootforbuild', '--login-as-root', action='store_true',
                   help='Run build or shell as root. The default is to build as 
'
                   'unprivileged user. Note that a line "# norootforbuild" '
@@ -7377,7 +7388,7 @@
 
     @cmdln.option('', '--csv', action='store_true',
                   help='generate output in CSV (separated by |)')
-    @cmdln.option('-l', '--limit', metavar='limit',
+    @cmdln.option('-l', '--limit', metavar='limit', type=int, default=0,
                         help='for setting the number of results')
     @cmdln.option('-M', '--multibuild-package', metavar='FLAVOR',
                   help=HELP_MULTIBUILD_ONE)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/osc-1.1.1/osc/connection.py 
new/osc-1.1.2/osc/connection.py
--- old/osc-1.1.1/osc/connection.py     2023-04-11 14:01:52.000000000 +0200
+++ new/osc-1.1.2/osc/connection.py     2023-05-03 10:11:24.000000000 +0200
@@ -135,12 +135,12 @@
     Turn file path into a file object and close it automatically
     by using a context manager.
     """
-    def new_func(method, url, headers=None, data=None, file=None):
+    def new_func(method, url, headers=None, data=None, file=None, 
retry_on_400: bool = True):
         if file:
             with open(file, "rb") as f:
-                return func(method, url, headers, data, file=f)
+                return func(method, url, headers, data, f, retry_on_400)
         else:
-            return func(method, url, headers, data, file)
+            return func(method, url, headers, data, file, retry_on_400)
 
     new_func.__name__ = func.__name__
     new_func.__doc__ = func.__doc__
@@ -148,7 +148,7 @@
 
 
 @http_request_wrap_file
-def http_request(method: str, url: str, headers=None, data=None, file=None):
+def http_request(method: str, url: str, headers=None, data=None, file=None, 
retry_on_400: bool = True):
     """
     Send a HTTP request to a server.
 
@@ -168,6 +168,7 @@
     :param headers: Dictionary of custom headers to send.
     :param data: Data to send in the request body (conflicts with `file`).
     :param file: Path to a file to send as data in the request body (conflicts 
with `data`).
+    :param retry_on_400: Whether to retry on receiving HTTP status code 400.
     """
 
     purl = urllib3.util.parse_url(url)
@@ -227,9 +228,24 @@
         else:
             retries_kwargs = {"method_whitelist": None}
 
+
+        status_forcelist = (
+            500,  # Internal Server Error
+            502,  # Bad Gateway
+            503,  # Service Unavailable
+            504,  # Gateway Timeout
+        )
+        if retry_on_400:
+            status_forcelist = (
+                400,  # Bad Request; retry on 400: service in progress
+            ) + status_forcelist
+
         pool_kwargs["retries"] = urllib3.Retry(
             total=int(conf.config["http_retries"]),
             backoff_factor=2,
+            status_forcelist=status_forcelist,
+            # don't raise because we want an actual response rather than a 
MaxRetryError with "too many <status_code> error responses" message
+            raise_on_status=False,
             **retries_kwargs,
         )
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/osc-1.1.1/osc/core.py new/osc-1.1.2/osc/core.py
--- old/osc-1.1.1/osc/core.py   2023-04-11 14:01:52.000000000 +0200
+++ new/osc-1.1.2/osc/core.py   2023-05-03 10:11:24.000000000 +0200
@@ -11,6 +11,7 @@
 
 
 import codecs
+import copy
 import datetime
 import difflib
 import errno
@@ -444,8 +445,10 @@
                 msg = f'"{old_dir}" exists, please remove it'
                 raise oscerr.OscIOError(None, msg)
 
-        result = self._execute(dir, old_dir, callmode, singleservice, verbose)
-        shutil.rmtree(old_dir)
+        try:
+            result = self._execute(dir, old_dir, callmode, singleservice, 
verbose)
+        finally:
+            shutil.rmtree(old_dir)
         return result
 
     def _execute(
@@ -3572,6 +3575,21 @@
     return path
 
 
+def osc_urlencode(data):
+    """
+    An urlencode wrapper that encodes dictionaries in OBS compatible way:
+    {"file": ["foo", "bar"]} -> &file[]=foo&file[]=bar
+    """
+    data = copy.deepcopy(data)
+    if isinstance(data, dict):
+        for key, value in list(data.items()):
+            if isinstance(value, list):
+                del data[key]
+                data[f"{key}[]"] = value
+
+    return urlencode(data, doseq=True)
+
+
 def makeurl(baseurl: str, l, query=None):
     """Given a list of path compoments, construct a complete URL.
 
@@ -3587,7 +3605,7 @@
     if isinstance(query, list):
         query = '&'.join(query)
     elif isinstance(query, dict):
-        query = urlencode(query)
+        query = osc_urlencode(query)
 
     scheme, netloc, path = urlsplit(baseurl)[0:3]
     return urlunsplit((scheme, netloc, '/'.join([path] + list(l)), query, ''))
@@ -5281,6 +5299,7 @@
     onlyissues=False,
     full=True,
     xml=False,
+    files: list = None,
 ):
     query: Dict[str, Union[str, int]] = {"cmd": "diff"}
     if expand:
@@ -5306,9 +5325,11 @@
         query['onlyissues'] = 1
         query['view'] = 'xml'
         query['unified'] = 0
+    if files:
+        query["file"] = files
 
     u = makeurl(apiurl, ['source', new_project, new_package], query=query)
-    f = http_POST(u)
+    f = http_POST(u, retry_on_400=False)
     if onlyissues and not xml:
         del_issue_list = []
         add_issue_list = []
@@ -5343,12 +5364,13 @@
     expand=True,
     onlyissues=False,
     xml=False,
+    files: list = None,
 ):
     try:
         return server_diff(apiurl,
                            old_project, old_package, old_revision,
                            new_project, new_package, new_revision,
-                           unified, missingok, meta, expand, onlyissues, True, 
xml)
+                           unified, missingok, meta, expand, onlyissues, True, 
xml, files=files)
     except HTTPError as e:
         msg = None
         body = None
@@ -5365,7 +5387,7 @@
                 rdiff += server_diff_noex(apiurl,
                                           old_project, old_package, 
old_revision,
                                           new_project, new_package, 
new_revision,
-                                          unified, missingok, meta, False)
+                                          unified, missingok, meta, False, 
files=files)
             except:
                 elm = ET.fromstring(body).find('summary')
                 summary = ''
@@ -5755,6 +5777,11 @@
   <!-- <apply name="patch" /> apply a patch on the source directory  -->
   <!-- <topadd>%%define build_with_feature_x 1</topadd> add a line on the top 
(spec file only) -->
   <!-- <add name="file.patch" /> add a patch to be applied after %%setup (spec 
file only) -->
+  <!-- <add name="file.patch" />
+        Add a patch to be applied after %%setup (spec file only).
+        Patch path prefix stipping can be controlled with the "popt" attribute,
+        for example ``popt="1"`` that translates to %%patch -p1.
+  -->
   <!-- <delete name="filename" /> delete a file -->
 </patches>
 </link>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/osc-1.1.1/osc/grabber.py new/osc-1.1.2/osc/grabber.py
--- old/osc-1.1.1/osc/grabber.py        2023-04-11 14:01:52.000000000 +0200
+++ new/osc-1.1.2/osc/grabber.py        2023-05-03 10:11:24.000000000 +0200
@@ -10,6 +10,8 @@
 from urllib.parse import unquote
 from urllib.error import URLError
 
+import urllib3.exceptions
+
 from .core import streamfile
 
 
@@ -37,7 +39,7 @@
             try:
                 self._grabber.urlgrab(mirror, filename, text)
                 return True
-            except (HTTPError, URLError) as e:
+            except (HTTPError, URLError, urllib3.exceptions.URLSchemeUnknown) 
as e:
                 # try next mirror
                 pass
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/osc-1.1.1/osc/util/git_version.py 
new/osc-1.1.2/osc/util/git_version.py
--- old/osc-1.1.1/osc/util/git_version.py       2023-04-11 14:01:52.000000000 
+0200
+++ new/osc-1.1.2/osc/util/git_version.py       2023-05-03 10:11:24.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.1.1"
+    version = "1.1.2"
     if version.startswith(("$", "%")):
         # "$": version hasn't been substituted during `git archive`
         # "%": "Format:" and "$" characters get removed from the version 
string (a GitHub bug?)

++++++ osc.dsc ++++++
--- /var/tmp/diff_new_pack.vARNms/_old  2023-05-05 15:57:43.392235726 +0200
+++ /var/tmp/diff_new_pack.vARNms/_new  2023-05-05 15:57:43.396235749 +0200
@@ -1,6 +1,6 @@
 Format: 1.0
 Source: osc
-Version: 1.1.1-0
+Version: 1.1.2-1
 Binary: osc
 Maintainer: Adrian Schroeter <adr...@suse.de>
 Architecture: any
@@ -9,6 +9,7 @@
     debhelper (>= 10),
     dh-python,
     python3-all (>=3.6),
+    python3-argparse-manpage,
     python3-cryptography,
     python3-setuptools,
     python3-urllib3

Reply via email to