Merge ~ubuntu-core-dev/grub/+git/ubuntu:translation-template-fix into ~ubuntu-core-dev/grub/+git/ubuntu:ubuntu

Proposed by Sebastien Bacher
Status: Merged
Merged at revision: 588161a80c1d464b4eb9c6a7a5b6f91193292c33
Proposed branch: ~ubuntu-core-dev/grub/+git/ubuntu:translation-template-fix
Merge into: ~ubuntu-core-dev/grub/+git/ubuntu:ubuntu
Diff against target: 221 lines (+178/-0)
6 files modified
debian/changelog (+10/-0)
debian/patches/gettext/0001-Support-POTFILES-shell.patch (+54/-0)
debian/patches/gettext/0002-Handle-gettext_printf-shell-function.patch (+46/-0)
debian/patches/gettext/0003-Make-msgfmt-output-in-little-endian.patch (+34/-0)
debian/patches/gettext/0004-Use-SHELL-rather-than-bin-sh.patch (+26/-0)
debian/rules (+8/-0)
Reviewer Review Type Date Requested Status
Julian Andres Klode Approve
Colin Watson Pending
Review via email: mp+382057@code.launchpad.net

Commit message

* debian/patches/gettext,
  debian/patches/rules:
  - backport upstream patches to fix the list of translated strings,
    reported on the ubuntu-translators mailing list. The changes would
    be overwritten by autoreconf so applying from a rules override.

Description of the change

See https://lists.ubuntu.com/archives/ubuntu-translators/2020-April/007636.html

The patches can't be applied from the series since that would be before autoreconf which overrides the local customizations.

There should be no need to tweak the clean target since that's only patching a generated files and dh_autoreconf should already handle restoring the original version

To post a comment you must log in.
Revision history for this message
Sebastien Bacher (seb128) wrote :

Sorry for the resubmit, by default launchpad picked Colin's Vcs as target...

Revision history for this message
Julian Andres Klode (juliank) wrote :

