Hello community,

here is the log from the commit of package osc-plugin-install for 
openSUSE:Factory checked in at 2018-02-01 21:30:41
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/osc-plugin-install (Old)
 and      /work/SRC/openSUSE:Factory/.osc-plugin-install.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "osc-plugin-install"

Thu Feb  1 21:30:41 2018 rev:2 rq:571699 version:0.25

Changes:
--------
--- /work/SRC/openSUSE:Factory/osc-plugin-install/osc-plugin-install.changes    
2017-02-24 02:54:01.004476869 +0100
+++ 
/work/SRC/openSUSE:Factory/.osc-plugin-install.new/osc-plugin-install.changes   
    2018-02-01 21:31:42.970540153 +0100
@@ -1,0 +2,5 @@
+Sat Jan 20 12:25:56 UTC 2018 - [email protected]
+
+- Add patch boo#1009432_replace_etc_suse_release_by_os_release.patch to 
replace obsolete /etc/SuSE-release (boo#1009432)
+
+-------------------------------------------------------------------

New:
----
  _multibuild
  boo#1009432_replace_etc_suse_release_by_os_release.patch

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

Other differences:
------------------
++++++ osc-plugin-install.spec ++++++
--- /var/tmp/diff_new_pack.23x28b/_old  2018-02-01 21:31:43.398520130 +0100
+++ /var/tmp/diff_new_pack.23x28b/_new  2018-02-01 21:31:43.398520130 +0100
@@ -1,7 +1,7 @@
 #
-# spec file for package osc-plugin-install
+# spec file for package osc-plugin
 #
-# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 # Copyright (C) 2012,2013, [email protected], Novell Inc., openSUSE.org
 #
 # All modifications and additions to the file contributed by third parties
@@ -17,7 +17,18 @@
 #
 
 
-Name:           osc-plugin-install
+# Define just "test" as a package in _multibuild file to distinguish test
+# instructions here
+%if "@BUILD_FLAVOR@" == ""
+%define _test 0
+%define name_ext %nil
+%else
+%define _test 1
+%define name_ext -test
+%endif
+
+%define         orig_name osc-plugin-install
+Name:           %{orig_name}%{?name_ext}
 Version:        0.25
 Release:        0
 Summary:        Plugin to make package installation easier
@@ -25,19 +36,24 @@
 Group:          Development/Tools/Other
 Url:            https://github.com/jnweiger/%{name}
 Source:         
https://raw.githubusercontent.com/jnweiger/%{name}/master/osc-install.py
+Patch0:         boo#1009432_replace_etc_suse_release_by_os_release.patch
+%if 0%{?_test}
+BuildRequires:  %{orig_name}
+BuildRequires:  expect
+%if 0%{?suse_version} >= 1330
+BuildRequires:  python-certifi
+%endif
+%else
 # Needed for directory ownership
 BuildRequires:  osc
 Requires:       osc
 %if 0%{?!fedora_version:1} && 0%{?!centos_version:1} && 
0%{?!scientificlinux_version:1} && 0%{?!rhel_version:1}
 Recommends:     rpm-python rpmdevtools
 %endif
+%endif
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 BuildArch:      noarch
-%if %(if test -d %{_prefix}/lib/osc-plugins; then echo 1; else echo 0; fi)
 %define oscplugindir %{_prefix}/lib/osc-plugins
-%else
-%define oscplugindir %{_localstatedir}/lib/osc-plugins
-%endif
 
 %description
 This osc plugin extends osc with the subcommand 'osc install'.
@@ -58,19 +74,35 @@
        Juergen Weigert <[email protected]>
 
 %prep
+%patch0 -p1 -d %_sourcedir
 
 %build
+%if 0%{?_test}
+rpm -ql %{orig_name}
+cat > test_osc_in << EOF
+strace 2
+spawn osc in --help
+expect "Username: "
+send "test"
+expect "Password: "
+send "foo"
+expect "install a package after build via zypper in"
+EOF
+expect -f test_osc_in
+
+# disable debug packages in package test to prevent error about missing files
+%define debug_package %{nil}
+%else
 
 %install
 install -D -m0644 %{S:0} %{buildroot}%{oscplugindir}/osc-install.py
 
-%clean
-%{__rm} -rf %{buildroot}
-
 %files
 %defattr(-, root, root)
 # also glob for byte-compiled (pyc) and optimized byte-compiled (pyo)
 # files (they are generated by fedora's brp-python-bytecompile script)
 %{oscplugindir}/*.py*
 
+%endif
+
 %changelog

++++++ _multibuild ++++++
<multibuild>
    <package>test</package>
</multibuild>
++++++ boo#1009432_replace_etc_suse_release_by_os_release.patch ++++++
--- a/osc-install.py    2017-03-18 03:03:28.000000000 +0100
+++ b/osc-install.py    2018-01-20 13:09:16.987208951 +0100
@@ -62,7 +62,7 @@
 #
 # Osc install prompts you with candidate packages from a list of projects that
 # build the package for your system. It can discern platform and architecture
-# from /etc/SuSE-release and/or your ~/.oscrc build_project setting.
+# from /etc/os-release and/or your ~/.oscrc build_project setting.
 #
 # Osc install suggests to add repo URLs for newly used projects to the zypper 
 # repository list. This has little importance for osc, but is very
@@ -202,8 +202,8 @@
 
 @cmdln.hide(1)
 @cmdln.alias('in')
[email protected]('-p', '--platform', metavar='SUSE_RELEASE', help='platform 
substring to match. Default: guess platform from /etc/SuSE-Release')
[email protected]('-a', '--arch', metavar='ARCH', help='system architecture. 
Default: guess platform from /etc/SuSE-Release')
[email protected]('-p', '--platform', metavar='SUSE_RELEASE', help='platform 
substring to match. Default: guess platform from /etc/os-release')
[email protected]('-a', '--arch', metavar='ARCH', help='system architecture. 
Default: guess platform from /etc/os-release')
 @cmdln.option('-f', '--first', action='store_true', help='if multiple projects 
offer a package, choose the first. Default: Ask user')
 @cmdln.option('-v', '--verbose', action='store_true', help='babble while 
working')
 @cmdln.option('-I', '--no-cache', action='store_true', help='ignore cached 
packages, always download. Default: check build cache 
/var/tmp/osbuild-packagecache')
@@ -259,7 +259,7 @@
 
     # default_platform = 'openSUSE_12.1'
     osc_cache = '/var/tmp/osbuild-packagecache'
-    etc_S_r = '/etc/SuSE-release' 
+    etc_S_r = '/etc/os-release' 
     if len(args) == 1:
     #{
       if re.search('\.rpm$', args[0]):
@@ -557,6 +557,7 @@
 def _read_system_name(self, file, opts):
     print("using %s to match build platforms" % (file))
     text = open(file).read()
+    text = text.replace('"', '')
     a = {}
     for i in (re.split("[\s_:=\(\)]+", text)):
       a[i] = 2

Reply via email to