forked from pool/gettext-runtime
Compare commits
6 Commits
Author | SHA256 | Date | |
---|---|---|---|
62affc6d77 | |||
bad31401bb | |||
ca82824d8e | |||
97d317b6ed | |||
d555f64a28 | |||
a9fb771119 |
98
0003-Fix-malformed-header-processing.patch
Normal file
98
0003-Fix-malformed-header-processing.patch
Normal file
@@ -0,0 +1,98 @@
|
||||
From 88d67f8eacdd301d836a6902374dc10e8cc05d57 Mon Sep 17 00:00:00 2001
|
||||
From: Stanislav Brabec <sbrabec@suse.com>
|
||||
Date: Wed, 26 Feb 2025 03:00:18 +0100
|
||||
Subject: [PATCH 3/3] Fix malformed header processing
|
||||
|
||||
---
|
||||
gettext-tools/src/msgl-header.c | 68 ++++++++++++++++++++++++---------
|
||||
1 file changed, 51 insertions(+), 17 deletions(-)
|
||||
|
||||
diff --git a/gettext-tools/src/msgl-header.c b/gettext-tools/src/msgl-header.c
|
||||
index 6fe659e73..fb5186a89 100644
|
||||
--- a/gettext-tools/src/msgl-header.c
|
||||
+++ b/gettext-tools/src/msgl-header.c
|
||||
@@ -397,30 +397,64 @@ message_list_header_list (message_list_ty *mlp)
|
||||
{
|
||||
/* We found the correct message. */
|
||||
message_ty *mp = mlp->item[j];
|
||||
+
|
||||
+ /* Test whether the field occurs in the header entry. */
|
||||
const char *h = mp->msgstr;
|
||||
+
|
||||
message_list_ty * header = message_list_alloc (false);
|
||||
int ctr = 0;
|
||||
|
||||
while (*h != '\0')
|
||||
- {
|
||||
- char *enh = strchr (h, ':');
|
||||
- enh++;
|
||||
- char * msgid = (char *)XNMALLOC (((enh - h) + 1), char);
|
||||
- memcpy (msgid, h, enh - h);
|
||||
- /* Make the string null-terminated. */
|
||||
- (msgid)[enh-h] = '\0';
|
||||
- h = enh + 1;
|
||||
-
|
||||
- enh = strchr (h, '\n');
|
||||
- if (enh != NULL)
|
||||
+ {
|
||||
+ const char *enh;
|
||||
+ const char *enhz;
|
||||
+ const char *sep;
|
||||
+ const char *value;
|
||||
+
|
||||
+ enh = strchr (h, '\n');
|
||||
+ if (enh)
|
||||
+ {
|
||||
+ enhz = enh;
|
||||
+ enh++;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ /* Missing trailing EOL. */
|
||||
+ enh = h + strlen(h);
|
||||
+ enhz = enh;
|
||||
+ }
|
||||
+
|
||||
+ sep = strchr (h, ':');
|
||||
+ if (sep == NULL || sep >= enhz)
|
||||
+ {
|
||||
+ /* Line does not contain ':'. */
|
||||
+ sep = enhz;
|
||||
+ value = enhz;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ sep++;
|
||||
+ if (*sep != ' ')
|
||||
+ /* ' ' missing after ':'. */
|
||||
+ value = sep;
|
||||
+ else
|
||||
+ value = sep + 1;
|
||||
+ }
|
||||
+
|
||||
+ char * msgid = (char *)XNMALLOC (((sep - h) + 1), char);
|
||||
+ memcpy (msgid, h, sep - h);
|
||||
+ /* Make the string null-terminated. */
|
||||
+ msgid[sep-h] = '\0';
|
||||
+ char * msgstr = (char *)XNMALLOC (((enhz - value) + 1), char);
|
||||
+ memcpy (msgstr, value, enhz - value);
|
||||
+ /* Make the string null-terminated. */
|
||||
+ msgstr[enhz-value] = '\0';
|
||||
+
|
||||
+ if (h != NULL)
|
||||
{
|
||||
- char * msgstr = (char *)XNMALLOC (((enh - h) + 1), char);
|
||||
- memcpy (msgstr, h, enh - h);
|
||||
- /* Make the string null-terminated. */
|
||||
- msgstr[enh-h] = '\0';
|
||||
lex_pos_ty pos = {NULL, ctr++};
|
||||
- message_list_append (header, message_alloc (NULL, msgid, NULL, msgstr, enh - h, &pos));
|
||||
- h = enh + 1;
|
||||
+ message_list_append (header, message_alloc (NULL, msgid, NULL, msgstr, enhz - value, &pos));
|
||||
+ h = enh;
|
||||
}
|
||||
else return NULL;
|
||||
}
|
||||
--
|
||||
2.48.1
|
||||
|
@@ -1,7 +1,7 @@
|
||||
Index: gettext-tools/misc/gettextize.in
|
||||
===================================================================
|
||||
--- gettext-tools/misc/gettextize.in.orig 2010-06-06 14:49:57.000000000 +0200
|
||||
+++ gettext-tools/misc/gettextize.in 2010-12-20 18:47:11.932132562 +0100
|
||||
--- a/gettext-tools/misc/gettextize.in.orig 2010-06-06 14:49:57.000000000 +0200
|
||||
+++ b/gettext-tools/misc/gettextize.in 2010-12-20 18:47:11.932132562 +0100
|
||||
@@ -1262,20 +1262,6 @@ if $doit; then
|
||||
echo "It is a wrapper around <libintl.h> that implements the configure --disable-nls"
|
||||
echo "option."
|
||||
|
@@ -1,7 +1,7 @@
|
||||
Index: gettext-runtime/intl/dcigettext.c
|
||||
===================================================================
|
||||
--- gettext-runtime/intl/dcigettext.c.orig 2010-06-06 14:49:57.000000000 +0200
|
||||
+++ gettext-runtime/intl/dcigettext.c 2010-12-20 18:47:11.543133542 +0100
|
||||
--- a/gettext-runtime/intl/dcigettext.c.orig 2010-06-06 14:49:57.000000000 +0200
|
||||
+++ b/gettext-runtime/intl/dcigettext.c 2010-12-20 18:47:11.543133542 +0100
|
||||
@@ -68,20 +68,7 @@ extern int errno;
|
||||
#endif
|
||||
|
||||
@@ -26,8 +26,8 @@ Index: gettext-runtime/intl/dcigettext.c
|
||||
# include <sys/param.h>
|
||||
Index: gettext-runtime/intl/eval-plural.h
|
||||
===================================================================
|
||||
--- gettext-runtime/intl/eval-plural.h.orig 2010-06-06 14:49:57.000000000 +0200
|
||||
+++ gettext-runtime/intl/eval-plural.h 2010-12-20 18:48:36.928872823 +0100
|
||||
--- a/gettext-runtime/intl/eval-plural.h.orig 2010-06-06 14:49:57.000000000 +0200
|
||||
+++ b/gettext-runtime/intl/eval-plural.h 2010-12-20 18:48:36.928872823 +0100
|
||||
@@ -62,16 +62,12 @@ plural_eval (const struct expression *pe
|
||||
case mult:
|
||||
return leftarg * rightarg;
|
||||
|
@@ -1,3 +1,15 @@
|
||||
-------------------------------------------------------------------
|
||||
Wed Feb 26 03:01:34 CET 2025 - Stanislav Brabec <sbrabec@suse.com>
|
||||
|
||||
- Fix crash while handling po files with malformed header and
|
||||
process them properly
|
||||
(0003-Fix-malformed-header-processing.patch, boo#1227316).
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Jul 16 08:42:20 UTC 2024 - Bernhard Wiedemann <bwiedemann@suse.com>
|
||||
|
||||
- Use %autosetup
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Feb 26 14:57:24 UTC 2024 - Dominique Leuenberger <dimstar@opensuse.org>
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# spec file for package gettext-csharp
|
||||
#
|
||||
# Copyright (c) 2024 SUSE LLC
|
||||
# Copyright (c) 2025 SUSE LLC
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
@@ -47,6 +47,8 @@ Patch13: reproducible.patch
|
||||
# PATCH-FEATURE bsc#1165138
|
||||
Patch14: 0001-msgcat-Add-feature-to-use-the-newest-po-file.patch
|
||||
Patch15: 0002-msgcat-Merge-headers-when-use-first.patch
|
||||
# PATCH-FEATURE-FIX-SUSE boo#1227316 -- sbrabec@suse.com
|
||||
Patch16: 0003-Fix-malformed-header-processing.patch
|
||||
BuildRequires: automake >= 1.14
|
||||
BuildRequires: fdupes
|
||||
BuildRequires: gcc-c++
|
||||
@@ -80,18 +82,7 @@ also included msgfmt.net.exe and msgunfmt.net.exe handle PO files more
|
||||
reliably than 'resgen'.
|
||||
|
||||
%prep
|
||||
%setup -q -n gettext-%{version}
|
||||
%patch -P 0
|
||||
%patch -P 1 -p1
|
||||
%patch -P 2
|
||||
%patch -P 3 -p1
|
||||
%patch -P 4
|
||||
%patch -P 5
|
||||
%patch -P 6 -p1
|
||||
%patch -P 11 -p1
|
||||
%patch -P 13 -p1
|
||||
%patch -P 14 -p1
|
||||
%patch -P 15 -p1
|
||||
%autosetup -p1 -n gettext-%{version}
|
||||
|
||||
%build
|
||||
export CFLAGS="%{optflags} -pipe -W -Wall -Dgcc_is_lint -lm"
|
||||
|
@@ -1,7 +1,7 @@
|
||||
Index: gettext-tools/gnulib-lib/gl_anylinked_list2.h
|
||||
===================================================================
|
||||
--- gettext-tools/gnulib-lib/gl_anylinked_list2.h.orig 2010-05-24 11:42:37.000000000 +0200
|
||||
+++ gettext-tools/gnulib-lib/gl_anylinked_list2.h 2010-12-20 18:47:11.981132438 +0100
|
||||
--- a/gettext-tools/gnulib-lib/gl_anylinked_list2.h.orig 2010-05-24 11:42:37.000000000 +0200
|
||||
+++ b/gettext-tools/gnulib-lib/gl_anylinked_list2.h 2010-12-20 18:47:11.981132438 +0100
|
||||
@@ -34,6 +34,12 @@
|
||||
# define ASYNCSAFE(type)
|
||||
#endif
|
||||
|
@@ -1,3 +1,17 @@
|
||||
-------------------------------------------------------------------
|
||||
Wed Feb 26 03:01:34 CET 2025 - Stanislav Brabec <sbrabec@suse.com>
|
||||
|
||||
- Fix crash while handling po files with malformed header and
|
||||
process them properly
|
||||
(0003-Fix-malformed-header-processing.patch, boo#1227316).
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Jul 16 08:42:20 UTC 2024 - Bernhard Wiedemann <bwiedemann@suse.com>
|
||||
|
||||
- Use %autosetup
|
||||
- Add reproducible-jar.patch to use a constant jar mtime
|
||||
for bit-reproducible builds
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Feb 26 14:57:24 UTC 2024 - Dominique Leuenberger <dimstar@opensuse.org>
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# spec file for package gettext-java
|
||||
#
|
||||
# Copyright (c) 2024 SUSE LLC
|
||||
# Copyright (c) 2025 SUSE LLC
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
@@ -44,6 +44,10 @@ Patch13: reproducible.patch
|
||||
# PATCH-FEATURE bsc#1165138
|
||||
Patch14: 0001-msgcat-Add-feature-to-use-the-newest-po-file.patch
|
||||
Patch15: 0002-msgcat-Merge-headers-when-use-first.patch
|
||||
# PATCH-FIX-UPSTREAM https://lists.gnu.org/archive/html/bug-gettext/2024-07/msg00021.html
|
||||
Patch16: reproducible-jar.patch
|
||||
# PATCH-FEATURE-FIX-SUSE boo#1227316 -- sbrabec@suse.com
|
||||
Patch17: 0003-Fix-malformed-header-processing.patch
|
||||
BuildRequires: automake >= 1.14
|
||||
BuildRequires: fdupes
|
||||
BuildRequires: gcc-c++
|
||||
@@ -65,18 +69,7 @@ Java applications. It also includes example code for java, java+awt and
|
||||
java+swing.
|
||||
|
||||
%prep
|
||||
%setup -q -n gettext-%{version}
|
||||
%patch -P 0
|
||||
%patch -P 1 -p1
|
||||
%patch -P 2
|
||||
%patch -P 3 -p1
|
||||
%patch -P 4
|
||||
%patch -P 5
|
||||
%patch -P 6 -p1
|
||||
%patch -P 11 -p1
|
||||
%patch -P 13 -p1
|
||||
%patch -P 14 -p1
|
||||
%patch -P 15 -p1
|
||||
%autosetup -p1 -n gettext-%{version}
|
||||
|
||||
%build
|
||||
# expect a couple "You should update your `aclocal.m4' by running aclocal."
|
||||
|
@@ -1,7 +1,7 @@
|
||||
Index: gettext-tools/emacs/po-mode.el
|
||||
===================================================================
|
||||
--- gettext-tools/emacs/po-mode.el.orig 2010-06-06 14:49:57.000000000 +0200
|
||||
+++ gettext-tools/emacs/po-mode.el 2010-12-20 18:47:11.963132483 +0100
|
||||
--- a/gettext-tools/emacs/po-mode.el.orig 2010-06-06 14:49:57.000000000 +0200
|
||||
+++ b/gettext-tools/emacs/po-mode.el 2010-12-20 18:47:11.963132483 +0100
|
||||
@@ -1242,6 +1242,7 @@ all reachable through 'M-x customize', i
|
||||
;; mode-line-format usually contains global-mode-string, but some
|
||||
;; people customize this variable. As a last resort, append at the end.
|
||||
|
@@ -1,3 +1,21 @@
|
||||
-------------------------------------------------------------------
|
||||
Wed Feb 26 03:01:34 CET 2025 - Stanislav Brabec <sbrabec@suse.com>
|
||||
|
||||
- Fix crash while handling po files with malformed header and
|
||||
process them properly
|
||||
(0003-Fix-malformed-header-processing.patch, boo#1227316).
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Sep 12 10:43:39 UTC 2024 - Dan Čermák <dcermak@suse.com>
|
||||
|
||||
- Move envsubst requires into main package, gettext.sh is not part of
|
||||
gettext-tools, but gettext-runtime (fixes boo#1227070)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Jul 16 08:42:20 UTC 2024 - Bernhard Wiedemann <bwiedemann@suse.com>
|
||||
|
||||
- Use %autosetup
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Jun 6 14:23:04 UTC 2024 - Dominique Leuenberger <dimstar@opensuse.org>
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# spec file for package gettext-runtime-mini
|
||||
#
|
||||
# Copyright (c) 2024 SUSE LLC
|
||||
# Copyright (c) 2025 SUSE LLC
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
@@ -51,6 +51,8 @@ Requires: this-is-only-for-build-envs
|
||||
# rpm-build requires gettext-tools, but we will only just be building it
|
||||
#!BuildIgnore: gettext-tools
|
||||
%endif
|
||||
# gettext.sh requires envsubst
|
||||
Requires: envsubst%{?with_mini:-mini} = %{version}
|
||||
Summary: Tools for Native Language Support (NLS)
|
||||
License: GPL-3.0-or-later AND LGPL-2.0-or-later
|
||||
Group: Development/Tools/Other
|
||||
@@ -77,6 +79,8 @@ Patch13: reproducible.patch
|
||||
# PATCH-FEATURE bsc#1165138
|
||||
Patch14: 0001-msgcat-Add-feature-to-use-the-newest-po-file.patch
|
||||
Patch15: 0002-msgcat-Merge-headers-when-use-first.patch
|
||||
# PATCH-FEATURE-FIX-SUSE boo#1227316 -- sbrabec@suse.com
|
||||
Patch16: 0003-Fix-malformed-header-processing.patch
|
||||
|
||||
%description
|
||||
This package contains the intl library as well as tools that ease the
|
||||
@@ -92,8 +96,6 @@ License: LGPL-2.1-or-later
|
||||
Group: Development/Tools/Other
|
||||
Requires: %{name} = %{version}
|
||||
Requires: xz
|
||||
# gettext.sh requires envsubst
|
||||
Requires: envsubst%{?with_mini:-mini} = %{version}
|
||||
# autopoint requires find
|
||||
Requires: findutils
|
||||
# For non-UTF encodings
|
||||
@@ -173,18 +175,7 @@ This package provides headers and static libraries for libtextstyle
|
||||
%endif
|
||||
|
||||
%prep
|
||||
%setup -q -n %{pacname}-%{version}
|
||||
%patch -P 0
|
||||
%patch -P 1 -p1
|
||||
%patch -P 2
|
||||
%patch -P 3 -p1
|
||||
%patch -P 4
|
||||
%patch -P 5
|
||||
%patch -P 6 -p1
|
||||
%patch -P 11 -p1
|
||||
%patch -P 13 -p1
|
||||
%patch -P 14 -p1
|
||||
%patch -P 15 -p1
|
||||
%autosetup -p1 -n %{pacname}-%{version}
|
||||
|
||||
%build
|
||||
%define _lto_cflags %{nil}
|
||||
|
@@ -1,3 +1,21 @@
|
||||
-------------------------------------------------------------------
|
||||
Wed Feb 26 03:01:34 CET 2025 - Stanislav Brabec <sbrabec@suse.com>
|
||||
|
||||
- Fix crash while handling po files with malformed header and
|
||||
process them properly
|
||||
(0003-Fix-malformed-header-processing.patch, boo#1227316).
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Sep 12 10:43:39 UTC 2024 - Dan Čermák <dcermak@suse.com>
|
||||
|
||||
- Move envsubst requires into main package, gettext.sh is not part of
|
||||
gettext-tools, but gettext-runtime (fixes boo#1227070)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Jul 16 08:42:20 UTC 2024 - Bernhard Wiedemann <bwiedemann@suse.com>
|
||||
|
||||
- Use %autosetup
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Jun 6 14:23:04 UTC 2024 - Dominique Leuenberger <dimstar@opensuse.org>
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# spec file for package gettext-runtime
|
||||
#
|
||||
# Copyright (c) 2024 SUSE LLC
|
||||
# Copyright (c) 2025 SUSE LLC
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
@@ -51,6 +51,8 @@ Requires: this-is-only-for-build-envs
|
||||
# rpm-build requires gettext-tools, but we will only just be building it
|
||||
#!BuildIgnore: gettext-tools
|
||||
%endif
|
||||
# gettext.sh requires envsubst
|
||||
Requires: envsubst%{?with_mini:-mini} = %{version}
|
||||
Summary: Tools for Native Language Support (NLS)
|
||||
License: GPL-3.0-or-later AND LGPL-2.0-or-later
|
||||
Group: Development/Tools/Other
|
||||
@@ -77,6 +79,8 @@ Patch13: reproducible.patch
|
||||
# PATCH-FEATURE bsc#1165138
|
||||
Patch14: 0001-msgcat-Add-feature-to-use-the-newest-po-file.patch
|
||||
Patch15: 0002-msgcat-Merge-headers-when-use-first.patch
|
||||
# PATCH-FEATURE-FIX-SUSE boo#1227316 -- sbrabec@suse.com
|
||||
Patch16: 0003-Fix-malformed-header-processing.patch
|
||||
|
||||
%description
|
||||
This package contains the intl library as well as tools that ease the
|
||||
@@ -92,8 +96,6 @@ License: LGPL-2.1-or-later
|
||||
Group: Development/Tools/Other
|
||||
Requires: %{name} = %{version}
|
||||
Requires: xz
|
||||
# gettext.sh requires envsubst
|
||||
Requires: envsubst%{?with_mini:-mini} = %{version}
|
||||
# autopoint requires find
|
||||
Requires: findutils
|
||||
# For non-UTF encodings
|
||||
@@ -173,18 +175,7 @@ This package provides headers and static libraries for libtextstyle
|
||||
%endif
|
||||
|
||||
%prep
|
||||
%setup -q -n %{pacname}-%{version}
|
||||
%patch -P 0
|
||||
%patch -P 1 -p1
|
||||
%patch -P 2
|
||||
%patch -P 3 -p1
|
||||
%patch -P 4
|
||||
%patch -P 5
|
||||
%patch -P 6 -p1
|
||||
%patch -P 11 -p1
|
||||
%patch -P 13 -p1
|
||||
%patch -P 14 -p1
|
||||
%patch -P 15 -p1
|
||||
%autosetup -p1 -n %{pacname}-%{version}
|
||||
|
||||
%build
|
||||
%define _lto_cflags %{nil}
|
||||
|
186
reproducible-jar.patch
Normal file
186
reproducible-jar.patch
Normal file
@@ -0,0 +1,186 @@
|
||||
commit 06bb3d6f86c43c7eb259cb2f0b8522ad87df40f1
|
||||
Author: Bruno Haible <bruno@clisp.org>
|
||||
Date: Tue Jul 16 23:59:05 2024 +0200
|
||||
|
||||
java: Create reproducible .jar files if the 'jar' utility supports it.
|
||||
|
||||
Suggested by Bernhard M. Wiedemann <bwiedemann@suse.de> in
|
||||
<https://lists.gnu.org/archive/html/bug-gettext/2024-07/msg00020.html>.
|
||||
|
||||
* build-aux/jar-cf: New file.
|
||||
* Makefile.am (EXTRA_DIST): Add it.
|
||||
* gettext-runtime/intl-java/Makefile.am (libintl.jar): Use jar-cf.
|
||||
* gettext-tools/src/Makefile.am (gettext.jar): Likewise.
|
||||
|
||||
diff --git a/Makefile.am b/Makefile.am
|
||||
index c3ac6e0e5..4e2ad1128 100644
|
||||
--- a/Makefile.am
|
||||
+++ b/Makefile.am
|
||||
@@ -54,7 +54,8 @@ EXTRA_DIST = \
|
||||
$(changelog_etc) DEPENDENCIES PACKAGING HACKING JOIN-GNU ChangeLog.0 \
|
||||
autogen.sh \
|
||||
check-copyright-headers \
|
||||
- build-aux/ac-help.sed build-aux/git-version-gen build-aux/texi2html \
|
||||
+ build-aux/ac-help.sed build-aux/git-version-gen build-aux/jar-cf \
|
||||
+ build-aux/texi2html \
|
||||
m4/fixautomake.m4 m4/woe32-dll.m4 \
|
||||
m4/libtool.m4
|
||||
|
||||
diff --git a/build-aux/jar-cf b/build-aux/jar-cf
|
||||
new file mode 100755
|
||||
index 000000000..f42578c02
|
||||
--- /dev/null
|
||||
+++ b/build-aux/jar-cf
|
||||
@@ -0,0 +1,112 @@
|
||||
+#!/bin/sh
|
||||
+# Creating a Java archive (.jar).
|
||||
+
|
||||
+# Copyright (C) 2024 Free Software Foundation, Inc.
|
||||
+#
|
||||
+# This file is free software: you can redistribute it and/or modify
|
||||
+# it under the terms of the GNU General Public License as published
|
||||
+# by the Free Software Foundation, either version 3 of the License,
|
||||
+# or (at your option) any later version.
|
||||
+#
|
||||
+# This file is distributed in the hope that it will be useful,
|
||||
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+# GNU General Public License for more details.
|
||||
+#
|
||||
+# You should have received a copy of the GNU General Public License
|
||||
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
+
|
||||
+# Written by Bruno Haible <bruno@clisp.org>, 2024.
|
||||
+
|
||||
+# func_usage
|
||||
+# outputs to stdout the --help usage message.
|
||||
+func_usage ()
|
||||
+{
|
||||
+ echo "\
|
||||
+Usage: jar-cf [OPTION]... JAR_PROGRAM TOP_SRCDIR DESTINATION.jar ELEMENT...
|
||||
+
|
||||
+Invokes the JAR_PROGRAM, to create DESTINATION.jar with the ELEMENTs as
|
||||
+contents.
|
||||
+
|
||||
+Options:
|
||||
+ --help print this help and exit
|
||||
+ --version print version information and exit
|
||||
+
|
||||
+Send patches and bug reports to <bug-gettext@gnu.org>."
|
||||
+}
|
||||
+
|
||||
+# func_version
|
||||
+# outputs to stdout the --version message.
|
||||
+func_version ()
|
||||
+{
|
||||
+ echo "jar-cf (GNU gettext)"
|
||||
+ echo "Copyright (C) 2024 Free Software Foundation, Inc.
|
||||
+License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
|
||||
+This is free software: you are free to change and redistribute it.
|
||||
+There is NO WARRANTY, to the extent permitted by law."
|
||||
+ echo
|
||||
+ printf 'Written by %s.\n' "Bruno Haible"
|
||||
+}
|
||||
+
|
||||
+# func_fatal_error message
|
||||
+# outputs to stderr a fatal error message, and terminates the program.
|
||||
+func_fatal_error ()
|
||||
+{
|
||||
+ echo "jar-cf: *** $1" 1>&2
|
||||
+ echo "jar-cf: *** Stop." 1>&2
|
||||
+ exit 1
|
||||
+}
|
||||
+
|
||||
+# Outputs a command and runs it.
|
||||
+func_verbose ()
|
||||
+{
|
||||
+ # Make it easy to copy&paste the printed command into a shell in most cases,
|
||||
+ # by escaping '\\', '"', and '$'. This is not perfect, just good enough.
|
||||
+ echo "$@" | sed -e 's/\([\\"$]\)/\\\1/g'
|
||||
+ "$@"
|
||||
+}
|
||||
+
|
||||
+# Command-line option processing.
|
||||
+while test $# -gt 0; do
|
||||
+ case "$1" in
|
||||
+ --help | --hel | --he | --h )
|
||||
+ func_usage
|
||||
+ exit 0 ;;
|
||||
+ --version | --versio | --versi | --vers | --ver | --ve | --v )
|
||||
+ func_version
|
||||
+ exit 0 ;;
|
||||
+ -- ) # Stop option processing
|
||||
+ shift; break ;;
|
||||
+ -* )
|
||||
+ func_fatal_error "unrecognized option: $1"
|
||||
+ ;;
|
||||
+ * )
|
||||
+ break ;;
|
||||
+ esac
|
||||
+done
|
||||
+
|
||||
+if test $# -lt 2; then
|
||||
+ func_fatal_error "too few arguments"
|
||||
+fi
|
||||
+
|
||||
+jar_program="$1"
|
||||
+top_srcdir="$2"
|
||||
+shift
|
||||
+shift
|
||||
+
|
||||
+if $jar_program --help 2>&1 | grep '\-\-date=' >/dev/null; then
|
||||
+ # The JAR_PROGRAM supports the --date option. Its effect is to set the given
|
||||
+ # date as time stamp on all the ELEMENTs and also the META-INF/MANIFEST.MF.
|
||||
+ # Use it, for reproducibility (cf. <https://reproducible-builds.org/>).
|
||||
+ if test -d "$top_srcdir/.git"; then
|
||||
+ # We are in a git checkout. Use the date of the latest commit.
|
||||
+ date=`git log -n 1 --date=iso --format=fuller | sed -n -e 's/^CommitDate: //p' | sed -e 's/ /T/' -e 's/ \(...\)\(..\)$/\1:\2/'`
|
||||
+ else
|
||||
+ # We are building from a tarball.
|
||||
+ # Use the date of the first entry of the ChangeLog file.
|
||||
+ date=`sed -n -e 's/^\([0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]\).*/\1/p' -e 1q "$top_srcdir/ChangeLog"`'T00:00:00+00:00'
|
||||
+ fi
|
||||
+ func_verbose $jar_program --date="$date" -c -f "$@"
|
||||
+else
|
||||
+ func_verbose $jar_program cf "$@"
|
||||
+fi
|
||||
diff --git a/gettext-runtime/intl-java/Makefile.am b/gettext-runtime/intl-java/Makefile.am
|
||||
index a8c5290e9..4444f6e6c 100644
|
||||
--- a/gettext-runtime/intl-java/Makefile.am
|
||||
+++ b/gettext-runtime/intl-java/Makefile.am
|
||||
@@ -1,5 +1,5 @@
|
||||
## Makefile for the gettext-runtime/intl-java subdirectory of GNU gettext
|
||||
-## Copyright (C) 2001-2003, 2006-2007, 2013 Free Software Foundation, Inc.
|
||||
+## Copyright (C) 2001-2024 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
|
||||
@@ -45,7 +45,7 @@ gnu/gettext/GettextResource.class: $(srcdir)/gnu/gettext/GettextResource.java
|
||||
$(JAVACOMP) -d . $(srcdir)/gnu/gettext/GettextResource.java
|
||||
|
||||
libintl.jar: gnu/gettext/GettextResource.class
|
||||
- $(JAR) cf $@ gnu/gettext/GettextResource*.class
|
||||
+ $(top_srcdir)/../build-aux/jar-cf '$(JAR)' '$(top_srcdir)/..' $@ gnu/gettext/GettextResource*.class
|
||||
|
||||
EXTRA_DIST += gnu/gettext/GettextResource.java
|
||||
|
||||
diff --git a/gettext-tools/src/Makefile.am b/gettext-tools/src/Makefile.am
|
||||
index d95b08ed6..0316ca287 100644
|
||||
--- a/gettext-tools/src/Makefile.am
|
||||
+++ b/gettext-tools/src/Makefile.am
|
||||
@@ -1,5 +1,5 @@
|
||||
## Makefile for the gettext-tools/src subdirectory of GNU gettext
|
||||
-## Copyright (C) 1995-1998, 2000-2023 Free Software Foundation, Inc.
|
||||
+## Copyright (C) 1995-2024 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
|
||||
@@ -655,7 +655,7 @@ gnu/gettext/GetURL.class: $(srcdir)/gnu/gettext/GetURL.java
|
||||
$(JAVACOMP) -d . $(srcdir)/gnu/gettext/GetURL.java
|
||||
|
||||
gettext.jar: gnu/gettext/DumpResource.class gnu/gettext/GetURL.class
|
||||
- $(JAR) cf $@ gnu/gettext/DumpResource*.class gnu/gettext/GetURL*.class
|
||||
+ $(top_srcdir)/../build-aux/jar-cf '$(JAR)' '$(top_srcdir)/..' $@ gnu/gettext/DumpResource*.class gnu/gettext/GetURL*.class
|
||||
|
||||
EXTRA_DIST += gnu/gettext/DumpResource.java gnu/gettext/GetURL.java
|
||||
|
Reference in New Issue
Block a user