Looks OK, I'll merge this together with https://code.launchpad.net/~juliank/grub/+git/ubuntu/+merge/382201 as an upload.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/changelog b/debian/changelog
2index 24909ac..cb84e81 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,13 @@
6+grub2 (2.04-1ubuntu25) UNRELEASED; urgency=medium
7+
8+ * debian/patches/gettext,
9+ debian/patches/rules:
10+ - backport upstream patches to fix the list of translated strings,
11+ reported on the ubuntu-translators mailing list. The changes would
12+ be overwritten by autoreconf so applying from a rules override.
13+
14+ -- Sebastien Bacher <seb128@ubuntu.com> Fri, 10 Apr 2020 08:33:51 +0200
15+
16 grub2 (2.04-1ubuntu24) focal; urgency=medium
17
18 * Support installing to multiple ESPs (LP: #1871821)
19diff --git a/debian/patches/gettext/0001-Support-POTFILES-shell.patch b/debian/patches/gettext/0001-Support-POTFILES-shell.patch
20new file mode 100644
21index 0000000..5a5d1ec
22--- /dev/null
23+++ b/debian/patches/gettext/0001-Support-POTFILES-shell.patch
24@@ -0,0 +1,54 @@
25+From d5bbd8f60aacb0f73ea5a0bde999152c467d0e78 Mon Sep 17 00:00:00 2001
26+From: Colin Watson <cjwatson@debian.org>
27+Date: Sun, 1 Mar 2020 11:57:58 +0000
28+Subject: [PATCH 1/4] Support POTFILES-shell
29+
30+---
31+ gettext-runtime/po/Makefile.in.in | 24 ++++++++++++++++++++++--
32+ 1 file changed, 22 insertions(+), 2 deletions(-)
33+
34+diff --git a/gettext-runtime/po/Makefile.in.in b/gettext-runtime/po/Makefile.in.in
35+index fabdc76c9..32e9323d3 100644
36+--- a/gettext-runtime/po/Makefile.in.in
37++++ b/gettext-runtime/po/Makefile.in.in
38+@@ -142,7 +142,7 @@ stamp-po: $(srcdir)/$(DOMAIN).pot
39+ # The determination of whether the package xyz is a GNU one is based on the
40+ # heuristic whether some file in the top level directory mentions "GNU xyz".
41+ # If GNU 'find' is available, we avoid grepping through monster files.
42+-$(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed
43++$(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in $(srcdir)/POTFILES-shell.in remove-potcdate.sed
44+ if { if (LC_ALL=C find --version) 2>/dev/null | grep GNU >/dev/null; then \
45+ LC_ALL=C find -L $(top_srcdir) -maxdepth 1 -type f -size -10000000c -exec grep 'GNU @PACKAGE@' /dev/null '{}' ';' 2>/dev/null; \
46+ else \
47+@@ -175,7 +175,27 @@ $(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed
48+ --package-version='@VERSION@' \
49+ --msgid-bugs-address="$$msgid_bugs_address" \
50+ ;; \
51+- esac
52++ esac; \
53++ case `$(XGETTEXT) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \
54++ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-5] | 0.1[0-5].* | 0.16 | 0.16.[0-1]*) \
55++ $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \
56++ --add-comments=TRANSLATORS: @XGETTEXT_EXTRA_OPTIONS@ \
57++ --files-from=$(srcdir)/POTFILES-shell.in \
58++ --copyright-holder='$(COPYRIGHT_HOLDER)' \
59++ --msgid-bugs-address="$$msgid_bugs_address" \
60++ --join-existing --language=Shell --keyword=gettext_quoted \
61++ ;; \
62++ *) \
63++ $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \
64++ --add-comments=TRANSLATORS: @XGETTEXT_EXTRA_OPTIONS@ \
65++ --files-from=$(srcdir)/POTFILES-shell.in \
66++ --copyright-holder='$(COPYRIGHT_HOLDER)' \
67++ --package-name="$${package_gnu}@PACKAGE@" \
68++ --package-version='@VERSION@' \
69++ --msgid-bugs-address="$$msgid_bugs_address" \
70++ --join-existing --language=Shell --keyword=gettext_quoted \
71++ ;; \
72++ esac; \
73+ test ! -f $(DOMAIN).po || { \
74+ if test -f $(srcdir)/$(DOMAIN).pot; then \
75+ sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \
76+--
77+2.17.1
78+
79diff --git a/debian/patches/gettext/0002-Handle-gettext_printf-shell-function.patch b/debian/patches/gettext/0002-Handle-gettext_printf-shell-function.patch
80new file mode 100644
81index 0000000..2767ed6
82--- /dev/null
83+++ b/debian/patches/gettext/0002-Handle-gettext_printf-shell-function.patch
84@@ -0,0 +1,46 @@
85+From fd17c51f2e6c87427679fbdfb5f6224ff48795db Mon Sep 17 00:00:00 2001
86+From: Colin Watson <cjwatson@debian.org>
87+Date: Sun, 1 Mar 2020 12:00:41 +0000
88+Subject: [PATCH 2/4] Handle gettext_printf shell function
89+
90+Extract gettext_printf arguments.
91+
92+Run grub.d.sed over strings extracted from util/grub.d/, in order to set
93+c-format flags (xgettext refuses to include these itself for strings it
94+extracted from a shell file, but these really are c-format).
95+---
96+ gettext-runtime/po/Makefile.in.in | 8 ++++++--
97+ 1 file changed, 6 insertions(+), 2 deletions(-)
98+
99+diff --git a/gettext-runtime/po/Makefile.in.in b/gettext-runtime/po/Makefile.in.in
100+index 32e9323d3..32e0c99a2 100644
101+--- a/gettext-runtime/po/Makefile.in.in
102++++ b/gettext-runtime/po/Makefile.in.in
103+@@ -183,7 +183,8 @@ $(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in $(srcdir)/POTFILES-shell
104+ --files-from=$(srcdir)/POTFILES-shell.in \
105+ --copyright-holder='$(COPYRIGHT_HOLDER)' \
106+ --msgid-bugs-address="$$msgid_bugs_address" \
107+- --join-existing --language=Shell --keyword=gettext_quoted \
108++ --join-existing --language=Shell \
109++ --keyword=gettext_quoted --keyword=gettext_printf \
110+ ;; \
111+ *) \
112+ $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \
113+@@ -193,10 +194,13 @@ $(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in $(srcdir)/POTFILES-shell
114+ --package-name="$${package_gnu}@PACKAGE@" \
115+ --package-version='@VERSION@' \
116+ --msgid-bugs-address="$$msgid_bugs_address" \
117+- --join-existing --language=Shell --keyword=gettext_quoted \
118++ --join-existing --language=Shell \
119++ --keyword=gettext_quoted --keyword=gettext_printf \
120+ ;; \
121+ esac; \
122+ test ! -f $(DOMAIN).po || { \
123++ sed -f grub.d.sed < $(DOMAIN).po > $(DOMAIN).1po && \
124++ mv $(DOMAIN).1po $(DOMAIN).po; \
125+ if test -f $(srcdir)/$(DOMAIN).pot; then \
126+ sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \
127+ sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \
128+--
129+2.17.1
130+
131diff --git a/debian/patches/gettext/0003-Make-msgfmt-output-in-little-endian.patch b/debian/patches/gettext/0003-Make-msgfmt-output-in-little-endian.patch
132new file mode 100644
133index 0000000..4141611
134--- /dev/null
135+++ b/debian/patches/gettext/0003-Make-msgfmt-output-in-little-endian.patch
136@@ -0,0 +1,34 @@
137+From 156c523e2945c9b43c5500fb93988b0dd2f08d75 Mon Sep 17 00:00:00 2001
138+From: Vladimir Serbinenko <phcoder@gmail.com>
139+Date: Sun, 1 Mar 2020 12:09:25 +0000
140+Subject: [PATCH 3/4] Make msgfmt output in little-endian
141+
142+GRUB expects this.
143+---
144+ gettext-runtime/po/Makefile.in.in | 6 +++---
145+ 1 file changed, 3 insertions(+), 3 deletions(-)
146+
147+diff --git a/gettext-runtime/po/Makefile.in.in b/gettext-runtime/po/Makefile.in.in
148+index 32e0c99a2..f3ef54c39 100644
149+--- a/gettext-runtime/po/Makefile.in.in
150++++ b/gettext-runtime/po/Makefile.in.in
151+@@ -84,13 +84,13 @@ CATALOGS = @CATALOGS@
152+
153+ .po.mo:
154+ @echo "$(MSGFMT) -c -o $@ $<"; \
155+- $(MSGFMT) -c -o t-$@ $< && mv t-$@ $@
156++ $(MSGFMT) --endianness=little -c -o t-$@ $< && mv t-$@ $@
157+
158+ .po.gmo:
159+ @lang=`echo $* | sed -e 's,.*/,,'`; \
160+ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
161+- echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o $${lang}.gmo $${lang}.po"; \
162+- cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo
163++ echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) --endianness=little -c --statistics --verbose -o $${lang}.gmo $${lang}.po"; \
164++ cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) --endianness=little -c --statistics --verbose -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo
165+
166+ .sin.sed:
167+ sed -e '/^#/d' $< > t-$@
168+--
169+2.17.1
170+
171diff --git a/debian/patches/gettext/0004-Use-SHELL-rather-than-bin-sh.patch b/debian/patches/gettext/0004-Use-SHELL-rather-than-bin-sh.patch
172new file mode 100644
173index 0000000..790521d
174--- /dev/null
175+++ b/debian/patches/gettext/0004-Use-SHELL-rather-than-bin-sh.patch
176@@ -0,0 +1,26 @@
177+From f36f12e77798223ee7ee882c0d09e0e63db11454 Mon Sep 17 00:00:00 2001
178+From: Colin Watson <cjwatson@debian.org>
179+Date: Sun, 1 Mar 2020 12:14:07 +0000
180+Subject: [PATCH 4/4] Use @SHELL rather than /bin/sh
181+
182+/bin/sh might not exist.
183+---
184+ gettext-runtime/po/Makefile.in.in | 2 +-
185+ 1 file changed, 1 insertion(+), 1 deletion(-)
186+
187+diff --git a/gettext-runtime/po/Makefile.in.in b/gettext-runtime/po/Makefile.in.in
188+index f3ef54c39..285a55a9d 100644
189+--- a/gettext-runtime/po/Makefile.in.in
190++++ b/gettext-runtime/po/Makefile.in.in
191+@@ -16,7 +16,7 @@ VERSION = @VERSION@
192+ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
193+
194+ SED = @SED@
195+-SHELL = /bin/sh
196++SHELL = @SHELL@
197+ @SET_MAKE@
198+
199+ srcdir = @srcdir@
200+--
201+2.17.1
202+
203diff --git a/debian/rules b/debian/rules
204index 9546836..9fa5a53 100755
205--- a/debian/rules
206+++ b/debian/rules
207@@ -167,6 +167,14 @@ override_dh_autoreconf:
208 env -u DH_OPTIONS GRUB_CONTRIB=$(CURDIR)/debian/grub-extras-enabled \
209 PYTHON=python3 \
210 dh_autoreconf -- ./autogen.sh
211+ for patchname in \
212+ 0001-Support-POTFILES-shell \
213+ 0002-Handle-gettext_printf-shell-function \
214+ 0003-Make-msgfmt-output-in-little-endian \
215+ 0004-Use-SHELL-rather-than-bin-sh; do \
216+ patch -d po -p3 \
217+ < "debian/patches/gettext/$$patchname.patch"; \
218+ done
219
220 debian/stamps/configure-grub-common: debian/stamps/configure-grub-$(COMMON_PLATFORM)
221 touch $@

Subscribers

People subscribed via source and target branches