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
diff --git a/debian/changelog b/debian/changelog
index 24909ac..cb84e81 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,13 @@
1grub2 (2.04-1ubuntu25) UNRELEASED; urgency=medium
2
3 * debian/patches/gettext,
4 debian/patches/rules:
5 - backport upstream patches to fix the list of translated strings,
6 reported on the ubuntu-translators mailing list. The changes would
7 be overwritten by autoreconf so applying from a rules override.
8
9 -- Sebastien Bacher <seb128@ubuntu.com> Fri, 10 Apr 2020 08:33:51 +0200
10
1grub2 (2.04-1ubuntu24) focal; urgency=medium11grub2 (2.04-1ubuntu24) focal; urgency=medium
212
3 * Support installing to multiple ESPs (LP: #1871821)13 * Support installing to multiple ESPs (LP: #1871821)
diff --git a/debian/patches/gettext/0001-Support-POTFILES-shell.patch b/debian/patches/gettext/0001-Support-POTFILES-shell.patch
4new file mode 10064414new file mode 100644
index 0000000..5a5d1ec
--- /dev/null
+++ b/debian/patches/gettext/0001-Support-POTFILES-shell.patch
@@ -0,0 +1,54 @@
1From d5bbd8f60aacb0f73ea5a0bde999152c467d0e78 Mon Sep 17 00:00:00 2001
2From: Colin Watson <cjwatson@debian.org>
3Date: Sun, 1 Mar 2020 11:57:58 +0000
4Subject: [PATCH 1/4] Support POTFILES-shell
5
6---
7 gettext-runtime/po/Makefile.in.in | 24 ++++++++++++++++++++++--
8 1 file changed, 22 insertions(+), 2 deletions(-)
9
10diff --git a/gettext-runtime/po/Makefile.in.in b/gettext-runtime/po/Makefile.in.in
11index fabdc76c9..32e9323d3 100644
12--- a/gettext-runtime/po/Makefile.in.in
13+++ b/gettext-runtime/po/Makefile.in.in
14@@ -142,7 +142,7 @@ stamp-po: $(srcdir)/$(DOMAIN).pot
15 # The determination of whether the package xyz is a GNU one is based on the
16 # heuristic whether some file in the top level directory mentions "GNU xyz".
17 # If GNU 'find' is available, we avoid grepping through monster files.
18-$(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed
19+$(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in $(srcdir)/POTFILES-shell.in remove-potcdate.sed
20 if { if (LC_ALL=C find --version) 2>/dev/null | grep GNU >/dev/null; then \
21 LC_ALL=C find -L $(top_srcdir) -maxdepth 1 -type f -size -10000000c -exec grep 'GNU @PACKAGE@' /dev/null '{}' ';' 2>/dev/null; \
22 else \
23@@ -175,7 +175,27 @@ $(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed
24 --package-version='@VERSION@' \
25 --msgid-bugs-address="$$msgid_bugs_address" \
26 ;; \
27- esac
28+ esac; \
29+ case `$(XGETTEXT) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \
30+ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-5] | 0.1[0-5].* | 0.16 | 0.16.[0-1]*) \
31+ $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \
32+ --add-comments=TRANSLATORS: @XGETTEXT_EXTRA_OPTIONS@ \
33+ --files-from=$(srcdir)/POTFILES-shell.in \
34+ --copyright-holder='$(COPYRIGHT_HOLDER)' \
35+ --msgid-bugs-address="$$msgid_bugs_address" \
36+ --join-existing --language=Shell --keyword=gettext_quoted \
37+ ;; \
38+ *) \
39+ $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \
40+ --add-comments=TRANSLATORS: @XGETTEXT_EXTRA_OPTIONS@ \
41+ --files-from=$(srcdir)/POTFILES-shell.in \
42+ --copyright-holder='$(COPYRIGHT_HOLDER)' \
43+ --package-name="$${package_gnu}@PACKAGE@" \
44+ --package-version='@VERSION@' \
45+ --msgid-bugs-address="$$msgid_bugs_address" \
46+ --join-existing --language=Shell --keyword=gettext_quoted \
47+ ;; \
48+ esac; \
49 test ! -f $(DOMAIN).po || { \
50 if test -f $(srcdir)/$(DOMAIN).pot; then \
51 sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \
52--
532.17.1
54
diff --git a/debian/patches/gettext/0002-Handle-gettext_printf-shell-function.patch b/debian/patches/gettext/0002-Handle-gettext_printf-shell-function.patch
0new file mode 10064455new file mode 100644
index 0000000..2767ed6
--- /dev/null
+++ b/debian/patches/gettext/0002-Handle-gettext_printf-shell-function.patch
@@ -0,0 +1,46 @@
1From fd17c51f2e6c87427679fbdfb5f6224ff48795db Mon Sep 17 00:00:00 2001
2From: Colin Watson <cjwatson@debian.org>
3Date: Sun, 1 Mar 2020 12:00:41 +0000
4Subject: [PATCH 2/4] Handle gettext_printf shell function
5
6Extract gettext_printf arguments.
7
8Run grub.d.sed over strings extracted from util/grub.d/, in order to set
9c-format flags (xgettext refuses to include these itself for strings it
10extracted from a shell file, but these really are c-format).
11---
12 gettext-runtime/po/Makefile.in.in | 8 ++++++--
13 1 file changed, 6 insertions(+), 2 deletions(-)
14
15diff --git a/gettext-runtime/po/Makefile.in.in b/gettext-runtime/po/Makefile.in.in
16index 32e9323d3..32e0c99a2 100644
17--- a/gettext-runtime/po/Makefile.in.in
18+++ b/gettext-runtime/po/Makefile.in.in
19@@ -183,7 +183,8 @@ $(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in $(srcdir)/POTFILES-shell
20 --files-from=$(srcdir)/POTFILES-shell.in \
21 --copyright-holder='$(COPYRIGHT_HOLDER)' \
22 --msgid-bugs-address="$$msgid_bugs_address" \
23- --join-existing --language=Shell --keyword=gettext_quoted \
24+ --join-existing --language=Shell \
25+ --keyword=gettext_quoted --keyword=gettext_printf \
26 ;; \
27 *) \
28 $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \
29@@ -193,10 +194,13 @@ $(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in $(srcdir)/POTFILES-shell
30 --package-name="$${package_gnu}@PACKAGE@" \
31 --package-version='@VERSION@' \
32 --msgid-bugs-address="$$msgid_bugs_address" \
33- --join-existing --language=Shell --keyword=gettext_quoted \
34+ --join-existing --language=Shell \
35+ --keyword=gettext_quoted --keyword=gettext_printf \
36 ;; \
37 esac; \
38 test ! -f $(DOMAIN).po || { \
39+ sed -f grub.d.sed < $(DOMAIN).po > $(DOMAIN).1po && \
40+ mv $(DOMAIN).1po $(DOMAIN).po; \
41 if test -f $(srcdir)/$(DOMAIN).pot; then \
42 sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \
43 sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \
44--
452.17.1
46
diff --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
0new file mode 10064447new file mode 100644
index 0000000..4141611
--- /dev/null
+++ b/debian/patches/gettext/0003-Make-msgfmt-output-in-little-endian.patch
@@ -0,0 +1,34 @@
1From 156c523e2945c9b43c5500fb93988b0dd2f08d75 Mon Sep 17 00:00:00 2001
2From: Vladimir Serbinenko <phcoder@gmail.com>
3Date: Sun, 1 Mar 2020 12:09:25 +0000
4Subject: [PATCH 3/4] Make msgfmt output in little-endian
5
6GRUB expects this.
7---
8 gettext-runtime/po/Makefile.in.in | 6 +++---
9 1 file changed, 3 insertions(+), 3 deletions(-)
10
11diff --git a/gettext-runtime/po/Makefile.in.in b/gettext-runtime/po/Makefile.in.in
12index 32e0c99a2..f3ef54c39 100644
13--- a/gettext-runtime/po/Makefile.in.in
14+++ b/gettext-runtime/po/Makefile.in.in
15@@ -84,13 +84,13 @@ CATALOGS = @CATALOGS@
16
17 .po.mo:
18 @echo "$(MSGFMT) -c -o $@ $<"; \
19- $(MSGFMT) -c -o t-$@ $< && mv t-$@ $@
20+ $(MSGFMT) --endianness=little -c -o t-$@ $< && mv t-$@ $@
21
22 .po.gmo:
23 @lang=`echo $* | sed -e 's,.*/,,'`; \
24 test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
25- echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o $${lang}.gmo $${lang}.po"; \
26- cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo
27+ echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) --endianness=little -c --statistics --verbose -o $${lang}.gmo $${lang}.po"; \
28+ cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) --endianness=little -c --statistics --verbose -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo
29
30 .sin.sed:
31 sed -e '/^#/d' $< > t-$@
32--
332.17.1
34
diff --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
0new file mode 10064435new file mode 100644
index 0000000..790521d
--- /dev/null
+++ b/debian/patches/gettext/0004-Use-SHELL-rather-than-bin-sh.patch
@@ -0,0 +1,26 @@
1From f36f12e77798223ee7ee882c0d09e0e63db11454 Mon Sep 17 00:00:00 2001
2From: Colin Watson <cjwatson@debian.org>
3Date: Sun, 1 Mar 2020 12:14:07 +0000
4Subject: [PATCH 4/4] Use @SHELL rather than /bin/sh
5
6/bin/sh might not exist.
7---
8 gettext-runtime/po/Makefile.in.in | 2 +-
9 1 file changed, 1 insertion(+), 1 deletion(-)
10
11diff --git a/gettext-runtime/po/Makefile.in.in b/gettext-runtime/po/Makefile.in.in
12index f3ef54c39..285a55a9d 100644
13--- a/gettext-runtime/po/Makefile.in.in
14+++ b/gettext-runtime/po/Makefile.in.in
15@@ -16,7 +16,7 @@ VERSION = @VERSION@
16 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
17
18 SED = @SED@
19-SHELL = /bin/sh
20+SHELL = @SHELL@
21 @SET_MAKE@
22
23 srcdir = @srcdir@
24--
252.17.1
26
diff --git a/debian/rules b/debian/rules
index 9546836..9fa5a53 100755
--- a/debian/rules
+++ b/debian/rules
@@ -167,6 +167,14 @@ override_dh_autoreconf:
167 env -u DH_OPTIONS GRUB_CONTRIB=$(CURDIR)/debian/grub-extras-enabled \167 env -u DH_OPTIONS GRUB_CONTRIB=$(CURDIR)/debian/grub-extras-enabled \
168 PYTHON=python3 \168 PYTHON=python3 \
169 dh_autoreconf -- ./autogen.sh169 dh_autoreconf -- ./autogen.sh
170 for patchname in \
171 0001-Support-POTFILES-shell \
172 0002-Handle-gettext_printf-shell-function \
173 0003-Make-msgfmt-output-in-little-endian \
174 0004-Use-SHELL-rather-than-bin-sh; do \
175 patch -d po -p3 \
176 < "debian/patches/gettext/$$patchname.patch"; \
177 done
170178
171debian/stamps/configure-grub-common: debian/stamps/configure-grub-$(COMMON_PLATFORM)179debian/stamps/configure-grub-common: debian/stamps/configure-grub-$(COMMON_PLATFORM)
172 touch $@180 touch $@

Subscribers

People subscribed via source and target branches