Hello community, here is the log from the commit of package alacarte for openSUSE:Factory checked in at 2018-02-02 22:21:40 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/alacarte (Old) and /work/SRC/openSUSE:Factory/.alacarte.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "alacarte" Fri Feb 2 22:21:40 2018 rev:61 rq:571675 version:3.11.91 Changes: -------- --- /work/SRC/openSUSE:Factory/alacarte/alacarte.changes 2017-09-15 21:06:20.109573176 +0200 +++ /work/SRC/openSUSE:Factory/.alacarte.new/alacarte.changes 2018-02-02 22:21:42.335490726 +0100 @@ -1,0 +2,13 @@ +Mon Jan 15 19:05:09 UTC 2018 - mgorse@suse.com + +- Migrate to python3 (bsc#1075771): + + Add alacarte-python3.patch: convert the code to be py3 + compatible. + + Update alacarte-trans.patch: Don't use tab for indentation. + + Add autoconf and automake BuildRequires and call autoreconf in + build section: needed, since above patches touch the build + system. + + Replace python BuildRequires with python3. + + Add python3-gobject-Gdk Requires: new dependency. + +------------------------------------------------------------------- New: ---- alacarte-python3.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ alacarte.spec ++++++ --- /var/tmp/diff_new_pack.hKisyB/_old 2018-02-02 22:21:43.131453565 +0100 +++ /var/tmp/diff_new_pack.hKisyB/_new 2018-02-02 22:21:43.131453565 +0100 @@ -1,7 +1,7 @@ # # spec file for package alacarte # -# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2018 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 @@ -28,6 +28,8 @@ Patch0: alacarte-trans.patch # PATCH-FIX-UPSTREAM fix-bad-command-validation.patch bsc#1057908 bgo#728372 qzheng@suse.com -- Fix bad command validation Patch1: fix-bad-command-validation.patch +# PATCH-FIX-UPSTREAM alacarte-python3.patch bsc#1075771 bgo#787490 mgorse@suse.com -- Support python 3. +Patch2: alacarte-python3.patch BuildRequires: fdupes BuildRequires: glib2-devel # Needed for the typelib() dependency parser @@ -35,17 +37,18 @@ # Needed for %%icon_theme_cache_* macros. BuildRequires: hicolor-icon-theme BuildRequires: intltool -BuildRequires: python +BuildRequires: python3 BuildRequires: suse-xsl-stylesheets BuildRequires: translation-update-upstream BuildRequires: update-desktop-files BuildRequires: pkgconfig(libgnome-menu-3.0) >= 3.5.3 BuildRequires: pkgconfig(pygobject-3.0) -Requires: python-gobject-Gdk -Requires: python-xml +# Needed for Patch2 +BuildRequires: autoconf +BuildRequires: automake +Requires: python3-gobject-Gdk Recommends: %{name}-lang BuildRoot: %{_tmppath}/%{name}-%{version}-build -%py_requires %description Alacarte is a simple freedesktop.org compliant menu editor for GNOME @@ -58,8 +61,11 @@ translation-update-upstream %patch0 -p1 %patch1 -p1 +%patch2 -p1 %build +# needed for Patch2 +autoreconf -fi %configure make %{?_smp_mflags} @@ -84,7 +90,7 @@ %{_datadir}/alacarte %{_datadir}/applications/alacarte.desktop %{_datadir}/icons/hicolor/*/*/*.* -%{python_sitelib}/Alacarte +%{python3_sitelib}/Alacarte %{_mandir}/man1/alacarte.1%{?ext_man} %files lang -f %name.lang ++++++ alacarte-python3.patch ++++++ From b2af67fd6bc6667343f3850ce981f51af0f5c155 Mon Sep 17 00:00:00 2001 From: e < ýhÏU> Date: Sat, 9 Sep 2017 19:59:06 -0500 Subject: [PATCH] util.py and acinclude.m4: Support Python 3 --- .gitignore | 2 ++ Alacarte/util.py | 7 +++++++ acinclude.m4 | 4 ++-- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Alacarte/util.py b/Alacarte/util.py index 0d98d56..3bbb943 100644 --- a/Alacarte/util.py +++ b/Alacarte/util.py @@ -24,6 +24,13 @@ import gi gi.require_version('Gtk', '3.0') from gi.repository import Gtk, GdkPixbuf, GMenu, GLib +# Python 2/3 compatibility +try: + basestring +except NameError: + # Must be python3 + basestring = (str, bytes) + DESKTOP_GROUP = GLib.KEY_FILE_DESKTOP_GROUP KEY_FILE_FLAGS = GLib.KeyFileFlags.KEEP_COMMENTS | GLib.KeyFileFlags.KEEP_TRANSLATIONS diff --git a/acinclude.m4 b/acinclude.m4 index 372e0b2..b6eaa4f 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -69,7 +69,7 @@ AC_DEFUN([AM_PATH_PYTHON_VERSION], dnl library. AC_CACHE_CHECK([for $am_display_PYTHON version], [am_cv_python_version], - [am_cv_python_version=`$PYTHON -c "import sys; print sys.version[[:3]]"`]) + [am_cv_python_version=`$PYTHON -c "import sys; print(sys.version[[:3]])"`]) AC_SUBST([PYTHON_VERSION], [$am_cv_python_version]) dnl Use the values of $prefix and $exec_prefix for the corresponding @@ -84,7 +84,7 @@ AC_DEFUN([AM_PATH_PYTHON_VERSION], dnl to know which OS platform Python thinks this is. AC_CACHE_CHECK([for $am_display_PYTHON platform], [am_cv_python_platform], - [am_cv_python_platform=`$PYTHON -c "import sys; print sys.platform"`]) + [am_cv_python_platform=`$PYTHON -c "import sys; print(sys.platform)"`]) AC_SUBST([PYTHON_PLATFORM], [$am_cv_python_platform]) diff -urp alacarte-3.11.91.orig/configure.ac alacarte-3.11.91/configure.ac --- alacarte-3.11.91.orig/configure.ac 2014-03-03 07:01:44.000000000 -0600 +++ alacarte-3.11.91/configure.ac 2018-01-14 21:03:34.122761459 -0600 @@ -18,7 +18,7 @@ AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GE AM_GLIB_GNU_GETTEXT IT_PROG_INTLTOOL([0.40.0]) -AM_PATH_PYTHON_VERSION(2.7, 2.7.0, 2.6, 2.6.0, 2.5, 2.5.0, 2.4, 2.4.0) +AM_PATH_PYTHON_VERSION(3.6, 3.6.0, 2.7, 2.7.0, 2.6, 2.6.0, 2.5, 2.5.0, 2.4, 2.4.0) PKG_CHECK_MODULES(ALACARTE, libgnome-menu-3.0 >= 3.5.3 pygobject-3.0) diff -urp alacarte-3.11.91.orig/Alacarte/MainWindow.py alacarte-3.11.91/Alacarte/MainWindow.py --- alacarte-3.11.91.orig/Alacarte/MainWindow.py 2014-02-27 18:30:39.000000000 -0600 +++ alacarte-3.11.91/Alacarte/MainWindow.py 2018-01-15 13:01:45.176198435 -0600 @@ -239,7 +239,7 @@ class MainWindow(object): menu_tree.get_selection().select_path((0,)) else: parent = menus[iter][2] - file_name = util.getUniqueFileId('alacarte-made', '.directory') + file_name = util.getUniqueFileId('alacarte-made', '.directory') file_path = os.path.join(util.getUserDirectoryPath(), file_name) editor = DirectoryEditor(self.main_window, file_path) ++++++ alacarte-trans.patch ++++++ --- /var/tmp/diff_new_pack.hKisyB/_old 2018-02-02 22:21:43.171451698 +0100 +++ /var/tmp/diff_new_pack.hKisyB/_new 2018-02-02 22:21:43.175451511 +0100 @@ -15,7 +15,7 @@ def __init__(self, parent, item_path): GObject.GObject.__init__(self) self.builder = Gtk.Builder() -+ self.builder.set_translation_domain(config.GETTEXT_PACKAGE) ++ self.builder.set_translation_domain(config.GETTEXT_PACKAGE) self.builder.add_from_file(os.path.join(config.pkgdatadir, self.ui_file)) self.dialog = self.builder.get_object('editor')