Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package opi for openSUSE:Factory checked in 
at 2021-05-06 22:53:09
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/opi (Old)
 and      /work/SRC/openSUSE:Factory/.opi.new.2988 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "opi"

Thu May  6 22:53:09 2021 rev:18 rq:891085 version:2.0.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/opi/opi.changes  2021-04-22 18:06:19.542730537 
+0200
+++ /work/SRC/openSUSE:Factory/.opi.new.2988/opi.changes        2021-05-06 
22:53:42.330482695 +0200
@@ -1,0 +2,12 @@
+Mon May  3 15:00:53 UTC 2021 - Dominik Heidler <dheid...@suse.de>
+
+- Version 2.0.0
+  * Added
+    - Automated tests
+    - Extensible Plugin interface for plugins (eg. this one)
+    - Added plugins for chrome, dotnet, edge, teams, packman, plex,
+      skype, slack, teamviewer, vivaldi, vscode, vscodium, zoom
+  * Changed
+    - Rewrote the complete tool in python3
+
+-------------------------------------------------------------------

Old:
----
  opi-0.10.0.tar.gz

New:
----
  opi-2.0.0.tar.gz

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

Other differences:
------------------
++++++ opi.spec ++++++
--- /var/tmp/diff_new_pack.r23Jbu/_old  2021-05-06 22:53:42.730481046 +0200
+++ /var/tmp/diff_new_pack.r23Jbu/_new  2021-05-06 22:53:42.730481046 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           opi
-Version:        0.10.0
+Version:        2.0.0
 Release:        0
 Summary:        OBS Package Installer (CLI)
 License:        GPL-3.0-only
@@ -26,18 +26,19 @@
 Source0:        
https://github.com/openSUSE/%{name}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
 BuildArch:      noarch
 BuildRequires:  help2man
-BuildRequires:  perl
-BuildRequires:  perl(Config::Tiny)
-BuildRequires:  perl(LWP)
-BuildRequires:  perl(LWP::Protocol::https)
-BuildRequires:  perl(URI)
-BuildRequires:  perl(XML::LibXML)
-Requires:       perl
-Requires:       perl(Config::Tiny)
-Requires:       perl(LWP)
-Requires:       perl(LWP::Protocol::https)
-Requires:       perl(URI)
-Requires:       perl(XML::LibXML)
+BuildRequires:  python3
+BuildRequires:  python3-lxml
+BuildRequires:  python3-requests
+BuildRequires:  python3-setuptools
+BuildRequires:  python3-termcolor
+Requires:       sudo
+Requires:       zypper
+# rpm --import used curl but doesn't require it explicitly
+Requires:       curl
+Requires:       python3-lxml
+Requires:       python3-requests
+Requires:       python3-termcolor
+Requires:       zypper
 
 %description
 OBS Package Installer (CLI)
@@ -46,22 +47,25 @@
 %setup -q
 
 %build
-help2man ./opi > opi.8.gz
+help2man -s8 -N ./bin/opi > opi.8.gz
 gzip opi.8.gz
 
 %install
-mkdir -p %{buildroot}%{_bindir}
-install %{name} %{buildroot}%{_bindir}
+python3 setup.py install --prefix=%{_prefix} --root=%{buildroot}
 mkdir -p %{buildroot}%{_datadir}/metainfo
 cp org.openSUSE.opi.appdata.xml %{buildroot}%{_datadir}/metainfo
 mkdir -p %{buildroot}%{_datadir}/man/man8
 cp opi.8.gz %{buildroot}%{_datadir}/man/man8
 
+%check
+python3 setup.py --version | grep %{version}
+
 %files
 %license LICENSE
-%doc README.md screenshot.png
+%doc README.md
 %{_bindir}/%{name}
 %{_datadir}/metainfo/org.openSUSE.opi.appdata.xml
 %{_datadir}/man/man8/opi.8.gz
