Compare commits

..

No commits in common. "90f0b261cfd2450cf9ead395232e620d12eebabf" and "203c8a4840721915b2e3037d2bf129bab9508b42" have entirely different histories.

4 changed files with 15 additions and 235 deletions

View File

@ -1,70 +0,0 @@
diff --git a/gettext-tools/src/msgl-cat.c b/gettext-tools/src/msgl-cat.c
index 965cc8c..38c7ca1 100644
--- a/gettext-tools/src/msgl-cat.c
+++ b/gettext-tools/src/msgl-cat.c
@@ -307,6 +307,7 @@ catenate_msgdomain_list (string_list_ty *file_list,
mp->msgid);
multiline_error (xstrdup (""),
xasprintf ("%s\n", errormsg));
+ free (errormsg);
}
}
else
diff --git a/gettext-tools/src/x-csharp.c b/gettext-tools/src/x-csharp.c
index 13d4a53..669db2f 100644
--- a/gettext-tools/src/x-csharp.c
+++ b/gettext-tools/src/x-csharp.c
@@ -561,6 +561,7 @@ comment_line_end (size_t chars_to_remove)
buffer[buflen] = '\0';
savable_comment_add (buffer);
lexical_context = lc_outside;
+ free (buffer);
}
diff --git a/gettext-tools/src/x-java.c b/gettext-tools/src/x-java.c
index e89ab95..6c1b4a7 100644
--- a/gettext-tools/src/x-java.c
+++ b/gettext-tools/src/x-java.c
@@ -461,6 +461,7 @@ comment_line_end (size_t chars_to_remove)
--buflen;
buffer[buflen] = '\0';
savable_comment_add (buffer);
+ free (buffer);
}
diff --git a/gettext-tools/src/x-rst.c b/gettext-tools/src/x-rst.c
index cde1ee6..82f645f 100644
--- a/gettext-tools/src/x-rst.c
+++ b/gettext-tools/src/x-rst.c
@@ -651,6 +651,8 @@ extract_rsj (FILE *f,
else
goto invalid_rsj;
+ free (s1);
+
/* Parse a comma. */
c = phase2_getc ();
if (c == '}')
@@ -667,6 +669,7 @@ extract_rsj (FILE *f,
fp = NULL;
real_file_name = NULL;
+ free (logical_file_name);
logical_file_name = NULL;
line_number = 0;
diff --git a/gettext-tools/src/xg-arglist-callshape.c b/gettext-tools/src/xg-arglist-callshape.c
index 06b7076..2189aac 100644
--- a/gettext-tools/src/xg-arglist-callshape.c
+++ b/gettext-tools/src/xg-arglist-callshape.c
@@ -118,6 +118,7 @@ split_keywordspec (const char *spec,
memcpy (xcomment, xcomment_start, xcomment_len);
xcomment[xcomment_len] = '\0';
string_list_append (&xcomments, xcomment);
+ free (xcomment);
}
else
break;

View File

@ -1,124 +0,0 @@
diff -ur gettext-0.22.orig/Makefile.am gettext-0.22/Makefile.am
--- gettext-0.22.orig/Makefile.am 2023-06-23 17:44:45.388281215 +0800
+++ gettext-0.22/Makefile.am 2023-06-23 17:43:14.098701787 +0800
@@ -19,7 +19,7 @@
AUTOMAKE_OPTIONS = 1.5 gnu no-dependencies
ACLOCAL_AMFLAGS = -I m4
-SUBDIRS = gnulib-local gettext-runtime libtextstyle gettext-tools
+SUBDIRS = gnulib-local gettext-runtime gettext-tools
changelog_etc = \
gettext-runtime/ChangeLog.0 \
@@ -87,7 +87,7 @@
cmp -s $(srcdir)/gettext-runtime/m4/xsize.m4 $(srcdir)/gettext-tools/gnulib-m4/xsize.m4
cmp -s $(srcdir)/gettext-runtime/man/help2man $(srcdir)/gettext-tools/man/help2man
cmp -s $(srcdir)/gettext-runtime/man/x-to-1.in $(srcdir)/gettext-tools/man/x-to-1.in
- cmp -s $(srcdir)/libtextstyle/m4/libtextstyle.m4 $(srcdir)/gettext-tools/gnulib-m4/libtextstyle.m4
+# cmp -s $(srcdir)/libtextstyle/m4/libtextstyle.m4 $(srcdir)/gettext-tools/gnulib-m4/libtextstyle.m4
cmp -s $(srcdir)/gettext-tools/examples/hello-java-awt/m4/TestAWT.java $(srcdir)/gettext-tools/examples/hello-java-swing/m4/TestAWT.java
cmp -s $(srcdir)/gettext-tools/examples/hello-java-awt/m4/TestAWT.class $(srcdir)/gettext-tools/examples/hello-java-swing/m4/TestAWT.class
# Verify that all files have appropriate copyright headers.
diff -ur gettext-0.22.orig/configure.ac gettext-0.22/configure.ac
--- gettext-0.22.orig/configure.ac 2020-09-06 18:01:37.000000000 +0800
+++ gettext-0.22/configure.ac 2023-06-23 17:43:14.099701793 +0800
@@ -37,7 +37,7 @@
dnl Checks for library functions.
-AC_CONFIG_SUBDIRS([gettext-runtime libtextstyle gettext-tools])
+AC_CONFIG_SUBDIRS([gettext-runtime gettext-tools])
AM_EXTRA_RECURSIVE_TARGETS([maintainer-update-po])
@@ -49,7 +49,7 @@
dnl Optional Features: AC_ARG_ENABLE calls
dnl Optional Packages: AC_ARG_WITH calls
dnl Some influential environment variables: AC_ARG_VAR calls
-esyscmd([{ cd gettext-runtime && autoconf --trace=AC_ARG_ENABLE:'$n([$1],[$2])' --trace=AC_ARG_WITH:'$n([$1],[$2])' --trace=AC_ARG_VAR:'$n($@)' && cd ..; cd libtextstyle && autoconf --trace=AC_ARG_ENABLE:'$n([$1],[$2])' --trace=AC_ARG_WITH:'$n([$1],[$2])' --trace=AC_ARG_VAR:'$n($@)' && cd ..; { cd gettext-tools && autoconf --trace=AC_ARG_ENABLE:'$n([$1],[$2])' --trace=AC_ARG_WITH:'$n([$1],[$2])' --trace=AC_ARG_VAR:'$n($@)' && cd ..; } | grep -v installed.libtextstyle | grep -v installed.csharp | grep -v 'installed C#'; } | sed -f build-aux/ac-help.sed ])
+esyscmd([{ cd gettext-runtime && autoconf --trace=AC_ARG_ENABLE:'$n([$1],[$2])' --trace=AC_ARG_WITH:'$n([$1],[$2])' --trace=AC_ARG_VAR:'$n($@)' && cd ..; { cd gettext-tools && autoconf --trace=AC_ARG_ENABLE:'$n([$1],[$2])' --trace=AC_ARG_WITH:'$n([$1],[$2])' --trace=AC_ARG_VAR:'$n($@)' && cd ..; } | grep -v installed.csharp | grep -v 'installed C#'; } | sed -f build-aux/ac-help.sed ])
AC_CONFIG_FILES([Makefile])
diff -ur gettext-0.22.orig/gettext-tools/Makefile.am gettext-0.22/gettext-tools/Makefile.am
--- gettext-0.22.orig/gettext-tools/Makefile.am 2021-06-15 04:22:46.000000000 +0800
+++ gettext-0.22/gettext-tools/Makefile.am 2023-06-23 18:24:08.822906444 +0800
@@ -19,7 +19,7 @@
AUTOMAKE_OPTIONS = 1.5 gnu no-dependencies
ACLOCAL_AMFLAGS = -I m4 -I ../gettext-runtime/m4 -I ../m4 -I gnulib-m4 -I libgrep/gnulib-m4 -I libgettextpo/gnulib-m4
-SUBDIRS = gnulib-lib libgrep src libgettextpo po its projects styles emacs misc man m4 tests system-tests gnulib-tests examples doc
+SUBDIRS = gnulib-lib libgrep libgettextpo src po its projects styles emacs misc man m4 tests system-tests gnulib-tests examples doc
EXTRA_DIST = misc/DISCLAIM
MOSTLYCLEANFILES = core *.stackdump
diff -ur gettext-0.22.orig/gettext-tools/libgettextpo/textstyle.in.h gettext-0.22/gettext-tools/libgettextpo/textstyle.in.h
--- gettext-0.22.orig/gettext-tools/libgettextpo/textstyle.in.h 2023-05-19 12:20:56.000000000 +0800
+++ gettext-0.22/gettext-tools/libgettextpo/textstyle.in.h 2023-06-23 17:43:14.099701793 +0800
@@ -243,7 +243,8 @@
static inline file_ostream_t
file_ostream_create (FILE *fp)
{
- return fp;
+ /* Closing the stream we return should not close 'fp'. */
+ return fdopen (dup (fileno (fp)), "w");
}
/* --------------------------- From fd-ostream.h --------------------------- */
@@ -443,6 +444,30 @@
return NULL;
}
+/* ----------------------- From noop-styled-ostream.h ----------------------- */
+
+/* noop_styled_ostream_t is a subtype of ostream_t. */
+typedef ostream_t noop_styled_ostream_t;
+
+#define noop_styled_ostream_write_mem ostream_write_mem
+#define noop_styled_ostream_flush ostream_flush
+#define noop_styled_ostream_free ostream_free
+#define noop_styled_ostream_begin_use_class styled_ostream_begin_use_class
+#define noop_styled_ostream_end_use_class styled_ostream_end_use_class
+#define noop_styled_ostream_get_hyperlink_ref styled_ostream_get_hyperlink_ref
+#define noop_styled_ostream_get_hyperlink_id styled_ostream_get_hyperlink_id
+#define noop_styled_ostream_set_hyperlink styled_ostream_set_hyperlink
+#define noop_styled_ostream_flush_to_current_style styled_ostream_flush_to_current_style
+
+static inline ostream_t
+noop_styled_ostream_create (ostream_t destination, bool pass_ownership)
+{
+ if (pass_ownership)
+ return destination;
+ else
+ return fdopen (dup (fileno (destination)), "w");
+}
+
/* ------------------------------ From color.h ------------------------------ */
#define color_test_mode false
diff -ur gettext-0.22.orig/gettext-tools/src/Makefile.am gettext-0.22/gettext-tools/src/Makefile.am
--- gettext-0.22.orig/gettext-tools/src/Makefile.am 2023-06-09 05:03:36.000000000 +0800
+++ gettext-0.22/gettext-tools/src/Makefile.am 2023-06-23 17:43:14.099701793 +0800
@@ -305,19 +305,9 @@
cldr_plurals_CFLAGS = $(AM_CFLAGS) $(INCXML)
cldr_plurals_LDADD = libgettextsrc.la $(LDADD)
-if USE_INSTALLED_LIBTEXTSTYLE
-LT_LIBTEXTSTYLE = @LTLIBTEXTSTYLE@
-else
-# How to get the include files of libtextstyle.
-textstyle.h textstyle/stdbool.h textstyle/version.h textstyle/woe32dll.h:
- here=`pwd`; \
- cd ../../libtextstyle/lib && \
- $(MAKE) install-nobase_includeHEADERS install-nobase_nodist_includeHEADERS includedir="$$here"
-BUILT_SOURCES += textstyle.h textstyle/stdbool.h textstyle/version.h textstyle/woe32dll.h
-MOSTLYCLEANFILES += textstyle.h textstyle/stdbool.h textstyle/version.h textstyle/woe32dll.h
-# Where to find the built libtextstyle library.
-LT_LIBTEXTSTYLE = ../../libtextstyle/lib/libtextstyle.la
-endif
+# Use the dummy libtextstyle from gnulib, as libgettextpo does.
+LT_LIBTEXTSTYLE =
+AM_CPPFLAGS += -I../libgettextpo -I$(top_srcdir)/libgettextpo
# How to build libgettextsrc.la.
# Need ../gnulib-lib/libgettextlib.la.

View File

@ -2,20 +2,17 @@
%bcond_with java
%bcond_without check
%global archiveversion 0.22
%global archiveversion 0.21
Name: gettext
Version: 0.22
Release: 2
Version: 0.21
Release: 4
License: GPLv3+ and LGPLv2+
Summary: GNU gettext utilities are a set of tools that provides a framework to help other GNU packages produce multi-lingual messages.
URL: https://www.gnu.org/software/gettext/
Source: https://ftp.gnu.org/pub/gnu/gettext/%{name}-%{version}.tar.gz
Patch1: gettext-0.22-disable-libtextstyle.patch
Patch2: gettext-0.21.1-covscan.patch
BuildRequires: gcc-c++, emacs, xz, chrpath, autoconf, automake
BuildRequires: gcc-c++, emacs, git, xz, chrpath, autoconf
BuildRequires: ncurses-devel, libxml2-devel, glib2-devel, libunistring-devel
%if %{with java}
BuildRequires: gcc-java, libgcj
@ -30,8 +27,8 @@ Conflicts: filesystem < 3
Provides: /bin/gettext
Provides: bundled(gnulib)
Provides: bundled(libcroco) = 0.6.12
Provides: %{name}-libs = %{version}-%{release}
Obsoletes: %{name}-libs < %{version}-%{release}
Provides: %{name}-libs
Obsoletes: %{name}-libs
%description
GNU gettext is an important step for the GNU Translation Project, as it
@ -57,10 +54,10 @@ Requires(preun): info
Requires: xz
Obsoletes: gettext-autopoint < 0.18.1.1-3
Provides: gettext-autopoint = %{version}-%{release}
Obsoletes: %{name}-common-devel < %{version}-%{release}
Provides: %{name}-common-devel = %{version}-%{release}
Obsoletes: msghack < %{version}-%{release}
Provides: msghack = %{version}-%{release}
Obsoletes: %{name}-common-devel
Provides: %{name}-common-devel
Obsoletes: msghack
Provides: msghack
%description devel
This package provides development files and tools which help edit/alter
@ -88,7 +85,7 @@ Summary: help info for %{name}
This package contains man, license, info, readme, copyright, license.
%prep
%autosetup -n %{name}-%{version} -p1
%autosetup -n %{name}-%{version} -S git
sed -e 's/\(gl_cv_libxml_force_included=\)yes/\1no/' \
-i libtextstyle/configure
@ -199,6 +196,7 @@ make check LIBUNISTRING=-lunistring
%{_datadir}/%{name}-%{archiveversion}/its
%{_libdir}/libasprintf.so.0*
%{_libdir}/libgettextpo.so.0*
%{_libdir}/libtextstyle.so.0*
%{_libdir}/libgettextlib-0.*.so
%{_libdir}/libgettextsrc-0.*.so
%if %{with jar}
@ -218,10 +216,12 @@ make check LIBUNISTRING=-lunistring
%{_infodir}/autosprintf*
%{_libdir}/libasprintf.so
%{_libdir}/libgettextpo.so
%{_libdir}/libtextstyle.so
%{_libdir}/preloadable_libintl.so
%{_mandir}/man1/autopoint.1*
%{_datadir}/%{name}/javaversion.class
%doc gettext-runtime/intl-java/javadoc*
%{_docdir}/libtextstyle/
%if %{with java}
%{_libdir}/%{name}/gnu.gettext.*
%endif
@ -236,38 +236,12 @@ make check LIBUNISTRING=-lunistring
%files help
%{_infodir}/gettext*
%{_infodir}/libtextstyle*
%{_mandir}/man1/*
%{_mandir}/man3/*
%exclude %{_mandir}/man1/autopoint.1*
%changelog
* Tue Feb 27 2024 fuanan <fuanan3@h-partners.com> - 0.22-2
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:Fix build failure
* Thu Jul 13 2023 dillon chen <dillon.chen@gmail.com> - 0.22-1
- Type:enhancement
- ID:NA
- SUG:NA
- DESC:update version to 0.22
* Fri Nov 04 2022 fuanan <fuanan3@h-partners.com> - 0.21.1-1
- Type:enhancement
- ID:NA
- SUG:NA
- DESC:update version to 0.21.1
* Fri Sep 9 2022 yixiangzhike<yixiangzhike007@163.com> - 0.21-6
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:Add version number for Obsoletes and Provides
* Sat Jul 31 2021 chenyanpanHW <chenyanpan@huawei.com> - 0.21-5
- DESC: delete -S git from %autosetup, and delete BuildRequires git
* Fri May 14 2021 yangzhuangzhuang<yangzhuangzhuang1@Huawei.com> - 0.21-4
- Type:bugfix
- ID:NA