Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package opi for openSUSE:Factory checked in 
at 2025-04-22 17:29:54
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/opi (Old)
 and      /work/SRC/openSUSE:Factory/.opi.new.30101 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "opi"

Tue Apr 22 17:29:54 2025 rev:68 rq:1271861 version:5.8.3

Changes:
--------
--- /work/SRC/openSUSE:Factory/opi/opi.changes  2025-03-12 20:14:16.648917747 
+0100
+++ /work/SRC/openSUSE:Factory/.opi.new.30101/opi.changes       2025-04-22 
17:30:30.040670516 +0200
@@ -1,0 +2,14 @@
+Tue Apr 22 11:55:21 UTC 2025 - Dominik Heidler <dheid...@suse.de>
+
+- Version 5.8.3
+  * Install dependencies rpm-build and squashfs at runtime if needed
+  * Drop DNF support
+
+-------------------------------------------------------------------
+Tue Apr 22 08:08:48 UTC 2025 - Dominik Heidler <dheid...@suse.de>
+
+- Version 5.8.2
+  * Warn about adding staging repos
+  * Gracefully handle zypper exit code 106 (repos without cache present)
+
+-------------------------------------------------------------------

Old:
----
  opi-5.8.1.tar.gz

New:
----
  opi-5.8.3.tar.gz

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

Other differences:
------------------
++++++ opi.spec ++++++
--- /var/tmp/diff_new_pack.Jm8jMM/_old  2025-04-22 17:30:30.584693368 +0200
+++ /var/tmp/diff_new_pack.Jm8jMM/_new  2025-04-22 17:30:30.584693368 +0200
@@ -20,7 +20,7 @@
 %define pythons %{use_python}
 
 Name:           opi
-Version:        5.8.1
+Version:        5.8.3
 Release:        0
 Summary:        OBS Package Installer (CLI)
 License:        GPL-3.0-only
@@ -56,8 +56,8 @@
 Requires:       python3-termcolor
 Requires:       zypper
 # for rpm building and snap extracting
-Requires:       rpm-build
-Requires:       squashfs
+Recommends:     rpm-build
+Recommends:     squashfs
 
 %description
 OBS Package Installer (CLI)

++++++ opi-5.8.1.tar.gz -> opi-5.8.3.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/opi-5.8.1/README.md new/opi-5.8.3/README.md
--- old/opi-5.8.1/README.md     2025-03-12 12:07:57.000000000 +0100
+++ new/opi-5.8.3/README.md     2025-04-22 13:55:13.000000000 +0200
@@ -61,16 +61,6 @@
 
 Change the config by editing the content of `/etc/opi.cfg`.
 
