Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package alacarte for openSUSE:Factory checked in at 2021-11-27 00:51:44 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/alacarte (Old) and /work/SRC/openSUSE:Factory/.alacarte.new.1895 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "alacarte" Sat Nov 27 00:51:44 2021 rev:68 rq:934066 version:3.42.0 Changes: -------- --- /work/SRC/openSUSE:Factory/alacarte/alacarte.changes 2021-11-11 21:39:34.317026491 +0100 +++ /work/SRC/openSUSE:Factory/.alacarte.new.1895/alacarte.changes 2021-11-27 00:52:39.818524619 +0100 @@ -1,0 +2,12 @@ +Tue Nov 23 16:17:54 UTC 2021 - Bj??rn Lie <[email protected]> + +- Update to version 3.42.0: + + Fix icon size in launcher properties window + + Resize input field with launcher dialog + + Support Python 3.10+ + + Updated translations. +- Drop alacarte-trans.patch: No longer needed as we do not use + translation-update-upstream any more. +- Modernize spec, fixup fdupes call, build as noarch. + +------------------------------------------------------------------- Old: ---- alacarte-3.36.0.tar.xz alacarte-trans.patch New: ---- alacarte-3.42.0.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ alacarte.spec ++++++ --- /var/tmp/diff_new_pack.XFy9EN/_old 2021-11-27 00:52:40.362522741 +0100 +++ /var/tmp/diff_new_pack.XFy9EN/_new 2021-11-27 00:52:40.362522741 +0100 @@ -17,15 +17,14 @@ Name: alacarte -Version: 3.36.0 +Version: 3.42.0 Release: 0 Summary: Menu editor for GNOME License: LGPL-2.1-or-later Group: System/GUI/GNOME URL: https://gitlab.gnome.org/GNOME/alacarte -Source: https://download.gnome.org/sources/alacarte/3.36/%{name}-%{version}.tar.xz -# PATCH-FIX-OPENSUSE alacarte-trans.patch bnc#947793 [email protected] -- Fix untranslated messages -Patch0: alacarte-trans.patch +Source: https://download.gnome.org/sources/alacarte/3.42/%{name}-%{version}.tar.xz + BuildRequires: fdupes BuildRequires: glib2-devel # Needed for the typelib() dependency parser @@ -40,6 +39,7 @@ BuildRequires: pkgconfig(libgnome-menu-3.0) >= 3.5.3 BuildRequires: pkgconfig(pygobject-3.0) Requires: python3-gobject-Gdk +BuildArch: noarch %description Alacarte is a simple freedesktop.org compliant menu editor for GNOME @@ -49,18 +49,17 @@ %lang_package %prep -%setup -q -%patch0 -p1 +%autosetup -p1 %build %configure -make %{?_smp_mflags} +%make_build %install %make_install %suse_update_desktop_file -r alacarte GNOME Utility DesktopUtility X-GNOME-PersonalSettings %find_lang %{name} %{?no_lang_C} -%fdupes %{buildroot} +%fdupes %{buildroot}%{_prefix} %files %license COPYING ++++++ alacarte-3.36.0.tar.xz -> alacarte-3.42.0.tar.xz ++++++ ++++ 8565 lines of diff (skipped) ++++ retrying with extended exclude list diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/alacarte-3.36.0/Alacarte/ItemEditor.py new/alacarte-3.42.0/Alacarte/ItemEditor.py --- old/alacarte-3.36.0/Alacarte/ItemEditor.py 2020-02-13 20:53:20.000000000 +0100 +++ new/alacarte-3.42.0/Alacarte/ItemEditor.py 2021-11-23 16:11:02.000000000 +0100 @@ -16,11 +16,12 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +import cairo import gettext import os import gi gi.require_version('Gtk', '3.0') -from gi.repository import GLib, GObject, Gtk +from gi.repository import GLib, GObject, Gtk, Gdk, GdkPixbuf from Alacarte import config, util _ = gettext.gettext @@ -66,9 +67,26 @@ else: return icon +def set_icon_file(image, file_name): + scale = image.get_scale_factor() + size = 64 * scale + + pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_size(file_name, size, size) + surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, size, size) + + context = cairo.Context(surface) + Gdk.cairo_set_source_pixbuf(context, + pixbuf, + (size - pixbuf.get_width()) / 2, + (size - pixbuf.get_height()) / 2) + context.paint() + + surface.set_device_scale(scale, scale) + image.props.surface = surface + def set_icon_string(image, icon): if GLib.path_is_absolute(icon): - image.props.file = icon + set_icon_file(image, icon) else: image.props.icon_name = strip_extensions(icon) @@ -89,7 +107,7 @@ Gtk.STOCK_OK, Gtk.ResponseType.ACCEPT)) response = chooser.run() if response == Gtk.ResponseType.ACCEPT: - self.image.props.file = chooser.get_filename() + set_icon_file(self.image, chooser.get_filename()) chooser.destroy() class ItemEditor(GObject.GObject): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/alacarte-3.36.0/Alacarte/util.py new/alacarte-3.42.0/Alacarte/util.py --- old/alacarte-3.36.0/Alacarte/util.py 2020-02-13 20:53:20.000000000 +0100 +++ new/alacarte-3.42.0/Alacarte/util.py 2021-11-23 16:11:02.000000000 +0100 @@ -18,7 +18,7 @@ import os import xml.dom.minidom -from collections import Sequence +from collections.abc import Sequence import gi gi.require_version('Gtk', '3.0') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/alacarte-3.36.0/ChangeLog new/alacarte-3.42.0/ChangeLog --- old/alacarte-3.36.0/ChangeLog 2020-03-05 17:16:46.000000000 +0100 +++ new/alacarte-3.42.0/ChangeLog 2021-11-23 16:19:32.000000000 +0100 @@ -1,6 +1,52 @@ +commit 0225d87182a2c208e1d7d802c174899bd34fa8ed +Author: Alberts Muktup??vels <[email protected]> +Date: 2021-11-23 + + 3.42.0 + +M NEWS +M configure.ac + +commit 47e9e4995719c7addac3ad9841728d753fb0dc3f +Author: SubOptimal <[email protected]> +Date: 2021-11-15 + + ItemEditor: resize input fields with launcher dialog + + https://gitlab.gnome.org/GNOME/alacarte/-/issues/5 + +M data/launcher-editor.ui + +commit 94c1c1e385557ebb36ad0b41dc098381ef258f6e +Author: GnomeHiker94 <[email protected]> +Date: 2021-11-10 + + util: update import collections to collections.abc + +M Alacarte/util.py +M configure.ac + +commit ae6b92daad3f53c025f59cfbb674ba3de7dcb8a4 +Author: Alberts Muktup??vels <[email protected]> +Date: 2020-07-29 + + ItemEditor: load icon file in correct size + + https://gitlab.gnome.org/GNOME/alacarte/-/issues/4 + +M Alacarte/ItemEditor.py + +commit 46a7d0d12b00da65ec1bf56aa66fcd8f7c1cbea7 +Author: Bal??zs ??r <[email protected]> +Date: 2020-03-07 + + Update Hungarian translation + +M po/hu.po + commit 7b5fc64998833c2098ea36717da745d8d6152897 Author: Alberts Muktup??vels <[email protected]> -Date: 2020-03-05 +Date: 2020-03-05 3.36.0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/alacarte-3.36.0/INSTALL new/alacarte-3.42.0/INSTALL --- old/alacarte-3.36.0/INSTALL 2020-03-05 17:16:34.000000000 +0100 +++ new/alacarte-3.42.0/INSTALL 2021-11-23 16:19:24.000000000 +0100 @@ -1,8 +1,8 @@ Installation Instructions ************************* - Copyright (C) 1994-1996, 1999-2002, 2004-2016 Free Software -Foundation, Inc. + Copyright (C) 1994-1996, 1999-2002, 2004-2017, 2020-2021 Free +Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright @@ -225,7 +225,7 @@ and if that doesn't work, install pre-built binaries of GCC for HP-UX. - HP-UX 'make' updates targets which have the same time stamps as their + HP-UX 'make' updates targets which have the same timestamps as their prerequisites, which makes it generally unusable when shipped generated files such as 'configure' are involved. Use GNU 'make' instead. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/alacarte-3.36.0/NEWS new/alacarte-3.42.0/NEWS --- old/alacarte-3.36.0/NEWS 2020-03-05 17:12:38.000000000 +0100 +++ new/alacarte-3.42.0/NEWS 2021-11-23 16:18:12.000000000 +0100 @@ -1,4 +1,16 @@ ============== +Version 3.42.0 +============== + +Changes: + * Fix icon size in launcher properties window (#4) + * Resize input field with launcher dialog (#5) + * Support Python 3.10+ (!6) + +Translation updates: + * Hungarian + +============== Version 3.36.0 ============== diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/alacarte-3.36.0/compile new/alacarte-3.42.0/compile --- old/alacarte-3.36.0/compile 2020-03-05 17:16:34.000000000 +0100 +++ new/alacarte-3.42.0/compile 2021-11-23 16:19:24.000000000 +0100 @@ -3,7 +3,7 @@ scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1999-2018 Free Software Foundation, Inc. +# Copyright (C) 1999-2021 Free Software Foundation, Inc. # Written by Tom Tromey <[email protected]>. # # This program is free software; you can redistribute it and/or modify @@ -53,7 +53,7 @@ MINGW*) file_conv=mingw ;; - CYGWIN*) + CYGWIN* | MSYS*) file_conv=cygwin ;; *) @@ -67,7 +67,7 @@ mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; - cygwin/*) + cygwin/* | msys/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/alacarte-3.36.0/config.h.in new/alacarte-3.42.0/config.h.in --- old/alacarte-3.36.0/config.h.in 2020-03-05 17:16:34.000000000 +0100 +++ new/alacarte-3.42.0/config.h.in 2021-11-23 16:19:24.000000000 +0100 @@ -32,12 +32,12 @@ /* Define to 1 if you have the <locale.h> header file. */ #undef HAVE_LOCALE_H -/* Define to 1 if you have the <memory.h> header file. */ -#undef HAVE_MEMORY_H - /* Define to 1 if you have the <stdint.h> header file. */ #undef HAVE_STDINT_H +/* Define to 1 if you have the <stdio.h> header file. */ +#undef HAVE_STDIO_H + /* Define to 1 if you have the <stdlib.h> header file. */ #undef HAVE_STDLIB_H @@ -77,7 +77,9 @@ /* Define to the version of this package. */ #undef PACKAGE_VERSION -/* Define to 1 if you have the ANSI C header files. */ +/* Define to 1 if all of the C90 standard headers exist (not just the ones + required in a freestanding environment). This macro is provided for + backward compatibility; new code need not use it. */ #undef STDC_HEADERS /* Version number of package */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/alacarte-3.36.0/configure.ac new/alacarte-3.42.0/configure.ac --- old/alacarte-3.36.0/configure.ac 2020-03-05 17:15:52.000000000 +0100 +++ new/alacarte-3.42.0/configure.ac 2021-11-23 16:12:09.000000000 +0100 @@ -1,7 +1,7 @@ dnl -*- Mode: autoconf -*- dnl Process this file with autoconf to produce a configure script. AC_PREREQ(2.53) -AC_INIT(alacarte, 3.36.0, http://bugzilla.gnome.org/enter_bug.cgi?product=alacarte) +AC_INIT(alacarte, 3.42.0, http://bugzilla.gnome.org/enter_bug.cgi?product=alacarte) m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])]) AC_CONFIG_SRCDIR(alacarte.in) AC_CONFIG_HEADERS([config.h]) @@ -18,7 +18,7 @@ AM_GLIB_GNU_GETTEXT IT_PROG_INTLTOOL([0.40.0]) -AM_PATH_PYTHON(3.2) +AM_PATH_PYTHON(3.3) PKG_CHECK_MODULES(ALACARTE, libgnome-menu-3.0 >= 3.5.3 pygobject-3.0) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/alacarte-3.36.0/data/launcher-editor.ui new/alacarte-3.42.0/data/launcher-editor.ui --- old/alacarte-3.36.0/data/launcher-editor.ui 2020-02-13 20:53:20.000000000 +0100 +++ new/alacarte-3.42.0/data/launcher-editor.ui 2021-11-23 16:11:02.000000000 +0100 @@ -199,6 +199,7 @@ <object class="GtkEntry" id="comment-entry"> <property name="visible">True</property> <property name="can_focus">True</property> + <property name="hexpand">True</property> <property name="invisible_char">???</property> </object> <packing> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/alacarte-3.36.0/missing new/alacarte-3.42.0/missing --- old/alacarte-3.36.0/missing 2020-03-05 17:16:34.000000000 +0100 +++ new/alacarte-3.42.0/missing 2021-11-23 16:19:24.000000000 +0100 @@ -3,7 +3,7 @@ scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1996-2018 Free Software Foundation, Inc. +# Copyright (C) 1996-2021 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard <[email protected]>, 1996. # This program is free software; you can redistribute it and/or modify diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/alacarte-3.36.0/po/hu.po new/alacarte-3.42.0/po/hu.po --- old/alacarte-3.36.0/po/hu.po 2020-02-13 20:53:20.000000000 +0100 +++ new/alacarte-3.42.0/po/hu.po 2021-11-23 16:11:02.000000000 +0100 @@ -1,43 +1,42 @@ -# Hungarian translation for alacarte -# Copyright (c) (c) 2006 Canonical Ltd, and Rosetta Contributors 2006 +# Hungarian translation for alacarte. +# Copyright (C) 2006, 2007, 2012, 2013, 2020 Free Software Foundation, Inc. # This file is distributed under the same license as the alacarte package. # -# Gabor Burj??n <[email protected]>, 2006. -# Gabor Kelemen <[email protected]>, 2006, 2007. -# Bal??zs ??r <urbalazs at gmail dot com>, 2012, 2013. +# Gabor Burj??n <buga at buvoshetes dot hu>, 2006. +# Gabor Kelemen <kelemeng at gnome dot hu>, 2006, 2007. +# Bal??zs ??r <ur.balazs at fsf dot hu>, 2012, 2013, 2020. msgid "" msgstr "" "Project-Id-Version: alacarte\n" -"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?" -"product=alacarte&keywords=I18N+L10N&component=general\n" -"POT-Creation-Date: 2013-01-11 06:39+0000\n" -"PO-Revision-Date: 2013-01-13 11:50+0100\n" -"Last-Translator: Bal??zs ??r <urbalazs at gmail dot com>\n" -"Language-Team: Hungarian <[email protected]>\n" +"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/alacarte/issues\n" +"POT-Creation-Date: 2020-03-05 16:18+0000\n" +"PO-Revision-Date: 2020-03-07 22:11+0100\n" +"Last-Translator: Bal??zs ??r <ur.balazs at fsf dot hu>\n" +"Language-Team: Hungarian <gnome-hu-list at gnome dot org>\n" "Language: hu\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Generator: Lokalize 1.2\n" +"X-Generator: Lokalize 19.04.3\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: ../Alacarte/MainWindow.py:159 +#: ../Alacarte/MainWindow.py:156 msgid "Name" msgstr "N??v" -#: ../Alacarte/MainWindow.py:172 +#: ../Alacarte/MainWindow.py:169 msgid "Show" msgstr "L??that??" -#: ../Alacarte/MainWindow.py:180 +#: ../Alacarte/MainWindow.py:177 msgid "Item" msgstr "Elem" -#: ../Alacarte/ItemEditor.py:85 +#: ../Alacarte/ItemEditor.py:86 msgid "Choose an icon" msgstr "V??lasszon ikont" -#: ../Alacarte/ItemEditor.py:198 +#: ../Alacarte/ItemEditor.py:215 msgid "Choose a command" msgstr "V??lasszon parancsot" @@ -50,26 +49,30 @@ msgstr "Alkalmaz??sok hozz??ad??sa vagy elt??vol??t??sa a f??men??b??l" #: ../data/alacarte.ui.h:2 +msgid "Restore System Configuration" +msgstr "Rendszerbe??ll??t??sok vissza??ll??t??sa" + +#: ../data/alacarte.ui.h:3 msgid "Restore the default menu layout" msgstr "Az alap??rtelmezett men??elrendez??s vissza??ll??t??sa" -#: ../data/alacarte.ui.h:3 +#: ../data/alacarte.ui.h:4 msgid "_New Menu" msgstr "??j _men??" -#: ../data/alacarte.ui.h:4 +#: ../data/alacarte.ui.h:5 msgid "Ne_w Item" msgstr "??_j elem" -#: ../data/alacarte.ui.h:5 +#: ../data/alacarte.ui.h:6 msgid "New _Separator" msgstr "??j _elv??laszt??" -#: ../data/alacarte.ui.h:6 +#: ../data/alacarte.ui.h:7 msgid "Move Down" msgstr "Lefel??" -#: ../data/alacarte.ui.h:7 +#: ../data/alacarte.ui.h:8 msgid "Move Up" msgstr "Felfel??" @@ -78,7 +81,6 @@ msgstr "Ind??t??ikon tulajdons??gai" #: ../data/launcher-editor.ui.h:2 ../data/directory-editor.ui.h:2 -#| msgid "Name" msgid "Name:" msgstr "N??v:" @@ -101,21 +103,3 @@ #: ../data/directory-editor.ui.h:1 msgid "Directory Properties" msgstr "K??nyvt??r tulajdons??gai" - -#~ msgid "Restore System Configuration" -#~ msgstr "Rendszerbe??ll??t??sok vissza??ll??t??sa" - -#~ msgid "It_ems:" -#~ msgstr "_Elemek:" - -#~ msgid "Revert Changes?" -#~ msgstr "Visszavonja a m??dos??t??sokat?" - -#~ msgid "Revert all menus to original settings?" -#~ msgstr "Vissza??ll??tja a men??k eredeti ??llapot??t?" - -#~ msgid "_Menus:" -#~ msgstr "_Men??k:" - -#~ msgid "_Revert to Original" -#~ msgstr "_Visszat??r??s az eredeti ??llapothoz" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/alacarte-3.36.0/py-compile new/alacarte-3.42.0/py-compile --- old/alacarte-3.36.0/py-compile 2020-03-05 17:16:34.000000000 +0100 +++ new/alacarte-3.42.0/py-compile 2021-11-23 16:19:24.000000000 +0100 @@ -1,9 +1,9 @@ #!/bin/sh # py-compile - Compile a Python program -scriptversion=2018-03-07.03; # UTC +scriptversion=2021-02-27.01; # UTC -# Copyright (C) 2000-2018 Free Software Foundation, Inc. +# Copyright (C) 2000-2021 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -27,7 +27,7 @@ # bugs to <[email protected]> or send patches to # <[email protected]>. -if [ -z "$PYTHON" ]; then +if test -z "$PYTHON"; then PYTHON=python fi @@ -96,27 +96,46 @@ files=$* if test -z "$files"; then - usage_error "no files given" + usage_error "no files given" fi # if basedir was given, then it should be prepended to filenames before # byte compilation. -if [ -z "$basedir" ]; then - pathtrans="path = file" +if test -z "$basedir"; then + pathtrans="path = file" else - pathtrans="path = os.path.join('$basedir', file)" + pathtrans="path = os.path.join('$basedir', file)" fi # if destdir was given, then it needs to be prepended to the filename to # byte compile but not go into the compiled file. -if [ -z "$destdir" ]; then - filetrans="filepath = path" +if test -z "$destdir"; then + filetrans="filepath = path" else - filetrans="filepath = os.path.normpath('$destdir' + os.sep + path)" + filetrans="filepath = os.path.normpath('$destdir' + os.sep + path)" +fi + +python_major=`$PYTHON -V 2>&1 | sed -e 's/.* //;s/\..*$//;1q'` +if test -z "$python_major"; then + echo "$me: could not determine $PYTHON major version, guessing 3" >&2 + python_major=3 +fi + +# The old way to import libraries was deprecated. +if test "$python_major" -le 2; then + import_lib=imp + import_test="hasattr(imp, 'get_tag')" + import_call=imp.cache_from_source + import_arg2=', False' # needed in one call and not the other +else + import_lib=importlib + import_test="hasattr(sys.implementation, 'cache_tag')" + import_call=importlib.util.cache_from_source + import_arg2= fi $PYTHON -c " -import sys, os, py_compile, imp +import sys, os, py_compile, $import_lib files = '''$files''' @@ -129,15 +148,15 @@ continue sys.stdout.write(file) sys.stdout.flush() - if hasattr(imp, 'get_tag'): - py_compile.compile(filepath, imp.cache_from_source(filepath), path) + if $import_test: + py_compile.compile(filepath, $import_call(filepath), path) else: py_compile.compile(filepath, filepath + 'c', path) sys.stdout.write('\n')" || exit $? # this will fail for python < 1.5, but that doesn't matter ... $PYTHON -O -c " -import sys, os, py_compile, imp +import sys, os, py_compile, $import_lib # pypy does not use .pyo optimization if hasattr(sys, 'pypy_translation_info'): @@ -153,11 +172,11 @@ continue sys.stdout.write(file) sys.stdout.flush() - if hasattr(imp, 'get_tag'): - py_compile.compile(filepath, imp.cache_from_source(filepath, False), path) + if $import_test: + py_compile.compile(filepath, $import_call(filepath$import_arg2), path) else: py_compile.compile(filepath, filepath + 'o', path) -sys.stdout.write('\n')" 2>/dev/null || : +sys.stdout.write('\n')" 2>/dev/null || exit $? # Local Variables: # mode: shell-script
