Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package osc for openSUSE:Factory checked in at 2022-06-25 10:24:28 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/osc (Old) and /work/SRC/openSUSE:Factory/.osc.new.1548 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "osc" Sat Jun 25 10:24:28 2022 rev:163 rq:984912 version:0.180.0 Changes: -------- --- /work/SRC/openSUSE:Factory/osc/osc.changes 2022-06-03 14:16:59.617342001 +0200 +++ /work/SRC/openSUSE:Factory/.osc.new.1548/osc.changes 2022-06-25 10:24:51.170724349 +0200 @@ -1,0 +2,11 @@ +Fri Jun 24 13:33:36 UTC 2022 - Daniel Mach <daniel.m...@suse.com> + +- 0.180.0 + - warn when trying to commit a prj/pac managed in scm + - fix crash on "osc up" for git based package/projects + - don't traceback on invalid credentials manager + - improve README, rename it to README.md + - declare OscHTTPSignatureAuthHandler as a new-style class + - remove illegal character in comment + +------------------------------------------------------------------- Old: ---- osc-0.179.0.tar.gz New: ---- osc-0.180.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ osc.spec ++++++ --- /var/tmp/diff_new_pack.tZKB3Z/_old 2022-06-25 10:24:51.962725479 +0200 +++ /var/tmp/diff_new_pack.tZKB3Z/_new 2022-06-25 10:24:51.970725491 +0200 @@ -27,7 +27,7 @@ %define use_python python %endif -%define version_unconverted 0.179.0 +%define version_unconverted 0.180.0 %define osc_plugin_dir %{_prefix}/lib/osc-plugins %define macros_file macros.osc %if ! %{defined _rpmmacrodir} @@ -35,7 +35,7 @@ %endif Name: osc -Version: 0.179.0 +Version: 0.180.0 Release: 0 Summary: Open Build Service Commander License: GPL-2.0-or-later @@ -192,9 +192,9 @@ %defattr(-,root,root,-) %if 0%{?suse_version} >= 1500 %license COPYING -%doc AUTHORS README TODO NEWS +%doc AUTHORS README.md TODO NEWS %else -%doc AUTHORS README TODO NEWS COPYING +%doc AUTHORS README.md TODO NEWS COPYING %endif %{_bindir}/osc* %{python_sitelib}/* ++++++ PKGBUILD ++++++ --- /var/tmp/diff_new_pack.tZKB3Z/_old 2022-06-25 10:24:51.998725531 +0200 +++ /var/tmp/diff_new_pack.tZKB3Z/_new 2022-06-25 10:24:52.002725536 +0200 @@ -1,5 +1,5 @@ pkgname=osc -pkgver=0.179.0 +pkgver=0.180.0 pkgrel=0 pkgdesc="Open Build Service client" arch=('x86_64') ++++++ _service ++++++ --- /var/tmp/diff_new_pack.tZKB3Z/_old 2022-06-25 10:24:52.022725565 +0200 +++ /var/tmp/diff_new_pack.tZKB3Z/_new 2022-06-25 10:24:52.026725571 +0200 @@ -1,7 +1,7 @@ <services> <service name="tar_scm" mode="disabled"> - <param name="version">0.179.0</param> - <param name="revision">0.179.0</param> + <param name="version">0.180.0</param> + <param name="revision">0.180.0</param> <param name="url">https://github.com/openSUSE/osc.git</param> <param name="scm">git</param> </service> ++++++ debian.changelog ++++++ --- /var/tmp/diff_new_pack.tZKB3Z/_old 2022-06-25 10:24:52.066725627 +0200 +++ /var/tmp/diff_new_pack.tZKB3Z/_new 2022-06-25 10:24:52.070725633 +0200 @@ -1,4 +1,4 @@ -osc (0.179.0-0) unstable; urgency=low +osc (0.180.0-0) unstable; urgency=low - Update to 0.174.0: - fix password deletion via "osc config -d <apiurl> pass" - support changing the password store via "osc config <apiurl> ++++++ debian.docs ++++++ --- /var/tmp/diff_new_pack.tZKB3Z/_old 2022-06-25 10:24:52.142725736 +0200 +++ /var/tmp/diff_new_pack.tZKB3Z/_new 2022-06-25 10:24:52.146725742 +0200 @@ -1,3 +1,3 @@ -README +README.md TODO ++++++ osc-0.179.0.tar.gz -> osc-0.180.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/osc-0.179.0/.gitattributes new/osc-0.180.0/.gitattributes --- old/osc-0.179.0/.gitattributes 1970-01-01 01:00:00.000000000 +0100 +++ new/osc-0.180.0/.gitattributes 2022-06-24 15:23:26.000000000 +0200 @@ -0,0 +1,2 @@ +osc/util/git_version.py export-subst + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/osc-0.179.0/.github/workflows/unittests.yaml new/osc-0.180.0/.github/workflows/unittests.yaml --- old/osc-0.179.0/.github/workflows/unittests.yaml 1970-01-01 01:00:00.000000000 +0100 +++ new/osc-0.180.0/.github/workflows/unittests.yaml 2022-06-24 15:23:26.000000000 +0200 @@ -0,0 +1,86 @@ +name: 'unit tests' + +on: + push: + branches: ['master'] + pull_request: + branches: ['master'] + +jobs: + test: + name: 'unit tests' + runs-on: 'ubuntu-latest' + strategy: + fail-fast: false + matrix: + # Testing per python-version using actions/setup-python is not possible, + # because rpm doesn't exist on pypi and cannot be installed via pip on ubuntu. + # That's why we're going to test on the target distros directly. + container: + + # Fedora + - 'fedora:36' + - 'fedora:rawhide' + + # OpenSUSE + # leap < 15.2 doesn't contain git-lfs which causes actions/checkout to fail + - 'opensuse/leap:15.2' + - 'opensuse/leap:15.3' + - 'opensuse/leap:15.4' + - 'opensuse/tumbleweed' + + # CentOS Stream + # stream9 doesn't contain m2crypto required by osc + # - 'quay.io/centos/centos:stream9' + + # Debian + - 'debian:stable' + - 'debian:unstable' + + # Ubuntu + - 'ubuntu:latest' + + container: + image: ${{ matrix.container }} + + steps: + - name: 'Install packages (OpenSUSE)' + if: ${{ startsWith(matrix.container, 'opensuse/') }} + run: | + zypper --non-interactive --gpg-auto-import-keys refresh + zypper --non-interactive dist-upgrade + zypper --non-interactive install git-lfs + zypper --non-interactive install diffstat diffutils python3 python3-chardet python3-M2Crypto python3-pip python3-rpm python3-setuptools + + - name: 'Install packages (Fedora/CentOS)' + if: ${{ startsWith(matrix.container, 'fedora:') || contains(matrix.container, 'centos:') }} + run: | + dnf -y makecache + dnf -y distro-sync + dnf -y install git-lfs + dnf -y install diffstat diffutils python3 python3-chardet python3-m2crypto python3-pip python3-rpm python3-setuptools + + - name: 'Install packages (Debian/Ubuntu)' + if: ${{ startsWith(matrix.container, 'debian:') || startsWith(matrix.container, 'ubuntu:') }} + run: | + apt-get -y update + apt-get -y upgrade + apt-get -y --no-install-recommends install git-lfs + apt-get -y --no-install-recommends install diffstat diffutils python3 python3-chardet python3-m2crypto python3-pip python3-rpm python3-setuptools + + - uses: actions/checkout@v3 + + - name: 'Run unit tests' + run: | + pip3 install -e . + python3 setup.py test + + - name: 'Generate coverage reports (OpenSUSE Tumbleweed)' + if: ${{ matrix.container == 'opensuse/tumbleweed' }} + run: | + zypper --non-interactive install python3-pytest python3-pytest-cov + pytest --cov=osc + + - name: 'Upload coverage reports to Codecov (OpenSUSE Tumbleweed)' + if: ${{ matrix.container == 'opensuse/tumbleweed' }} + uses: codecov/codecov-action@v3 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/osc-0.179.0/NEWS new/osc-0.180.0/NEWS --- old/osc-0.179.0/NEWS 2022-06-02 17:18:52.000000000 +0200 +++ new/osc-0.180.0/NEWS 2022-06-24 15:23:26.000000000 +0200 @@ -1,3 +1,11 @@ +0.180.0 + - warn when trying to commit a prj/pac managed in scm + - fix crash on "osc up" for git based package/projects + - don't traceback on invalid credentials manager + - improve README, rename it to README.md + - declare OscHTTPSignatureAuthHandler as a new-style class + - remove illegal character in comment + 0.179.0 - signature (ssh key) authetication fixes (RSA key support, skip binary files) - commandline: handle calls without arguments gracefully diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/osc-0.179.0/README new/osc-0.180.0/README --- old/osc-0.179.0/README 2022-06-02 17:18:52.000000000 +0200 +++ new/osc-0.180.0/README 1970-01-01 01:00:00.000000000 +0100 @@ -1,262 +0,0 @@ -osc -- opensuse-commander with svn like handling - - -Patches can be submitted via - * mail to opensuse-buildserv...@opensuse.org - * Bugzilla: https://bugzilla.opensuse.org/enter_bug.cgi?product=openSUSE.org&component=BuildService - * or the official Git repository on Github: - https://github.com/openSUSE/osc - - -INSTALLATION: - -RPM packages are here (rpm-md repository): -http://download.opensuse.org/repositories/openSUSE:/Tools/ - -To install from git, do - - python setup.py build - python setup.py install - # create a symlink 'osc' in your path pointing to osc.py. - ln -s osc-wrapper.py /usr/bin/osc - -Alternatively, you can directly use osc-wrapper.py from the source dir -(which is easier if you develop on osc). - - - -CONFIGURATION: - -When you use it for the first time, it will ask you for your username and -password, and store it in ~/.oscrc. - - -CONFIGURATION MIGRATION (only affects versions >= 0.114): - -Version 0.114 got some cleanups for the configfile handling and therefore some -options are now deprecated, namely: -* apisrv -* scheme - -One new option was added: -* apiurl = <protocol>://<somehost> # use this as the default apiurl. If this -option isn't specified the default (https://api.opensuse.org) is used. - -So far osc still has some backward compatibility for these options but it might -get removed in the future that's why it issues a deprecation warning in case -one of those options is still in use. - -The new configuration scheme looks like the following: - # entry for an apiurl - [<protocol>://<apiurl>] - user = <username> - password = <password> - ... - -'''Before starting the migration please save your ~/.oscrc file!''' - -If the migration doesn't work for whatever reason feel free to send me an email -or ask on the opensuse-buildservice mailinglist or in the #opensuse-buildservice -irc channel. - -=== Migration case I (apisrv only) === -The apisrv option is used to specify the default apihost. If apisrv isn't -specified at all the default ("api.opensuse.org") is used. -The current [general] section looks like this: - [general] - ... - apisrv = <somehost> - # or - apisrv = <protocol>://<somehost> - -apisrv got superseded by the new apiurl option which looks like this: - [general] - ... - apiurl = <protocol>://<somehost> - -If apisrv has no "<protocol>" https is used. Make sure all apiurl sections have -the new format which is described above. Afterwards apisrv can be removed. - -=== Migration case II (scheme only) === -The current [general] section looks like this: - [general] - ... - scheme = <protocol> - -This means every apiurl section which don't have the new format which is -described above for instance - [<somehost>] - user = <username> - password = <password> - ... - -has to be converted to - [<protocol>://<somehost>] - user = <username> - password = <password> - ... - -Afterwards the scheme option can be removed from the [general] section (it -might be the case that some sections already have the correct format). - -=== Migration case III (apisrv and scheme) === -The current [general] section looks like this: - [general] - ... - apisrv = <somehost> - scheme = <protocol> - -Both options can be removed if all apiurl sections have the new format which is -described above. So basically just adjust all apiurl sections (it might be the -case that some sections already have the correct format). - - -KEYRING USAGE - -Osc now can store passwords in keyrings instead of ~/.oscrc. To use it, -you need python-keyring and either python-keyring-kde or -gnome. - -If you want to switch to using a keyring you need to delete apiurl section -from ~/.oscrc and you will be asked for credentials again, which will be then -stored in the keyring application. - - -WORKING COPY INCONSISTENT (only affects version >= 0.130) - -osc's working copy handling was rewritten in 0.130. Thus some -consistency checks were added. As a result osc might complain -that some old working copies are in an inconsistent state: - Your working copy '.' is in an inconsistent state. - Please run 'osc repairwc .' (Note this might _remove_ - files from the .osc/ dir). Please check the state - of the working copy afterwards (via 'osc status .') -To fix this simply run "osc repairwc ." as suggested in the -error message. Note that "osc repairwc ." might need to contact -the api in order to fetch some missing files. Also it might remove -some files from the storedir (.osc/) but it won't touch any locally -modified files. -If it DOES NOT fix the problem please create a bug report and attach -your working copy to the bug (if possible). - - -USAGE EXAMPLES: -(online at http://en.opensuse.org/openSUSE:OSC ) - -To list existing content on the server - osc ls # list projects - osc ls Apache # list packages in a project - osc ls Apache subversion # list files of package of a project - -Check out content - osc co Apache # entire project - osc co Apache subversion # a package - osc co Apache subversion foo # single file - -Update a working copy - osc up - osc up [pac_dir] # update a single package by its path - osc up * # from within a project dir, update all packages - osc up # from within a project dir, update all packages - # AND check out all newly added packages - -If an update can't be merged automatically, a file is in 'C' (conflict) -state, and conflicts are marked with special <<<<<<< and >>>>>>> lines. -After manually resolving the problem, use - osc resolved foo - -Upload change content - osc ci # current dir - osc ci <dir> - osc ci file1 file2 ... - -Show the status (which files have been changed locally) - osc st - osc st <directory> - osc st file1 file2 ... - -Mark files to be added or removed on the next 'checkin' - osc add file1 file2 ... - osc rm file1 file2 ... - -Adds all new files in local copy and removes all disappeared files. - osc addremove - -Generates a diff, to view the changes - osc diff # current dir - osc diff file1 file2 ... - -Shows the build results of the package - osc results - osc results [repository] - -Shows the log file of a package (you need to be inside a package directory) - osc log <repository> <arch> - -Shows the URLs of .repo files which are packages sources for Yum/YaST/smart - osc repourls [dir] - -Triggers a package rebuild for all repositories/architectures of a package - osc rebuildpac [dir] - -Shows available repository/build targets - osc repository - -Shows the configured repository/build targets of a project - osc repository <project> - -Shows meta information - osc meta Apache - osc meta Apache subversion - osc id username - -Edit meta information -(Creates new package/project if it doesn't exist) - osc editmeta Apache - osc editmeta Apache subversion - -Update package meta data with metadata taken from spec file - osc updatepacmetafromspec <dir> - - -There are other commands, which you may not need (they may be useful in scripts): - osc repos - osc buildconfig - osc buildinfo - - -Locally build a package (see 'osc help build' for more info): - osc build <repo> <arch> specfile [--clean|--noinit] - - -Update a package to a different sources (directory foo_package_source): - cp -a foo_package_source foo; cd foo; osc init <prj> <pac>; osc addremove; osc ci; cd $OLDPWD; rm -r foo - - - -HINT FOR W3M USERS - -Putting the following in the file ~/.w3m/passwd will make -w3m know the credentials for the buildservice servers: - -""" -host api.opensuse.org - port 80 - realm Authentication required - login foo - password bar - -host build.opensuse.org - port 80 - realm openSUSE Build Service - login foo - password bar -""" - -chmod 0600 ~/.w3m/passwd - - -NOTES about the testsuite - -A new test suite has been created and should run via doing -# ./setup.py test - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/osc-0.179.0/README.md new/osc-0.180.0/README.md --- old/osc-0.179.0/README.md 1970-01-01 01:00:00.000000000 +0100 +++ new/osc-0.180.0/README.md 2022-06-24 15:23:26.000000000 +0200 @@ -0,0 +1,179 @@ +[](https://github.com/openSUSE/osc/actions/workflows/unittests.yaml) +[](https://codecov.io/gh/openSUSE/osc) +[](https://codeclimate.com/github/openSUSE/osc) +[](https://github.com/openSUSE/osc/graphs/contributors) + + +# openSUSE Commander + +OpenSUSE Commander (osc) is a command-line interface to the +[Open Build Service (OBS)](https://github.com/openSUSE/open-build-service/). + + +## Installation + +RPM packages are available in the [openSUSE:Tools](http://download.opensuse.org/repositories/openSUSE:/Tools/) repository. + + zypper addrepo --repo http://download.opensuse.org/repositories/openSUSE:/Tools/openSUSE_Tumbleweed/openSUSE:Tools.repo + zypper install osc + +To install from git, do + + ./setup.py build + ./setup.py install + # create a symlink `osc` in your path pointing to osc-wrapper.py. + ln -s osc-wrapper.py /usr/local/bin/osc + +Alternatively, you can directly use `./osc-wrapper.py` from the source directory, +which is easier if you develop on osc. + + +## Configuration + +When you use osc for the first time, it will ask you for your username and +password, and store it in `~/.config/osc/oscrc`. + + +## Keyrings + +Osc can store passwords in keyrings instead of `~/.config/osc/oscrc`. +To use them, you need python3-keyring with a backend of your choice installed: + - kwalletd5 (A pasword manager for KDE) + - secrets (A password manager for GNOME) + - python3-keyring-keyutils (A python-keyring backend for the kernel keyring) + +If you want to switch to using a keyring you need to delete apiurl section +from `~/.config/osc/oscrc` and you will be asked for credentials again, +which will be then stored in the keyring application. + + +## Usage + +For more details please check the [openSUSE wiki](https://en.opensuse.org/openSUSE:OSC). + +To list existing content on the server + + osc ls # list projects + osc ls Apache # list packages in a project + osc ls Apache subversion # list files of package of a project + +Check out content + + osc co Apache # entire project + osc co Apache subversion # a package + osc co Apache subversion foo # single file + +Update a working copy + + osc up + osc up [pac_dir] # update a single package by its path + osc up * # from within a project dir, update all packages + osc up # from within a project dir, update all packages + # AND check out all newly added packages + +If an update can't be merged automatically, a file is in `C` (conflict) +state, and conflicts are marked with special `<<<<<<<` and `>>>>>>>` lines. +After manually resolving the problem, use + + osc resolved foo + +Upload change content + + osc ci # current dir + osc ci <dir> + osc ci file1 file2 ... + +Show the status (which files have been changed locally) + + osc st + osc st <directory> + osc st file1 file2 ... + +Mark files to be added or removed on the next 'checkin' + + osc add file1 file2 ... + osc rm file1 file2 ... + +Adds all new files in local copy and removes all disappeared files + + osc addremove + +Generates a diff, to view the changes + + osc diff # current dir + osc diff file1 file2 ... + +Shows the build results of the package + + osc results + osc results [repository] + +Shows the log file of a package (you need to be inside a package directory) + + osc log <repository> <arch> + +Shows the URLs of .repo files which are packages sources for Yum/YaST/smart + + osc repourls [dir] + +Triggers a package rebuild for all repositories/architectures of a package + + osc rebuildpac [dir] + +Shows available repository/build targets + + osc repository + +Shows the configured repository/build targets of a project + + osc repository <project> + +Shows meta information + + osc meta Apache + osc meta Apache subversion + osc id username + +Edit meta information +(Creates new package/project if it doesn't exist) + + osc editmeta Apache + osc editmeta Apache subversion + +Update package meta data with metadata taken from spec file + + osc updatepacmetafromspec <dir> + +There are other commands, which you may not need (they may be useful in scripts) + + osc repos + osc buildconfig + osc buildinfo + +Locally build a package (see 'osc help build' for more info) + + osc build <repo> <arch> specfile [--clean|--noinit] + +Update a package to a different sources (directory foo_package_source) + + cp -a foo_package_source foo + cd foo + osc init <prj> <pac> + osc addremove + osc ci + cd $OLDPWD + rm -r foo + + +## Contributing + +Report [issues](https://github.com/openSUSE/osc/issues) +or submit [pull-requests](https://github.com/openSUSE/osc/pulls) +to the [osc](https://github.com/openSUSE/osc/issues) project on GitHub. + + +## Testing + +Unit tests can be run from a git checkout by executing + + ./setup.py test diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/osc-0.179.0/osc/commandline.py new/osc-0.180.0/osc/commandline.py --- old/osc-0.179.0/osc/commandline.py 2022-06-02 17:18:52.000000000 +0200 +++ new/osc-0.180.0/osc/commandline.py 2022-06-24 15:23:26.000000000 +0200 @@ -5015,10 +5015,16 @@ skip_local_service_run = False if not conf.config['local_service_run'] or opts.skip_local_service_run: skip_local_service_run = True - arg_list = args[:] - for arg in arg_list: + + for arg in args.copy(): if conf.config['do_package_tracking'] and is_project_dir(arg): prj = Project(arg) + + if prj.scm_url: + print("WARNING: Skipping project '{}' because it is managed in scm (git): {}".format(prj.name, prj.scm_url)) + args.remove(arg) + continue + if not msg and not opts.no_message: msg = edit_message() @@ -5037,6 +5043,12 @@ pacs, no_pacs = findpacs(args, fatal=False) + for pac in pacs.copy(): + if pac.scm_url: + print("WARNING: Skipping package '{}' because it is managed in scm (git): {}".format(pac.name, pac.scm_url)) + pacs.remove(pac) + continue + if conf.config['do_package_tracking'] and (pacs or no_pacs): prj_paths = {} single_paths = [] @@ -5164,6 +5176,9 @@ for arg in arg_list: if is_project_dir(arg): prj = Project(arg, progress_obj=self.download_progress) + if prj.scm_url: + print("Please use git to update project", prj.name) + continue if conf.config['do_package_tracking']: prj.update(expand_link=opts.expand_link, @@ -5225,6 +5240,9 @@ # 'copy has local modifications.\nPlease revert/commit them ' \ # 'and try again.' # sys.exit(1) + if p.scm_url: + print("Please use git to update package", p.name) + continue if not rev: if opts.expand_link: @@ -9320,7 +9338,7 @@ opts.no_echo = True opts.prompt = True opts.select_password_store = True - prompt_value = 'Password: ' + prompt_value = 'Password : ' if len(args) != 1: raise oscerr.WrongArgs('--change-password only needs the apiurl') args = [args[0], 'pass'] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/osc-0.179.0/osc/conf.py new/osc-0.180.0/osc/conf.py --- old/osc-0.179.0/osc/conf.py 2022-06-02 17:18:52.000000000 +0200 +++ new/osc-0.180.0/osc/conf.py 2022-06-24 15:23:26.000000000 +0200 @@ -554,7 +554,7 @@ self.retried = 0 return response - class OscHTTPSignatureAuthHandler(BaseHandler): + class OscHTTPSignatureAuthHandler(BaseHandler, object): def __init__(self, user, sshkey): super(self.__class__, self).__init__() self.user = user @@ -1146,7 +1146,7 @@ else: api_host_options[apiurl]['trusted_prj'] = [] - # ?????? This option is experimental and may be removed at any time in the future! + # This option is experimental and may be removed at any time in the future! # This allows overriding the download url for an OBS instance to specify a closer mirror # or proxy system, which can greatly improve download performance, latency and more. # For example, this can use https://github.com/Firstyear/opensuse-proxy-cache in a local diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/osc-0.179.0/osc/core.py new/osc-0.180.0/osc/core.py --- old/osc-0.179.0/osc/core.py 2022-06-02 17:18:52.000000000 +0200 +++ new/osc-0.180.0/osc/core.py 2022-06-24 15:23:26.000000000 +0200 @@ -5,7 +5,10 @@ from __future__ import print_function -__version__ = '0.179' + +from .util import git_version +__version__ = git_version.get_version('0.180.0') + # __store_version__ is to be incremented when the format of the working copy # "store" changes in an incompatible way. Please add any needed migration diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/osc-0.179.0/osc/credentials.py new/osc-0.180.0/osc/credentials.py --- old/osc-0.179.0/osc/credentials.py 2022-06-02 17:18:52.000000000 +0200 +++ new/osc-0.180.0/osc/credentials.py 2022-06-24 15:23:26.000000000 +0200 @@ -413,7 +413,12 @@ creds_mgr_cls = config_entry options = None mod, cls = creds_mgr_cls.rsplit('.', 1) - return getattr(importlib.import_module(mod), cls).create(cp, options) + try: + creds_mgr = getattr(importlib.import_module(mod), cls).create(cp, options) + except ModuleNotFoundError: + msg = "Invalid credentials_mgr_class: {}".format(creds_mgr_cls) + raise oscerr.ConfigError(msg, conf.config['conffile']) + return creds_mgr def qualified_name(obj): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/osc-0.179.0/osc/util/git_version.py new/osc-0.180.0/osc/util/git_version.py --- old/osc-0.179.0/osc/util/git_version.py 1970-01-01 01:00:00.000000000 +0100 +++ new/osc-0.180.0/osc/util/git_version.py 2022-06-24 15:23:26.000000000 +0200 @@ -0,0 +1,79 @@ +import os +import subprocess + + +def get_git_archive_version(): + """ + Return version that is set by git during `git archive`. + The returned format is equal to what `git describe --tags` returns. + """ + # the `version` variable contents get substituted during `git archive` + # it requires adding this to .gitattributes: <path to this file> export-subst + version = "$Format:%(describe:tags=true)$" + if version.startswith("$"): + # version hasn't been substituted during `git archive` + return None + return version + + +def get_git_version(): + """ + Determine version from git repo by calling `git describe --tags`. + """ + cmd = ["git", "describe", "--tags"] + # run the command from the place where this file is placed + # to ensure that we're in a git repo + cwd = os.path.dirname(__file__) + try: + proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=cwd) + except OSError: + # `git` command not found + return None + stdout, _ = proc.communicate() + + if proc.returncode != 0: + return None + + version = stdout.strip().decode("utf-8") + return version + + +def get_version(version): + """ + Get the most relevant version of the software: + 1. the version set during `git archive` + 2. the version from the git tags by calling `git describe --tags` + 3. the version explicitly specified in the source code + + The version conforms PEP 440. + """ + # use version from the archive + git_version = get_git_archive_version() + + # use version from the git repo + if not git_version: + git_version = get_git_version() + + # unable to determine version from git + if not git_version: + return version + + if "-" not in git_version: + git_tag = git_version + git_commits = None + git_hash = None + else: + git_tag, git_commits, git_hash = git_version.rsplit("-", 2) + git_commits = int(git_commits) + # remove the 'g' prefix from hash + git_hash = git_hash[1:] + + if version and git_tag != version: + msg = "Git tag '{}' doesn't correspond with version '{}' specified in the source code".format(git_tag, version) + raise ValueError(msg) + + result = git_tag + if git_hash: + result += "+{}.git.{}".format(git_commits, git_hash) + + return result diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/osc-0.179.0/setup.py new/osc-0.180.0/setup.py --- old/osc-0.179.0/setup.py 2022-06-02 17:18:52.000000000 +0200 +++ new/osc-0.180.0/setup.py 2022-06-24 15:23:26.000000000 +0200 @@ -61,8 +61,17 @@ data_files = [] data_files.append((os.path.join('share', 'man', 'man1'), ['osc.1.gz'])) -with open("README") as fh: - long_description = fh.read() +with open("README.md") as fh: + lines = fh.readlines() + while lines: + line = lines[0].strip() + if not line or line.startswith("["): + # skip leading empty lines + # skip leading lines with links to badges + lines.pop(0) + continue + break + long_description = "".join(lines) cmdclass = { 'build': build_osc, ++++++ osc.dsc ++++++ --- /var/tmp/diff_new_pack.tZKB3Z/_old 2022-06-25 10:24:52.434726153 +0200 +++ /var/tmp/diff_new_pack.tZKB3Z/_new 2022-06-25 10:24:52.438726159 +0200 @@ -1,6 +1,6 @@ Format: 1.0 Source: osc -Version: 0.179.0-0 +Version: 0.180.0-0 Binary: osc Maintainer: Adrian Schroeter <adr...@suse.de> Architecture: any