-#### Using DNF instead of Zypper
-
-If you want to, you can use [DNF](https://en.opensuse.org/SDB:DNF) instead of 
Zypper.
-
-```cfg
-backend = dnf
-```
-
-If you want to go back to Zypper, just change the value of `backend` back to 
`zypp`.
-
 #### Disabling auto-refresh for new repositories
 
 If you want to, you can disable auto-refreshing of new repositories.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/opi-5.8.1/bin/opi new/opi-5.8.3/bin/opi
--- old/opi-5.8.1/bin/opi       2025-03-12 12:07:57.000000000 +0100
+++ new/opi-5.8.3/bin/opi       2025-04-22 13:55:13.000000000 +0200
@@ -6,7 +6,7 @@
 import argparse
 import textwrap
 import subprocess
-from termcolor import colored
+from termcolor import colored, cprint
 
 sys.path.insert(0, os.path.abspath(os.path.dirname(__file__) + '/..'))
 import opi
@@ -91,19 +91,28 @@
                print('You have selected package:', 
opi.format_pkg_option(selected_pkg, table=False))
                if isinstance(selected_pkg, opi.OBSPackage):
                        if selected_pkg.is_from_personal_project():
-                               print(colored(
+                               cprint(
                                        'BE CAREFUL! The package is from a 
personal repository and NOT reviewed by others.\n'
                                        'You can ask the author to submit the 
package to development projects and openSUSE:Factory.\n'
                                        'Learn more at 
https://en.opensuse.org/openSUSE:How_to_contribute_to_Factory',
                                        'red'
-                               ))
+                               )
                        elif selected_pkg.project == 'openSUSE:Factory':
-                               print(opi.colored(
+                               cprint(
                                        'BE CAREFUL! You are about to add the 
Factory Repository.\n'
                                        'This repo contains the unreleased 
Tumbleweed distro before openQA tests have been run.\n'
                                        'Only proceed if you know what you are 
doing!',
                                        'yellow'
-                               ))
+                               )
+                               if not opi.ask_yes_or_no('Do you want to 
continue?', default_answer='n'):
+                                       return
+                       elif 
selected_pkg.project.startswith('openSUSE:Factory:Staging'):
+                               cprint(
+                                       'BE CAREFUL! You are about to add a 
Factory Staging Repository.\n'
+                                       'This repo is used to test submissions 
to the Factory repo (the unreleased Tumbleweed distro before openQA tests have 
been run).\n'
+                                       'Only proceed if you know what you are 
doing!',
+                                       'yellow'
+                               )
                                if not opi.ask_yes_or_no('Do you want to 
continue?', default_answer='n'):
                                        return
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/opi-5.8.1/opi/__init__.py 
new/opi-5.8.3/opi/__init__.py
--- old/opi-5.8.1/opi/__init__.py       2025-03-12 12:07:57.000000000 +0100
+++ new/opi-5.8.3/opi/__init__.py       2025-04-22 13:55:13.000000000 +0200
@@ -11,9 +11,8 @@
 import lxml.etree
 import rpm
 
-from termcolor import colored
+from termcolor import colored, cprint
 
-from opi.backends import get_backend, BackendConstants
 from opi import pager
 from opi import config
 from opi.state import global_state
@@ -225,11 +224,17 @@
                                continue
                        search_results[repo_alias].append({'version': version, 
'release': release, 'arch': arch})
        except subprocess.CalledProcessError as e:
-               if e.returncode != 104:
+               if e.returncode == 104:
                        # 104 ZYPPER_EXIT_INF_CAP_NOT_FOUND is returned if 
there are no results
-                       if e.returncode == 7:
-                               # 7 ZYPPER_EXIT_ZYPP_LOCKED - error is already 
printed by zypper
-                               sys.exit(1)
+                       pass
+               elif e.returncode == 7:
+                       # 7 ZYPPER_EXIT_ZYPP_LOCKED - error is already printed 
by zypper
+                       sys.exit(1)
+               elif e.returncode == 106:
+                       # 106 - ZYPPER_EXIT_INF_REPOS_SKIPPED - some repos have 
no cache
+                       cprint("Warning: The repos listed above have no local 
cache and will be ignored for this query.", 'yellow')
+                       cprint("         Run 'zypper refresh' as root to fix 
this.", 'yellow')
+               else:
                        raise # TODO: don't exit program, use exception that 
will be handled in repo_query except block
 
        repos_by_alias = {repo.alias: repo for repo in get_repos()}
@@ -307,13 +312,10 @@
 
 def refresh_repos(repo_alias=None, auto_import_keys=False):
        refresh_cmd = []
-       if get_backend() == BackendConstants.zypp:
-               refresh_cmd = ['sudo', 'zypper']
-               if auto_import_keys:
-                       refresh_cmd.append('--gpg-auto-import-keys')
-               refresh_cmd.append('ref')
-       elif get_backend() == BackendConstants.dnf:
-               refresh_cmd = ['sudo', 'dnf', 'ref']
+       refresh_cmd = ['sudo', 'zypper']
+       if auto_import_keys:
+               refresh_cmd.append('--gpg-auto-import-keys')
+       refresh_cmd.append('ref')
        if repo_alias:
                refresh_cmd.append(repo_alias)
        subprocess.call(refresh_cmd)
@@ -356,40 +358,27 @@
 def dist_upgrade(**kwargs):
        pkgmgr_action('dup', **kwargs)
 
-def pkgmgr_action(action, packages=[], from_repo=None, 
allow_vendor_change=False, allow_arch_change=False, allow_downgrade=False, 
allow_name_change=False, allow_unsigned=False):
-       if get_backend() == BackendConstants.zypp:
-               args = ['sudo', 'zypper']
-               if global_state.arg_non_interactive:
-                       args.append('-n')
-               if allow_unsigned:
-                       args.append('--no-gpg-checks')
-               args.append(action)
-               if from_repo:
-                       args.extend(['--from', from_repo])
-               if allow_downgrade:
-                       args.append('--allow-downgrade')
-               if allow_arch_change:
-                       args.append('--allow-arch-change')
-               if allow_name_change:
-                       args.append('--allow-name-change')
-               if allow_vendor_change:
-                       args.append('--allow-vendor-change')
-               if action == 'in':
-                       args.append('--oldpackage')
-       elif get_backend() == BackendConstants.dnf:
-               args = ['sudo', 'dnf']
-               if global_state.arg_non_interactive:
-                       args.append('-y')
-               args.append(action)
-               if from_repo:
-                       args.extend(['--repo', from_repo])
-               # allow_downgrade and allow_name_change are default in DNF
-               if allow_vendor_change:
-                       args.append('--setopt=allow_vendor_change=True')
-               if allow_unsigned:
-                       args.append('--nogpgcheck')
-       else:
-               raise Exception(f"Unknown Backend: {get_backend()}")
+def pkgmgr_action(action, packages=[], from_repo=None, 
allow_vendor_change=False, allow_arch_change=False, allow_downgrade=False, 
allow_name_change=False, allow_unsigned=False, no_recommends=False, 
non_interactive=False):
+       args = ['sudo', 'zypper']
+       if global_state.arg_non_interactive or non_interactive:
+               args.append('-n')
+       if allow_unsigned:
+               args.append('--no-gpg-checks')
+       args.append(action)
+       if from_repo:
+               args.extend(['--from', from_repo])
+       if allow_downgrade:
+               args.append('--allow-downgrade')
+       if allow_arch_change:
+               args.append('--allow-arch-change')
+       if allow_name_change:
+               args.append('--allow-name-change')
+       if allow_vendor_change:
+               args.append('--allow-vendor-change')
+       if action == 'in':
+               args.append('--oldpackage')
+               if no_recommends:
+                       args.append('--no-recommends')
        args.extend(packages)
        subprocess.call(args)
 
@@ -736,10 +725,7 @@
 def ask_keep_repo(repo_alias):
        if not ask_yes_or_no(f"Do you want to keep the repo '{repo_alias}'?"):
                repo = next((r for r in get_repos() if r.filename == 
repo_alias))
-               if get_backend() == BackendConstants.zypp:
-                       subprocess.call(['sudo', 'zypper', 'rr', repo_alias])
-               if get_backend() == BackendConstants.dnf:
-                       subprocess.call(['sudo', 'rm', os.path.join(REPO_DIR, 
f'{repo_alias}.repo')])
+               subprocess.call(['sudo', 'zypper', 'rr', repo_alias])
                if repo.gpgkey:
                        ask_keep_key(repo.gpgkey, repo)
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/opi-5.8.1/opi/backends/__init__.py 
new/opi-5.8.3/opi/backends/__init__.py
--- old/opi-5.8.1/opi/backends/__init__.py      2025-03-12 12:07:57.000000000 
+0100
+++ new/opi-5.8.3/opi/backends/__init__.py      1970-01-01 01:00:00.000000000 
+0100
@@ -1,11 +0,0 @@
-import opi.config as config
-
-class BackendConstants:
-       zypp = 'zypp'
-       dnf = 'dnf'
-
-def get_backend():
-       backend = config.get_key_from_config('backend')
-       if not backend in ['zypp', 'dnf']:
-               raise config.ConfigError('Invalid backend configuration.')
-       return backend
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/opi-5.8.1/opi/config/__init__.py 
new/opi-5.8.3/opi/config/__init__.py
--- old/opi-5.8.1/opi/config/__init__.py        2025-03-12 12:07:57.000000000 
+0100
+++ new/opi-5.8.3/opi/config/__init__.py        2025-04-22 13:55:13.000000000 
+0200
@@ -2,7 +2,6 @@
 import configparser
 
 default_config = {
-       'backend': 'zypp',
        'use_releasever_var': True,
        'new_repo_auto_refresh': True,
        'list_in_reverse': False,
@@ -22,7 +21,6 @@
                        cp.read(path)
                        ocfg = cp['opi']
                        config_cache.update({
-                               'backend': ocfg.get('backend'),
                                'use_releasever_var': 
ocfg.getboolean('use_releasever_var'),
                                'new_repo_auto_refresh': 
ocfg.getboolean('new_repo_auto_refresh'),
                                'list_in_reverse': 
ocfg.getboolean('list_in_reverse'),
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/opi-5.8.1/opi/rpmbuild.py 
new/opi-5.8.3/opi/rpmbuild.py
--- old/opi-5.8.1/opi/rpmbuild.py       2025-03-12 12:07:57.000000000 +0100
+++ new/opi-5.8.3/opi/rpmbuild.py       2025-04-22 13:55:13.000000000 +0200
@@ -4,6 +4,8 @@
 import subprocess
 import glob
 import shutil
+from shutil import which
+from opi import install_packages
 
 def copy(src, dst):
        """
@@ -54,6 +56,10 @@
                os.mkdir(self.buildroot)
                os.mkdir(self.rpm_out_dir)
 
+               if not which('rpmbuild'):
+                       print("Installing requirement: rpm-build")
+                       install_packages(['rpm-build'], no_recommends=True, 
non_interactive=True)
+
        def mkspec(self):
                nl = "\n"
                spec = dedent(f"""
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/opi-5.8.1/opi/snap.py new/opi-5.8.3/opi/snap.py
--- old/opi-5.8.1/opi/snap.py   2025-03-12 12:07:57.000000000 +0100
+++ new/opi-5.8.3/opi/snap.py   2025-04-22 13:55:13.000000000 +0200
@@ -1,6 +1,7 @@
 import subprocess
 import requests
-import opi
+from shutil import which
+from opi import install_packages
 
 def http_get_json(url):
        r = requests.get(url, headers={'Snap-Device-Series': '16'})
@@ -17,4 +18,7 @@
        return {"version": c['version'], "url": c['download']['url']}
 
 def extract_snap(snap, target_dir):
+       if not which('unsquashfs'):
+               print("Installing requirement: squashfs")
+               install_packages(['squashfs'], no_recommends=True, 
non_interactive=True)
        subprocess.check_call(['unsquashfs', '-d', target_dir, snap])
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/opi-5.8.1/opi/version.py new/opi-5.8.3/opi/version.py
--- old/opi-5.8.1/opi/version.py        2025-03-12 12:07:57.000000000 +0100
+++ new/opi-5.8.3/opi/version.py        2025-04-22 13:55:13.000000000 +0200
@@ -1 +1 @@
-__version__ = '5.8.1'
+__version__ = '5.8.3'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/opi-5.8.1/opi.changes new/opi-5.8.3/opi.changes
--- old/opi-5.8.1/opi.changes   2025-03-12 12:07:57.000000000 +0100
+++ new/opi-5.8.3/opi.changes   2025-04-22 13:55:13.000000000 +0200
@@ -1,4 +1,18 @@
 -------------------------------------------------------------------
+Tue Apr 22 11:55:07 UTC 2025 - Dominik Heidler <dheid...@suse.de>
+
+- Version 5.8.3
+  * Install dependencies rpm-build and squashfs at runtime if needed
+  * Drop DNF support
+
+-------------------------------------------------------------------
+Tue Apr 22 08:08:34 UTC 2025 - Dominik Heidler <dheid...@suse.de>
+
+- Version 5.8.2
+  * Warn about adding staging repos
+  * Gracefully handle zypper exit code 106 (repos without cache present)
+
+-------------------------------------------------------------------
 Wed Mar 12 11:07:52 UTC 2025 - Dominik Heidler <dheid...@suse.de>
 
 - Version 5.8.1
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/opi-5.8.1/opi.default.cfg 
new/opi-5.8.3/opi.default.cfg
--- old/opi-5.8.1/opi.default.cfg       2025-03-12 12:07:57.000000000 +0100
+++ new/opi-5.8.3/opi.default.cfg       2025-04-22 13:55:13.000000000 +0200
@@ -1,5 +1,4 @@
 [opi]
-backend = zypp
 use_releasever_var = true
 new_repo_auto_refresh = true
 list_in_reverse = false
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/opi-5.8.1/setup.py new/opi-5.8.3/setup.py
--- old/opi-5.8.1/setup.py      2025-03-12 12:07:57.000000000 +0100
+++ new/opi-5.8.3/setup.py      2025-04-22 13:55:13.000000000 +0200
@@ -16,6 +16,6 @@
     author='Guo Yunhe, Dominik Heidler, KaratekHD',
     author_email='i...@guoyunhe.me, dheid...@suse.de, kara...@karatek.net',
     install_requires=['lxml', 'requests', 'termcolor', 'curses'],
-    packages=['opi', 'opi.plugins', 'opi.config', 'opi.backends'],
+    packages=['opi', 'opi.plugins', 'opi.config'],
     scripts=['bin/opi'],
 )
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/opi-5.8.1/test/run_container_test.sh 
new/opi-5.8.3/test/run_container_test.sh
--- old/opi-5.8.1/test/run_container_test.sh    2025-03-12 12:07:57.000000000 
+0100
+++ new/opi-5.8.3/test/run_container_test.sh    2025-04-22 13:55:13.000000000 
+0200
@@ -20,7 +20,7 @@
        fi
 
        # opi dependencies
-       podman exec -it opi_base zypper -n install sudo python3 
python3-requests python3-lxml python3-termcolor python3-curses python3-rpm curl 
rpm-build squashfs python3-pip python3-setuptools python3-wheel
+       podman exec -it opi_base zypper -n install sudo python3 
python3-requests python3-lxml python3-termcolor python3-curses python3-rpm curl 
python3-pip python3-setuptools python3-wheel
 
        # test dependencies
        podman exec -it opi_base zypper -n install python3-pexpect shadow

Reply via email to