+%{python3_sitelib}/*
 
 %changelog

++++++ opi-0.10.0.tar.gz -> opi-2.0.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/opi-0.10.0/.github/FUNDING.yml 
new/opi-2.0.0/.github/FUNDING.yml
--- old/opi-0.10.0/.github/FUNDING.yml  2021-01-17 08:25:43.000000000 +0100
+++ new/opi-2.0.0/.github/FUNDING.yml   1970-01-01 01:00:00.000000000 +0100
@@ -1,9 +0,0 @@
-# These are supported funding model platforms
-
-github: [guoyunhe]
-patreon: guoyunhe
-open_collective: # Replace with a single Open Collective username
-ko_fi: # Replace with a single Ko-fi username
-tidelift: # Replace with a single Tidelift platform-name/package-name e.g., 
npm/babel
-community_bridge: # Replace with a single Community Bridge project-name e.g., 
cloud-foundry
-custom: # Replace with a single custom sponsorship URL
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/opi-0.10.0/.github/workflows/ci.yaml 
new/opi-2.0.0/.github/workflows/ci.yaml
--- old/opi-0.10.0/.github/workflows/ci.yaml    1970-01-01 01:00:00.000000000 
+0100
+++ new/opi-2.0.0/.github/workflows/ci.yaml     2021-05-03 16:40:25.000000000 
+0200
@@ -0,0 +1,23 @@
+name: CI
+on:
+  push:
+    branches: [ master ]
+  pull_request:
+    branches: [ master ]
+
+  # Allows you to run this workflow manually from the Actions tab
+  workflow_dispatch:
+
+jobs:
+  test:
+    # The type of runner that the job will run on
+    runs-on: ubuntu-latest
+
+    # Steps represent a sequence of tasks that will be executed as part of the 
job
+    steps:
+      # Checks-out your repository under $GITHUB_WORKSPACE, so your job can 
access it
+      - uses: actions/checkout@v2
+
+      # Runs a single command using the runners shell
+      - name: Run testsuite
+        run: ./test/run_all.sh
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/opi-0.10.0/.gitignore new/opi-2.0.0/.gitignore
--- old/opi-0.10.0/.gitignore   2021-01-17 08:25:43.000000000 +0100
+++ new/opi-2.0.0/.gitignore    2021-05-03 16:40:25.000000000 +0200
@@ -34,3 +34,25 @@
 /pm_to_blib
 /*.zip
 /search.xml
+
+.*.swp
+__pycache__
+
+# Distribution / packaging
+.Python
+env/
+build/
+develop-eggs/
+dist/
+downloads/
+eggs/
+.eggs/
+lib/
+lib64/
+parts/
+sdist/
+var/
+wheels/
+*.egg-info/
+.installed.cfg
+*.egg
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/opi-0.10.0/CHANGELOG.md new/opi-2.0.0/CHANGELOG.md
--- old/opi-0.10.0/CHANGELOG.md 2021-01-17 08:25:43.000000000 +0100
+++ new/opi-2.0.0/CHANGELOG.md  2021-05-03 16:40:25.000000000 +0200
@@ -7,6 +7,18 @@
 
 ## [Unreleased]
 
+## [2.0.0] - 2021-05-03
+
+### Added
+
+- [Automated tests](https://github.com/openSUSE/opi/actions)
+- Extensible Plugin interface for plugins (eg. [this 
one](https://github.com/openSUSE/opi/blob/master/opi/plugins/vivaldi.py))
+- Added plugins for chrome, dotnet, edge, teams, packman, plex, skype, slack, 
teamviewer, vivaldi, vscode, vscodium, zoom
+
+### Changed
+
+- Rewrote the complete tool in python3
+
 ## [0.10.0] - 2021-01-17
 
 ### Added
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/opi-0.10.0/README.md new/opi-2.0.0/README.md
--- old/opi-0.10.0/README.md    2021-01-17 08:25:43.000000000 +0100
+++ new/opi-2.0.0/README.md     2021-05-03 16:40:25.000000000 +0200
@@ -11,29 +11,22 @@
 ## System Requirements
 
 - openSUSE Tumbleweed, openSUSE Leap 42.1+, SLE 12+
-- perl
-- perl-libwww-perl
-- perl-XML-LibXML
-- perl-URI
-- perl-Config-Tiny
+- python3
+- python3-requests
+- python3-lxml
+- python3-termcolor
 
 ## Install
 
-### openSUSE Tumbleweed
+### openSUSE Tumbleweed and Leap
 
 ```
 sudo zypper install opi
 ```
 
-## Leap and SLE
+### SLE
 
 ```
-# Leap 15.0
-sudo zypper addrepo --refresh 
https://download.opensuse.org/repositories/home:guoyunhe/openSUSE_Leap_15.0/home:guoyunhe.repo
-# Leap 15.1
-sudo zypper addrepo --refresh 
https://download.opensuse.org/repositories/home:guoyunhe/openSUSE_Leap_15.1/home:guoyunhe.repo
-# Leap 42.3
-sudo zypper addrepo --refresh 
https://download.opensuse.org/repositories/home:guoyunhe/openSUSE_Leap_42.3/home:guoyunhe.repo
 # SLE 15
 sudo zypper addrepo --refresh 
https://download.opensuse.org/repositories/home:guoyunhe/SLE_15/home:guoyunhe.repo
 
@@ -65,20 +58,27 @@
 opi codecs
 ```
 
-**Skype**
-
-```
-opi skype
-```
-
-**Visual Studio Code**
-
-```
-opi vs code
 ```
+openSUSE Package Installer
+==========================
 
-**Miscrosoft Teams**
-
-```
-opi teams
+Search and install almost all packages available for openSUSE and SLE:
+ 1. openSUSE Build Service
+ 2. Packman
+ 2. Popular packages for various vendors
+
+Usage: opi <query>
+
+  <query> can be any package name or part of it and will be searched for
+  both at the openSUSE Build Service and Packman.
+
+Also this queries can be used to install packages from various other vendors:
+
+  chrome            Google Chrome webbrowser
+  codecs            Media Codecs from Packman Repo
+  msteams           Microsoft Teams
+  skype             Microsoft Skype
+  teamviewer        Teamviewer remote access
+  vscode            Microsoft Visual Studio Code
+  vscodium          Visual Studio Codium
 ```
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/opi-0.10.0/bin/opi new/opi-2.0.0/bin/opi
--- old/opi-0.10.0/bin/opi      1970-01-01 01:00:00.000000000 +0100
+++ new/opi-2.0.0/bin/opi       2021-05-03 16:40:25.000000000 +0200
@@ -0,0 +1,76 @@
+#!/usr/bin/python3
+
+import os
+import sys
+sys.path.insert(0, os.path.abspath(os.path.dirname(__file__) + '/..'))
+
+import opi
+from opi.plugins import PluginManager
+from opi.version import __version__
+
+try:
+       query = ' '.join(sys.argv[1:])
+
+       pm = PluginManager()
+       if query in ('', '-h', '--help'):
+               print("openSUSE Package Installer")
+               print("==========================\n")
+
+               print("Search and install almost all packages available for 
openSUSE and SLE:")
+               print(" 1. openSUSE Build Service")
+               print(" 2. Packman")
+               print(" 2. Popular packages for various vendors\n")
+
+               print("Usage: opi <query>\n")
+               print("  <query> can be any package name or part of it and will 
be searched for")
+               print("  both at the openSUSE Build Service and Packman.\n")
+
+               print("Also this queries can be used to install packages from 
various other vendors:\n")
+               pm.show_plugins(' '*2)
+               print()
+               sys.exit()
+       elif query in ('-v', '--version'):
+               print('opi version %s' % __version__)
+               sys.exit()
+
+       # Try to find a matching plugin for the query (and run it and exit 
afterwards)
+       pm.run(query)
+
+       binaries = []
+       binaries.extend(opi.search_published_binary('openSUSE', query))
+       binaries.extend(opi.search_published_binary('Packman', query))
+       binaries = opi.sort_binaries(binaries)
+       if len(binaries) == 0:
+               print("No package found.")
+               sys.exit()
+       binary_names = opi.get_binary_names(binaries)
+
+       # Print package name options
+       opi.print_package_names(binary_names)
+
+       # Select a package name option
+       selected_name_num = opi.ask_number(1, len(binary_names))
+       selected_name = binary_names[selected_name_num-1]
+       print("You have selected package name: %s" % selected_name)
+       binary_options = opi.get_binaries_by_name(selected_name, binaries)
+
+       # Print binary package options
+       opi.print_binary_options(binary_options)
+
+       # Select a binary package option
+       selected_binary_num = opi.ask_number(1, len(binary_options))
+       selected_binary = binary_options[selected_binary_num-1]
+       print("You have selected binary package: ", end='')
+       opi.print_binary_option(selected_binary)
+       if opi.is_personal_project(selected_binary['project']):
+               print(opi.colored(
+                       "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'
+               ))
+
+       # Install selected package
+       opi.install_binary(selected_binary)
+except KeyboardInterrupt:
+       print()
File old/opi-0.10.0/opi is a regular file while file new/opi-2.0.0/opi is a 
directory
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/opi-0.10.0/setup.py new/opi-2.0.0/setup.py
--- old/opi-0.10.0/setup.py     1970-01-01 01:00:00.000000000 +0100
+++ new/opi-2.0.0/setup.py      2021-05-03 16:40:25.000000000 +0200
@@ -0,0 +1,19 @@
+#!/usr/bin/python3
+
+from distutils.core import setup
+import os
+
+# Load __version__ from opi/version.py
+exec(open(os.path.join(os.path.dirname(os.path.realpath(__file__)), 
"opi/version.py")).read())
+
+setup(
+    name='opi',
+    version=__version__,
+    license='GPLv3',
+    description='Tool to Search and install almost all packages available for 
openSUSE and SLE',
+    author='Guo Yunhe, Dominik Heidler',
+    author_email='i...@guoyunhe.me, dheid...@suse.de',
+    requires=['lxml', 'requests', 'termcolor'],
+    packages=['opi', 'opi.plugins'],
+    scripts=['bin/opi'],
+)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/opi-0.10.0/test/01_install_from_packman.py 
new/opi-2.0.0/test/01_install_from_packman.py
--- old/opi-0.10.0/test/01_install_from_packman.py      1970-01-01 
01:00:00.000000000 +0100
+++ new/opi-2.0.0/test/01_install_from_packman.py       2021-05-03 
16:40:25.000000000 +0200
@@ -0,0 +1,27 @@
+#!/usr/bin/python3
+
+import sys
+import pexpect
+import subprocess
+
+c = pexpect.spawn('./bin/opi gstreamer-plugins-ugly', 
logfile=sys.stdout.buffer, echo=False)
+
+c.expect("1. gstreamer-plugins-ugly\r\n")
+c.expect('Choose a number')
+c.sendline('1')
+
+c.expect("3. .*Packman Essentials", timeout=10)
+c.sendline('3')
+
+c.expect("Do you want to reject the key", timeout=10)
+c.sendline('t')
+
+c.expect("new packages to install", timeout=10)
+c.expect("Continue", timeout=10)
+c.sendline('y')
+c.interact()
+c.wait()
+c.close()
+assert c.exitstatus == 0, "Exit code: %i" % c.exitstatus
+
+subprocess.check_call(['rpm', '-qi', 'gstreamer-plugins-ugly'])
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/opi-0.10.0/test/02_install_from_home.py 
new/opi-2.0.0/test/02_install_from_home.py
--- old/opi-0.10.0/test/02_install_from_home.py 1970-01-01 01:00:00.000000000 
+0100
+++ new/opi-2.0.0/test/02_install_from_home.py  2021-05-03 16:40:25.000000000 
+0200
@@ -0,0 +1,32 @@
+#!/usr/bin/python3
+
+import sys
+import pexpect
+import subprocess
+
+c = pexpect.spawn('./bin/opi xosview', logfile=sys.stdout.buffer, echo=False)
+
+c.expect("1. xosview\r\n")
+c.expect('Choose a number')
+c.sendline('1')
+
+c.expect("2. .*X11:Utilities", timeout=10)
+c.sendline('2')
+
+c.expect("Do you want to reject the key", timeout=10)
+c.sendline('t')
+
+c.expect("new packages to install", timeout=10)
+c.expect("Continue", timeout=10)
+c.sendline('y')
+
+c.expect("Do you want to keep the repo", timeout=150)
+c.sendline('n')
+
+c.interact()
+c.wait()
+c.close()
+assert c.exitstatus == 0, "Exit code: %i" % c.exitstatus
+
+subprocess.check_call(['rpm', '-qi', 'xosview'])
+subprocess.check_call('zypper lr -u | grep -v X11', shell=True)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/opi-0.10.0/test/03_install_using_plugin.py 
new/opi-2.0.0/test/03_install_using_plugin.py
--- old/opi-0.10.0/test/03_install_using_plugin.py      1970-01-01 
01:00:00.000000000 +0100
+++ new/opi-2.0.0/test/03_install_using_plugin.py       2021-05-03 
16:40:25.000000000 +0200
@@ -0,0 +1,24 @@
+#!/usr/bin/python3
+
+import sys
+import pexpect
+import subprocess
+
+c = pexpect.spawn('./bin/opi vivaldi', logfile=sys.stdout.buffer, echo=False)
+
+c.expect("Do you want to install")
+c.sendline('y')
+
+c.expect("Continue")
+c.sendline('y')
+
+c.expect("Do you want to keep", timeout=600)
+c.sendline('y')
+
+c.interact()
+c.wait()
+c.close()
+assert c.exitstatus == 0, "Exit code: %i" % c.exitstatus
+
+subprocess.check_call(['rpm', '-qi', 'vivaldi-stable'])
+subprocess.check_call('zypper lr | grep vivaldi', shell=True)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/opi-0.10.0/test/04_check_plugins.py 
new/opi-2.0.0/test/04_check_plugins.py
--- old/opi-0.10.0/test/04_check_plugins.py     1970-01-01 01:00:00.000000000 
+0100
+++ new/opi-2.0.0/test/04_check_plugins.py      2021-05-03 16:40:25.000000000 
+0200
@@ -0,0 +1,15 @@
+#!/usr/bin/python3
+
+import os
+import sys
+sys.path.insert(0, os.path.abspath(os.path.dirname(__file__) + '/..'))
+
+from opi.plugins import PluginManager
+
+pm = PluginManager()
+
+for plugin in pm.plugins:
+       print('Checking plugin: %s' % plugin)
+       assert plugin.main_query != ""
+       assert plugin.description != ""
+       assert plugin.main_query in plugin.queries, "Plugin main query must be 
in queries list"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/opi-0.10.0/test/99_install_opi.py 
new/opi-2.0.0/test/99_install_opi.py
--- old/opi-0.10.0/test/99_install_opi.py       1970-01-01 01:00:00.000000000 
+0100
+++ new/opi-2.0.0/test/99_install_opi.py        2021-05-03 16:40:25.000000000 
+0200
@@ -0,0 +1,10 @@
+#!/usr/bin/python3
+
+import sys
+import pexpect
+import subprocess
+
+subprocess.check_call(['python3', 'setup.py', 'install'])
+version = subprocess.check_output(['python3', 'setup.py', 
'--version']).decode().strip()
+subprocess.check_call("opi --version | grep %s" % version, shell=True)
+subprocess.check_call("opi --help | grep --color -A1000 -B1000 Microsoft", 
shell=True)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/opi-0.10.0/test/run.sh new/opi-2.0.0/test/run.sh
--- old/opi-0.10.0/test/run.sh  1970-01-01 01:00:00.000000000 +0100
+++ new/opi-2.0.0/test/run.sh   2021-05-03 16:40:25.000000000 +0200
@@ -0,0 +1,15 @@
+#!/bin/bash
+
+echo "$(tput bold)$(tput setaf 6)===== Running test: $1 =====$(tput sgr0)"
+
+cd /opi/
+./test/$1
+result=$?
+
+if [[ "$result" == "0" ]] ; then
+       echo "$(tput bold)$(tput setaf 2)>>>>> PASSED <<<<<$(tput sgr0)"
+else
+       echo "$(tput bold)$(tput setaf 1)!!!!! FAILED !!!!!$(tput sgr0)"
+fi
+
+exit $result
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/opi-0.10.0/test/run_all.sh 
new/opi-2.0.0/test/run_all.sh
--- old/opi-0.10.0/test/run_all.sh      1970-01-01 01:00:00.000000000 +0100
+++ new/opi-2.0.0/test/run_all.sh       2021-05-03 16:40:25.000000000 +0200
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+test_dir="$(dirname "$(pwd)/$0")"
+cd "$test_dir"
+
+
+failed_tests=0
+total_tests=0
+
+for t in *.py ; do
+       let total_tests++
+       if ! sudo ./run_container_test.sh "$t" ; then
+               let failed_tests++
+       fi
+done
+
+if [[ "$failed_tests" != "0" ]] ; then
+       echo "$(tput bold)$(tput setaf 1)Error: ${failed_tests} out of 
${total_tests} failed!$(tput sgr0)"
+       exit 1
+else
+       echo "$(tput bold)$(tput setaf 2)All ${total_tests} tests 
succedeed!$(tput sgr0)"
+fi
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/opi-0.10.0/test/run_container_test.sh 
new/opi-2.0.0/test/run_container_test.sh
--- old/opi-0.10.0/test/run_container_test.sh   1970-01-01 01:00:00.000000000 
+0100
+++ new/opi-2.0.0/test/run_container_test.sh    2021-05-03 16:40:25.000000000 
+0200
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+# prepare container image
+if ! podman images -n | grep -q opi_base ; then
+       echo "Preparing container"
+       podman run -td --dns=1.1.1.1 --name=opi_base opensuse/tumbleweed
+       podman exec -it opi_base zypper -n ref
+       # opi dependencies
+       podman exec -it opi_base zypper -n install sudo python3 
python3-requests python3-lxml python3-termcolor curl
+
+       # test dependencies
+       podman exec -it opi_base zypper -n install python3-pexpect
+
+       podman commit opi_base opi_base
+       podman kill opi_base
+fi
+
+
+
+opi_dir="$(dirname $(pwd)/$0)/../"
+podman run -ti --volume "${opi_dir}:/opi/" opi_base /opi/test/run.sh $1
+exit $?

Reply via email to