Hello community,
here is the log from the commit of package virt-sandbox for openSUSE:Factory checked in at 2017-12-05 01:30:51
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/virt-sandbox (Old)
and /work/SRC/openSUSE:Factory/.virt-sandbox.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "virt-sandbox"
Tue Dec 5 01:30:51 2017 rev:14 rq:548151 version:0.6.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/virt-sandbox/virt-sandbox.changes 2017-05-31 12:21:18.167182296 +0200
+++ /work/SRC/openSUSE:Factory/.virt-sandbox.new/virt-sandbox.changes 2017-12-05 01:30:54.427840249 +0100
@@ -1,0 +2,7 @@
+Fri Dec 1 17:39:22 UTC 2017 - cbosdonnat@suse.com
+
+- Conversion to python 3 (fate#323526)
+ python3.patch
+- Enable LZMA support for recent distributions
+
+-------------------------------------------------------------------
New:
----
python3.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ virt-sandbox.spec ++++++
--- /var/tmp/diff_new_pack.MysEkZ/_old 2017-12-05 01:30:55.535799998 +0100
+++ /var/tmp/diff_new_pack.MysEkZ/_new 2017-12-05 01:30:55.539799852 +0100
@@ -1,7 +1,7 @@
#
# spec file for package virt-sandbox
#
-# Copyright (c) 2017 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -37,13 +37,14 @@
# Patches pending upstream review
# Need to go upstream
+Patch150: python3.patch
# Our patches
Patch200: no-libexec.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: glib2-devel >= 2.32.0
-BuildRequires: glibc-static
+BuildRequires: glibc-devel-static
BuildRequires: gobject-introspection-devel
BuildRequires: gtk-doc
BuildRequires: intltool
@@ -51,8 +52,11 @@
BuildRequires: libtool
BuildRequires: libvirt-glib-devel >= 0.2.1
BuildRequires: perl
+%if 0%{?suse_version} >= 1330
+BuildRequires: xz-static-devel
+%endif
BuildRequires: zlib-devel-static
-Requires: rpm-python
+Requires: python3-rpm
# For virsh lxc-enter-namespace command
Requires: libvirt-client >= %{libvirt_version}
Requires: python3-gobject
@@ -63,8 +67,8 @@
%package -n libvirt-sandbox-%{soname}
Summary: Libvirt application sandbox framework libraries
-Group: Development/Libraries/C and C++
# So we get the full libvirtd daemon, not just client libs
+Group: Development/Libraries/C and C++
Requires: libvirt-daemon-lxc >= %{libvirt_version}
Requires: libvirt-daemon-qemu >= %{libvirt_version}
@@ -98,6 +102,7 @@
%patch0 -p1
%patch1 -p1
%patch2 -p1
+%patch150 -p1
%patch200 -p1
%build
@@ -105,7 +110,11 @@
# than the one used to autoconfigure the project for the distribution
# Just make sure the files are sync'ed with our version
autoreconf -f -i
-%configure --enable-introspection --disable-static --without-lzma
+%configure --enable-introspection \
+%if 0%{?suse_version} < 1330
+ --without-lzma \
+%endif
+ --disable-static
make V=1 %{?_smp_mflags}
%install
++++++ no-libexec.patch ++++++
--- /var/tmp/diff_new_pack.MysEkZ/_old 2017-12-05 01:30:55.583798254 +0100
+++ /var/tmp/diff_new_pack.MysEkZ/_new 2017-12-05 01:30:55.583798254 +0100
@@ -2,7 +2,7 @@
===================================================================
--- libvirt-sandbox-0.6.0.orig/bin/virt-sandbox-service
+++ libvirt-sandbox-0.6.0/bin/virt-sandbox-service
-@@ -469,7 +469,7 @@ After=libvirtd.service
+@@ -484,7 +484,7 @@ After=libvirtd.service
%(FOLLOW)s
[Service]
Type=simple
@@ -11,16 +11,22 @@
ExecReload=/usr/bin/virt-sandbox-service -c %(URI)s reload -u %(RELOAD)s %(NAME)s
ExecStop=/usr/bin/virsh -c %(URI)s destroy %(NAME)s
-@@ -921,7 +921,7 @@ def connect(args):
+@@ -935,11 +935,11 @@ def connect(args):
+ print ("""\
Connected to %s.
Type 'Ctrl + ]' to detach from the console.
- """ % ( args.name )
+-""" % ( args.name )
- os.execl("/usr/libexec/virt-sandbox-service-util",
++""" % ( args.name ))
+ os.execl("/usr/lib/virt-sandbox-service-util",
"virt-sandbox-service-util",
"-c", args.uri,
- "-a", args.name)
-@@ -1027,7 +1027,7 @@ def upgrade_config_legacy(path):
+- "-a", args.name))
++ "-a", args.name)
+
+ #
+ # Search Path for command to execute within the container.
+@@ -1042,7 +1042,7 @@ def upgrade_config_legacy(path):
fd.close()
unitfile = unitfile.replace("/usr/bin/virt-sandbox-service start",
++++++ python3.patch ++++++
Index: libvirt-sandbox-0.6.0/bin/virt-sandbox-service
===================================================================
--- libvirt-sandbox-0.6.0.orig/bin/virt-sandbox-service
+++ libvirt-sandbox-0.6.0/bin/virt-sandbox-service
@@ -1,4 +1,4 @@
-#!/usr/bin/python -Es
+#!/usr/bin/python3 -Es
#
# Authors: Dan Walsh
#
@@ -19,13 +19,16 @@
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
+import gi
+gi.require_version('LibvirtGConfig', '1.0')
+from gi.repository import LibvirtGConfig
+gi.require_version('LibvirtGObject', '1.0')
from gi.repository import LibvirtGObject
+gi.require_version('LibvirtSandbox', '1.0')
from gi.repository import LibvirtSandbox
from gi.repository import GLib
-import gi
import re
import os, sys, shutil, errno, stat
-import exceptions
import rpm
from subprocess import Popen, PIPE, STDOUT
import gettext
@@ -44,7 +47,6 @@ gettext.textdomain("libvirt-sandbox")
try:
gettext.install("libvirt-sandbox",
localedir="/usr/share/locale",
- unicode=False,
codeset = 'utf-8')
except IOError:
import __builtin__
@@ -220,7 +222,8 @@ class Container:
def gen_filesystems(self):
if self.use_image:
self.image = self.DEFAULT_IMAGE % self.get_name()
- mount = LibvirtSandbox.ConfigMountHostImage.new(self.image, self.dest)
+ mount = LibvirtSandbox.ConfigMountHostImage.new(self.image, self.dest,
+ LibvirtGConfig.DomainDiskFormat.RAW)
self.config.add_mount(mount)
def fix_stat(self, f):
@@ -229,7 +232,7 @@ class Container:
path = "%s%s" % (self.dest, f)
os.chown(path, s.st_uid, s.st_gid)
os.chmod(path, s.st_mode)
- except OSError, e:
+ except OSError as e:
if not e.errno == errno.ENOENT:
raise
@@ -247,7 +250,7 @@ class Container:
try:
path = "%s%s" % (self.dest, d)
os.makedirs(path)
- except OSError, e:
+ except OSError as e:
if not e.errno == errno.EEXIST:
raise
@@ -257,7 +260,7 @@ class Container:
path = "%s%s" % (self.dest, f)
fd=open(path, "w")
fd.close()
- except OSError, e:
+ except OSError as e:
if not e.errno == errno.EEXIST:
raise
@@ -398,10 +401,10 @@ class GenericContainer(Container):
def create(self):
try:
self.create_generic()
- except Exception, e:
+ except Exception as e:
try:
self.delete()
- except Exception, e2:
+ except Exception as e2:
pass
raise e
@@ -412,6 +415,18 @@ class GenericContainer(Container):
def is_template_unit(unit):
return '@' in unit
+# Python 2 / 3 compability helpers
+def get_next(obj):
+ if hasattr(obj, 'next'):
+ return obj.next()
+ else:
+ return next(obj)
+
+def string(obj):
+ if isinstance(obj, bytes):
+ return str(obj, encoding='utf-8')
+ return obj
+
class SystemdContainer(Container):
IGNORE_DIRS = [ "/var/run/", "/etc/logrotate.d/", "/etc/pam.d" ]
DEFAULT_DIRS = [ "/etc", "/var" ]
@@ -575,8 +590,8 @@ WantedBy=multi-user.target
def get_rpm_for_unit(self, unitfile):
mi = self.ts.dbMatch(rpm.RPMTAG_BASENAMES, unitfile)
try:
- h = mi.next();
- except exceptions.StopIteration:
+ h = get_next(mi);
+ except StopIteration:
return None
return h['name']
@@ -584,8 +599,8 @@ WantedBy=multi-user.target
def extract_rpm(self, rpm_name):
mi = self.ts.dbMatch('name', rpm_name)
try:
- h = mi.next();
- except exceptions.StopIteration:
+ h = get_next(mi);
+ except StopIteration:
raise ValueError([_("Cannot find package named %s") % rpm_name])
for fentry in h.fiFromHeader():
@@ -596,16 +611,16 @@ WantedBy=multi-user.target
if os.path.isfile(fname):
self.add_file(fname)
- srcrpm = h[rpm.RPMTAG_SOURCERPM]
+ srcrpm = string(h[rpm.RPMTAG_SOURCERPM])
srcrpmbits = self.split_filename(srcrpm)
- if srcrpmbits[0] == h[rpm.RPMTAG_NAME]:
+ if srcrpmbits[0] == string(h[rpm.RPMTAG_NAME]):
return
mi = self.ts.dbMatch(rpm.RPMTAG_NAME, srcrpmbits[0])
try:
- h = mi.next();
- except exceptions.StopIteration:
+ h = get_next(mi);
+ except StopIteration:
raise ValueError([_("Cannot find base package %s") % srcrpmbits[0]])
for fentry in h.fiFromHeader():
@@ -765,7 +780,7 @@ PrivateNetwork=false
fd.write("[Unit]\n")
fd.write("Description=Sandbox multi-user target\n")
fd.close()
- except OSError, e:
+ except OSError as e:
if not e.errno == errno.EEXIST:
raise
@@ -783,7 +798,7 @@ PrivateNetwork=false
jpath = "/var/log/journal/" + uuid
if os.path.lexists(jpath):
os.remove(jpath)
- except Exception, e:
+ except Exception as e:
sys.stderr.write("%s: %s\n" % (sys.argv[0], e))
sys.stderr.flush()
@@ -819,10 +834,10 @@ PrivateNetwork=false
try:
self.create_systemd()
- except Exception, e:
+ except Exception as e:
try:
self.delete()
- except Exception, e2:
+ except Exception as e2:
sys.stderr.write("Cleanup failed: %s\n" % str(e2))
raise
@@ -917,14 +932,14 @@ def connect(args):
execute(args)
return
- print """\
+ print ("""\
Connected to %s.
Type 'Ctrl + ]' to detach from the console.
""" % ( args.name )
os.execl("/usr/libexec/virt-sandbox-service-util",
"virt-sandbox-service-util",
"-c", args.uri,
- "-a", args.name)
+ "-a", args.name))
#
# Search Path for command to execute within the container.
@@ -1008,7 +1023,7 @@ def clone(args):
newcontainer.set_security(args.security)
newcontainer.set_security_label()
newcontainer.save_config()
- except Exception, e:
+ except Exception as e:
if newcontainer is not None:
newcontainer.delete()
raise
@@ -1290,23 +1305,21 @@ if __name__ == '__main__':
sys.exit(1)
args.func(args)
sys.exit(0)
- except KeyboardInterrupt, e:
+ except KeyboardInterrupt as e:
sys.exit(0)
- except ValueError, e:
- for line in e:
- for l in line:
- sys.stderr.write("%s: %s\n" % (sys.argv[0], l))
+ except ValueError as e:
+ sys.stderr.write("%s: %s\n" % (sys.argv[0], e))
sys.stderr.flush()
sys.exit(1)
- except IOError, e:
+ except IOError as e:
sys.stderr.write("%s: %s: %s\n" % (sys.argv[0], e.filename, e.strerror))
sys.stderr.flush()
sys.exit(1)
- except OSError, e:
+ except OSError as e:
sys.stderr.write("%s: %s\n" % (sys.argv[0], e))
sys.stderr.flush()
sys.exit(1)
- except GLib.GError, e:
+ except GLib.GError as e:
sys.stderr.write("%s: %s\n" % (sys.argv[0], e))
sys.stderr.flush()
sys.exit(1)