From 4d780bcf836cc93762cb738e78320b4adb6a4c29 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20R=C4=99korajski?= Date: Sat, 29 Jul 2023 14:55:52 +0200 Subject: [PATCH] - up to 6.23.0 --- calibre-locales.patch | 16 +++++++++++----- calibre.spec | 11 ++++++++--- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/calibre-locales.patch b/calibre-locales.patch index 9c4f74c..f95f784 100644 --- a/calibre-locales.patch +++ b/calibre-locales.patch @@ -16,8 +16,8 @@ diff -urNp -x '*.orig' calibre-4.20.0.org/setup/translations.py calibre-4.20.0/s self.compile_website_translations() self.compile_changelog_translations() @@ -539,15 +538,6 @@ class Translations(POT): # {{{ - rmap[msgstr] = msgid - return not has_errors + zi.compress_type = ZIP_STORED if is_ci else ZIP_DEFLATED + zf.writestr(zi, raw) - def freeze_locales(self): - zf = self.DEST + '.zip' @@ -38,7 +38,7 @@ diff -urNp -x '*.orig' calibre-4.20.0.org/src/calibre/translations/dynamic.py ca else: mpath = get_lc_messages_path(lang) if mpath is not None: -- with ZipFile(P('localization/locales.zip', +- with ZipFile(get_path('localization/locales.zip', - allow_user_override=False), 'r') as zf: - try: - buf = io.BytesIO(zf.read(mpath + '/messages.mo')) @@ -90,7 +90,7 @@ diff -urNp -x '*.orig' calibre-4.20.0.org/src/calibre/utils/localization.py cali + return None - _lang_trans = None + _lang_trans = _country_trans = None def get_all_translators(): @@ -130,7 +130,7 @@ diff -urNp -x '*.orig' calibre-4.20.0.org/src/calibre/utils/localization.py cali def get_iso639_translator(lang): -@@ -219,22 +210,21 @@ def translator_for_lang(lang): +@@ -219,27 +210,25 @@ def translator_for_lang(lang): buf = load_po(mpath + '.po') if mpath is not None: @@ -152,6 +152,12 @@ diff -urNp -x '*.orig' calibre-4.20.0.org/src/calibre/utils/localization.py cali + iso639 = open(os.path.join(mpath, 'calibre_iso639.mo'), 'rb') except: pass # No iso639 translations for this lang +- isof = mpath + '/iso3166.mo' + try: +- iso3166 = io.BytesIO(zf.read(isof)) ++ iso3166 = open(os.path.join(mpath, 'calibre_iso3166.mo'), 'rb') + except: + pass # No iso3166 translations for this lang if buf is not None: from calibre.utils.serialize import msgpack_loads try: diff --git a/calibre.spec b/calibre.spec index 57b7436..c30ac71 100644 --- a/calibre.spec +++ b/calibre.spec @@ -11,12 +11,12 @@ Summary: E-book converter and library management Summary(pl.UTF-8): Konwerter oraz biblioteka dla e-booków Name: calibre -Version: 6.10.0 -Release: 4 +Version: 6.23.0 +Release: 1 License: GPL v3+ Group: Applications/Multimedia Source0: %{name}-%{version}-nofonts.tar.xz -# Source0-md5: f35bd1a5f0096413b0ccb3924754b340 +# Source0-md5: e0a8b9d98f888d1996e3a594edf13cb5 Source1: generate-tarball.sh Source2: %{name}-mount-helper Patch0: %{name}-prefix.patch @@ -246,6 +246,11 @@ for file in $RPM_BUILD_ROOT%{_localedir}/*/LC_MESSAGES/iso639.mo; do %{__mv} $RPM_BUILD_ROOT%{_localedir}/$lang/LC_MESSAGES/iso639.mo \ $RPM_BUILD_ROOT%{_localedir}/$lang/LC_MESSAGES/%{name}_iso639.mo done; +for file in $RPM_BUILD_ROOT%{_localedir}/*/LC_MESSAGES/iso3166.mo; do + lang=$(echo $file|%{__sed} 's:.*locale/\(.*\)/LC_MESSAGES.*:\1:') + %{__mv} $RPM_BUILD_ROOT%{_localedir}/$lang/LC_MESSAGES/iso3166.mo \ + $RPM_BUILD_ROOT%{_localedir}/$lang/LC_MESSAGES/%{name}_iso3166.mo +done; %{__rm} -r $RPM_BUILD_ROOT%{_localedir}/{km_KH,km} # duplicates of bn,sl -- 2.43.0