From 75dfafe92aed8ea33d058731a83fcb580d26a1b6 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: May 20 2020 12:01:36 +0000 Subject: import gettext-0.19.8.1-3.el7 --- diff --git a/SOURCES/disable-gettext-runtime-test-lock.patch b/SOURCES/disable-gettext-runtime-test-lock.patch index ec3a59b..b59f170 100644 --- a/SOURCES/disable-gettext-runtime-test-lock.patch +++ b/SOURCES/disable-gettext-runtime-test-lock.patch @@ -1,16 +1,8 @@ -commit bd2c6ca2b7ae0be02d4bb85db79def454f3153fb -Author: rpm-build -AuthorDate: Wed Dec 21 12:50:54 2016 +0100 -Commit: rpm-build -CommitDate: Wed Dec 21 12:52:36 2016 +0100 - - disable-gettext-runtime-test-lock.patch - -diff --git a/gettext-runtime/tests/Makefile.am b/gettext-runtime/tests/Makefile.am -index 88a0684..3a27b79 100644 ---- a/gettext-runtime/tests/Makefile.am -+++ b/gettext-runtime/tests/Makefile.am -@@ -19,7 +19,7 @@ +Index: gettext-0.19.7/gettext-runtime/tests/Makefile.am +=================================================================== +--- gettext-0.19.7.orig/gettext-runtime/tests/Makefile.am ++++ gettext-0.19.7/gettext-runtime/tests/Makefile.am +@@ -20,7 +20,7 @@ AUTOMAKE_OPTIONS = 1.11 gnits no-dependencies color-tests subdir-objects EXTRA_DIST = @@ -19,10 +11,10 @@ index 88a0684..3a27b79 100644 AM_CPPFLAGS = \ -I.. \ -diff --git a/gettext-runtime/tests/Makefile.in b/gettext-runtime/tests/Makefile.in -index 4327733..5879146 100644 ---- a/gettext-runtime/tests/Makefile.in -+++ b/gettext-runtime/tests/Makefile.in +Index: gettext-0.19.7/gettext-runtime/tests/Makefile.in +=================================================================== +--- gettext-0.19.7.orig/gettext-runtime/tests/Makefile.in ++++ gettext-0.19.7/gettext-runtime/tests/Makefile.in @@ -86,7 +86,7 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ @@ -32,16 +24,3 @@ index 4327733..5879146 100644 check_PROGRAMS = test-lock$(EXEEXT) subdir = tests ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -diff --git a/gettext-tools/gnulib-tests/Makefile.in b/gettext-tools/gnulib-tests/Makefile.in -index 26becd9..4b9d0e4 100644 ---- a/gettext-tools/gnulib-tests/Makefile.in -+++ b/gettext-tools/gnulib-tests/Makefile.in -@@ -143,7 +143,7 @@ TESTS = test-set-mode-acl.sh test-set-mode-acl-1.sh \ - test-isnanl-nolibm$(EXEEXT) test-isnanl$(EXEEXT) \ - test-iswblank$(EXEEXT) test-langinfo$(EXEEXT) \ - test-linkedhash_list$(EXEEXT) test-locale$(EXEEXT) \ -- test-localename$(EXEEXT) test-lock$(EXEEXT) \ -+ test-localename$(EXEEXT) \ - test-log10$(EXEEXT) test-lseek.sh test-lstat$(EXEEXT) \ - test-malloca$(EXEEXT) test-math$(EXEEXT) test-mbrtowc1.sh \ - test-mbrtowc2.sh test-mbrtowc3.sh test-mbrtowc4.sh \ diff --git a/SOURCES/gettext-0.19.8-its-segfault.patch b/SOURCES/gettext-0.19.8-its-segfault.patch deleted file mode 100644 index 430719f..0000000 --- a/SOURCES/gettext-0.19.8-its-segfault.patch +++ /dev/null @@ -1,43 +0,0 @@ -From a0cab23332a254e3500cac2a3a984472d02180e5 Mon Sep 17 00:00:00 2001 -From: Bruno Haible -Date: Fri, 9 Dec 2016 21:04:31 +0100 -Subject: [PATCH] Fix crash of xgettext with --its option. - -* gettext-tools/src/xgettext.c (main): Free contents of its_dirs only when it -was initialized. Fixes bug introduced on 2016-05-16. ---- - gettext-tools/src/xgettext.c | 11 +++++++---- - 1 file changed, 7 insertions(+), 4 deletions(-) - -diff --git a/gettext-tools/src/xgettext.c b/gettext-tools/src/xgettext.c -index f848d76d1..a80ee51ac 100644 ---- a/gettext-tools/src/xgettext.c -+++ b/gettext-tools/src/xgettext.c -@@ -330,7 +330,7 @@ main (int argc, char *argv[]) - bool sort_by_msgid = false; - bool sort_by_filepos = false; - char **dirs; -- char **its_dirs; -+ char **its_dirs = NULL; - char *explicit_its_filename = NULL; - const char *file_name; - const char *files_from = NULL; -@@ -1016,9 +1016,12 @@ warning: file '%s' extension '%s' is unknown; will try C"), filename, extension) - if (its_locating_rules) - locating_rule_list_free (its_locating_rules); - -- for (i = 0; its_dirs[i] != NULL; i++) -- free (its_dirs[i]); -- free (its_dirs); -+ if (its_dirs != NULL) -+ { -+ for (i = 0; its_dirs[i] != NULL; i++) -+ free (its_dirs[i]); -+ free (its_dirs); -+ } - - exit (EXIT_SUCCESS); - } --- -2.14.3 - diff --git a/SOURCES/msghack.py b/SOURCES/msghack.py index 358552c..0e16104 100755 --- a/SOURCES/msghack.py +++ b/SOURCES/msghack.py @@ -1,4 +1,4 @@ -#!/usr/bin/python3 +#!/usr/bin/python ## -*- coding: utf-8 -*- ## Copyright (C) 2001, 2004, 2008, 2012 Red Hat, Inc. ## Copyright (C) 2001 Trond Eivind Glomsrød @@ -20,6 +20,7 @@ A msghack replacement """ +import string import sys class GTMessage: @@ -34,8 +35,8 @@ class GTMessage: @message The message @id The messageid associated with the object """ - self._message=message.strip() - self._id=id.strip() + self._message=string.strip(message) + self._id=string.strip(id) self._refs=[] for ref in refs: self._refs.append(ref) @@ -177,7 +178,7 @@ class GTFile: msgar.append(GTMessage(message._id,message._message,message._refs)) continue msg=GTMessage(message._message,message._id,message._refs) - if msg._id not in msght: + if not msght.has_key(msg._id): msght[msg._id]=msg msgar.append(msg) else: @@ -198,7 +199,7 @@ class GTFile: res="" for message in self._messages: msgid=message._id - if msgid in msgids: + if msgids.has_key(msgid): res=res+"Duplicate: %s\n" % (msgid) else: msgids[msgid]=1 @@ -258,12 +259,12 @@ class GTFile: inmsgstr=0 templines=file.readlines() for line in templines: - lines.append(line.strip()) + lines.append(string.strip(line)) for line in lines: - pos=line.find('"') - pos2=line.rfind('"') + pos=string.find(line,'"') + pos2=string.rfind(line,'"') if line and line[0]=="#": - refs.append(line.strip()) + refs.append(string.strip(line)) if inmsgstr==0 and line[:6]=="msgstr": msgstr="" inmsgstr=1 @@ -341,7 +342,7 @@ class GTMaster: def printUsage(): "Print the usage messages" - print("Usage: " + str(sys.argv[0]) + " [OPTION] file.po [ref.po]\n\ + print "Usage: ", str(sys.argv[0])," [OPTION] file.po [ref.po]\n\ This program can be used to alter .po files in ways no sane mind would think about.\n\ -o result will be written to FILE\n\ --invert invert a po file by switching msgid and msgstr\n\ @@ -349,26 +350,26 @@ This program can be used to alter .po files in ways no sane mind would think abo --empty empty the contents of the .po file, creating a .pot\n\ --append append entries from ref.po that don't exist in file.po\n\ \n\ -Note: It is just a replacement of msghack for backward support.\n") +Note: It is just a replacement of msghack for backward support.\n" if __name__=="__main__": output=None res=None if("-o") in sys.argv: - if (len(sys.argv)<=sys.argv.index("-o")+1): - print("file.po and ref.po are not specified!\n") - printUsage() - exit(1) - output=sys.argv[sys.argv.index("-o")+1] + if (len(sys.argv)<=sys.argv.index("-o")+1): + print "file.po and ref.po are not specified!\n" + printUsage() + exit(1) + output=sys.argv[sys.argv.index("-o")+1] sys.argv.remove("-o") - sys.argv.remove(output) + sys.argv.remove(output) if("--invert") in sys.argv: - if (len(sys.argv)<=sys.argv.index("--invert")+1): - print("file.po is not specified!\n") - printUsage() - exit(1) - file=sys.argv[sys.argv.index("--invert")+1] + if (len(sys.argv)<=sys.argv.index("--invert")+1): + print "file.po is not specified!\n" + printUsage() + exit(1) + file=sys.argv[sys.argv.index("--invert")+1] gtf=GTFile(file) res1=gtf.msgidDupes() if res1: @@ -376,41 +377,41 @@ if __name__=="__main__": sys.exit(1) res=str(gtf.invertedStrings()) elif("--empty") in sys.argv: - if (len(sys.argv)<=sys.argv.index("--empty")+1): - print("file.po is not specified!\n") - printUsage() - exit(1) - file=sys.argv[sys.argv.index("--empty")+1] + if (len(sys.argv)<=sys.argv.index("--empty")+1): + print "file.po is not specified!\n" + printUsage() + exit(1) + file=sys.argv[sys.argv.index("--empty")+1] gtf=GTFile(file) res=str(gtf.emptyMsgStrings()) elif("--master") in sys.argv: - if (len(sys.argv)<=sys.argv.index("--master")+1): - print("file.po is not specified!\n") - printUsage() - exit(1) - loc=sys.argv.index("--master")+1 + if (len(sys.argv)<=sys.argv.index("--master")+1): + print "file.po is not specified!\n" + printUsage() + exit(1) + loc=sys.argv.index("--master")+1 gtfs=[] for file in sys.argv[loc:]: gtfs.append(GTFile(file)) master=GTMaster(gtfs) res=str(master) elif("--append") in sys.argv: - if (len(sys.argv)<=sys.argv.index("--append")+2): - print("file.po and/or ref.po are not specified!\n") - printUsage() - exit(1) - file=sys.argv[sys.argv.index("--append")+1] + if (len(sys.argv)<=sys.argv.index("--append")+2): + print "file.po and/or ref.po are not specified!\n" + printUsage() + exit(1) + file=sys.argv[sys.argv.index("--append")+1] file2=sys.argv[sys.argv.index("--append")+2] gtf=GTFile(file) gtf2=GTFile(file2) gtf.append(gtf2) res=str(gtf) else: - #print("Not implemented: "+str(sys.argv)) - printUsage() + #print "Not implemented: "+str(sys.argv) + printUsage() sys.exit(1) if not output: - print(res) + print res else: file=open(output,"w") file.write(res) diff --git a/SPECS/gettext.spec b/SPECS/gettext.spec index 826ea95..d09166c 100644 --- a/SPECS/gettext.spec +++ b/SPECS/gettext.spec @@ -1,6 +1,7 @@ %bcond_with jar %bcond_with java %bcond_without check +%bcond_without git %global tarversion 0.19.8.1 %global archiveversion 0.19.8 @@ -8,7 +9,7 @@ Summary: GNU libraries and utilities for producing multi-lingual messages Name: gettext Version: 0.19.8.1 -Release: 17%{?dist} +Release: 3%{?dist} License: GPLv3+ and LGPLv2+ Group: Development/Tools URL: http://www.gnu.org/software/gettext/ @@ -20,19 +21,14 @@ Patch0: disable-gettext-runtime-test-lock.patch # Upstreamed patch: # http://lists.gnu.org/archive/html/bug-gettext/2016-08/msg00006.html Patch1: gettext-po-send-mail.patch -# Rhbz#1531476, upstream a0cab23332a254e3500cac2a3a984472d02180e5 -Patch2: gettext-0.19.8-its-segfault.patch -# rhbz#1647044 -Patch3: gettext-0.19.8.1-CVE-2018-18751.patch - +# rhbz#1648433 +Patch2: gettext-0.19.8.1-CVE-2018-18751.patch Source2: msghack.py Source3: msghack.1 # for bootstrapping # BuildRequires: autoconf >= 2.62 # BuildRequires: automake -# BuildRequires: libtool -# BuildRequires: bison - +# BuildRequires: libtool, bison BuildRequires: gcc-c++ %if %{with java} # libintl.jar requires gcj >= 4.3 to build @@ -47,10 +43,10 @@ BuildRequires: zip, unzip %endif # for po-mode.el BuildRequires: emacs -# for autosetup +%if %{with git} +# for autopoint: BuildRequires: git -# ensure 'ARCHIVE_FORMAT=dirxz' -BuildRequires: xz +%endif BuildRequires: chrpath # following suggested by DEPENDENCIES: BuildRequires: ncurses-devel @@ -104,6 +100,10 @@ Requires: %{name}-libs = %{version}-%{release} Requires: %{name}-common-devel = %{version}-%{release} Requires(post): info Requires(preun): info +%if %{with git} +# for autopoint +Requires: git +%endif Requires: xz Obsoletes: gettext-autopoint < 0.18.1.1-3 Provides: gettext-autopoint = %{version}-%{release} @@ -139,14 +139,6 @@ Obsoletes: emacs-%{name}-el < %{version}-%{release} %description -n emacs-%{name} This package provides a major mode for editing po files within GNU Emacs. -%package -n msghack -Summary: Alter PO files in ways -BuildArch: noarch - -%description -n msghack -This program can be used to alter .po files in ways no sane mind would -think about. - %prep %autosetup -n %{name}-%{tarversion} -S git @@ -171,7 +163,10 @@ export CFLAGS="$RPM_OPT_FLAGS -D__SUPPORT_SNAN__" %else --disable-java --disable-native-java \ %endif - --with-xz +%if %{without git} + --disable-git \ +%endif +%{nil} make %{?_smp_mflags} %{?with_java:GCJFLAGS="-findirect-dispatch"} @@ -255,23 +250,36 @@ done make check LIBUNISTRING=-lunistring %endif + %post +/sbin/ldconfig /sbin/install-info %{_infodir}/gettext.info.gz %{_infodir}/dir || : + %preun if [ "$1" = 0 ]; then /sbin/install-info --delete %{_infodir}/gettext.info.gz %{_infodir}/dir || : fi + +%postun -p /sbin/ldconfig + + %post devel +/sbin/ldconfig /sbin/install-info %{_infodir}/autosprintf.info %{_infodir}/dir || : + %preun devel if [ "$1" = 0 ]; then /sbin/install-info --delete %{_infodir}/autosprintf.info %{_infodir}/dir || : fi -%ldconfig_scriptlets libs + +%postun devel -p /sbin/ldconfig + +%post libs -p /sbin/ldconfig +%postun libs -p /sbin/ldconfig %files -f %{name}.lang %doc AUTHORS gettext-runtime/BUGS @@ -282,10 +290,8 @@ fi %{_bindir}/* %exclude %{_bindir}/autopoint %exclude %{_bindir}/gettextize -%exclude %{_bindir}/msghack %{_infodir}/gettext* %exclude %{_mandir}/man1/autopoint.1* -%exclude %{_mandir}/man1/msghack.1* %{_mandir}/man1/* %{_libdir}/%{name} %if %{with java} @@ -340,167 +346,23 @@ fi %{_emacs_sitelispdir}/%{name}/*.el %{_emacs_sitestartdir}/*.el -%files -n msghack -%license COPYING -%{_bindir}/msghack -%{_mandir}/man1/msghack.1* - %changelog -* Fri Jun 14 2019 Sundeep Anand - 0.19.8.1-17 -- Ported CI gating tests to Python 3.6 - -* Fri Jun 14 2019 Sundeep Anand - 0.19.8.1-16 -- add CI gating tests - -* Fri May 3 2019 Jens Petersen - 0.19.8.1-15 -- fix CVE-2018-18751: double-free in xgettext (rhbz#1647049) - -* Wed Feb 07 2018 Fedora Release Engineering - 0.19.8.1-14 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild - -* Sat Feb 03 2018 Igor Gnatenko - 0.19.8.1-13 -- Switch to %%ldconfig_scriptlets - -* Fri Jan 05 2018 Pavel Raiskup - 0.19.8.1-12 -- xgettext --its segfault fix (rhbz#1531476) - -* Wed Aug 02 2017 Fedora Release Engineering - 0.19.8.1-11 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild +* Fri May 3 2019 Jens Petersen - 0.19.8.1-3 +- fix CVE-2018-18751: double-free in xgettext (rhbz#1648433) -* Wed Jul 26 2017 Fedora Release Engineering - 0.19.8.1-10 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild - -* Wed Mar 15 2017 Kalev Lember - 0.19.8.1-9 +* Wed Mar 15 2017 Kalev Lember - 0.19.8.1-2 - Depend on the exact version of the library sub package +- Resolves: #1386869 -* Fri Feb 10 2017 Fedora Release Engineering - 0.19.8.1-8 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild - -* Thu Jan 26 2017 Pavel Raiskup - 0.19.8.1-7 -- really remove Requires: git from gettext-devel (rhbz#1161284) -- make the BuildRequires unconditional (rhbz#1416691) - -* Wed Dec 21 2016 Pavel Raiskup - 0.19.8.1-6 -- disable test-lock for 'gettext-tool' subdir too (rhbz#1406031) - -* Mon Dec 19 2016 Miro Hrončok - 0.19.8.1-5 -- Rebuild for Python 3.6 - -* Fri Dec 16 2016 Petr Šabata - 0.19.8.1-4 -- Subpackage msghack so that gettext doesn't depend on python -- name the new sub-package 'msghack' - -* Tue Nov 29 2016 Pavel Raiskup - 0.19.8.1-3 -- devel subpackage to Require 'xz' (rhbz#1399270) - -* Wed Aug 10 2016 Daiki Ueno - 0.19.8.1-2 -- utilize %%autosetup -- apply patch to fix po-send-mail when used with Emacs 25 (#1356642) - -* Sat Jun 11 2016 Daiki Ueno - 0.19.8.1-1 -- update to 0.19.8.1 release - -* Thu Jun 9 2016 Daiki Ueno - 0.19.8-1 -- update to 0.19.8 release - -* Wed Feb 03 2016 Fedora Release Engineering - 0.19.7-4 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild - -* Tue Jan 12 2016 Daiki Ueno - 0.19.7-3 -- own .../gettext/its for third-party *.its files -- add a work around for test-isinf failure on ppc64le (#1297387) - -* Fri Jan 8 2016 Daiki Ueno - 0.19.7-2 -- apply patch to recognize .glade extension for GtkBuilder files (#1296653) - -* Thu Dec 10 2015 Daiki Ueno - 0.19.7-1 -- update to 0.19.7 release - -* Thu Sep 24 2015 Daiki Ueno - 0.19.6-1 -- update to 0.19.6 release - -* Wed Jul 22 2015 Daiki Ueno - 0.19.5.1-2 -- work around version conflict between gettextize and autopoint - -* Thu Jul 16 2015 Daiki Ueno - 0.19.5.1-1 -- update to 0.19.5.1 release - -* Fri Jun 26 2015 Daiki Ueno - 0.19.4-7 -- drop -el subpackage (#1234583) - -* Wed Jun 17 2015 Fedora Release Engineering - 0.19.4-6 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild - -* Sat May 02 2015 Kalev Lember - 0.19.4-5 -- Rebuilt for GCC 5 C++11 ABI change - -* Sat Feb 21 2015 Till Maas - 0.19.4-4 -- Rebuilt for Fedora 23 Change - https://fedoraproject.org/wiki/Changes/Harden_all_packages_with_position-independent_code - -* Thu Feb 19 2015 Daiki Ueno - 0.19.4-3 -- port msghack.py to Python 3 (#1192086) - -* Wed Dec 31 2014 Daiki Ueno - 0.19.4-2 -- remove git dependency from -devel subpackage (#1161284) - -* Fri Dec 26 2014 Daiki Ueno - 0.19.4-1 -- update to 0.19.4 release - -* Tue Oct 28 2014 Peter Robinson 0.19.3-2 -- Disable the test_lock test as it often hangs on a number of arches - -* Thu Oct 16 2014 Daiki Ueno - 0.19.3-1 -- update to 0.19.3 release -- remove patches included in 0.19.3 -- remove autoconf/automake/libtool/bison from BR, as we don't do bootstrap - -* Wed Oct 15 2014 Daiki Ueno - 0.19.2-5 -- apply patch to fix infloop in autopoint (Closes: #1151238) -- apply patch to support newer ncurses in F-22 - -* Fri Oct 3 2014 Daiki Ueno - 0.19.2-4 -- apply patch to fix C octal character escape handling (Closes: #1147535) - -* Tue Sep 02 2014 Dennis Gilmore - 0.19.2-3 -- rebuild for libunistring soname bump - -* Sat Aug 16 2014 Fedora Release Engineering - 0.19.2-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild - -* Mon Jul 14 2014 Daiki Ueno - 0.19.2-1 -- update to 0.19.2 release - -* Mon Jul 7 2014 Daiki Ueno - 0.19.1-2 -- apply patch to msghack.py, for Python 3 compatibility (Closes: #1113425, - thanks to Bohuslav "Slavek" Kabrda) - -* Tue Jun 10 2014 Daiki Ueno - 0.19.1-1 -- update to 0.19.1 release -- switch to xz-compressed archive - -* Sat Jun 07 2014 Fedora Release Engineering - 0.19-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild - -* Mon Jun 2 2014 Daiki Ueno - 0.19-2 -- apply patch to workaround msgfmt bug that counts warnings as errors - -* Mon Jun 2 2014 Daiki Ueno - 0.19-1 -- update to 0.19 release -- remove upstreamed -Wformat-security patch - -* Tue Jan 7 2014 Daiki Ueno - 0.18.3.2-1 -- update to 0.18.3.2 release -- apply patch to suppress -Wformat-security warnings in gnulib-tests - -* Sun Aug 25 2013 Daiki Ueno - 0.18.3.1-1 -- update to 0.18.3.1 release +* Fri Feb 03 2017 Kalev Lember - 0.19.8.1-1 +- Update to 0.19.8.1 +- Resolves: #1386869 -* Sat Aug 03 2013 Fedora Release Engineering - 0.18.3-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild +* Fri Jan 24 2014 Daniel Mach - 0.18.2.1-4 +- Mass rebuild 2014-01-24 -* Wed Jul 10 2013 Daiki Ueno - 0.18.3-1 -- update to 0.18.3 release +* Fri Dec 27 2013 Daniel Mach - 0.18.2.1-3 +- Mass rebuild 2013-12-27 * Wed Jun 26 2013 Daiki Ueno - 0.18.2.1-2 - add a man page for msghack