Blame SOURCES/libbytesize-potfile.patch

2704ea
From ee80e25d87b00236bae9f4d37cd5232bcb995f17 Mon Sep 17 00:00:00 2001
2704ea
From: Vojtech Trefny <vtrefny@redhat.com>
2704ea
Date: Tue, 29 Oct 2019 10:09:13 +0100
2704ea
Subject: [PATCH] Add POT file to git and do not rebuild it during every build
2704ea
2704ea
This fixes bug with multilib packages in Fedora/RHEL -- we don't
2704ea
have a special package for translation files so we need to make
2704ea
sure the files are exactly same for every architecture. With POT
2704ea
file being generated during build the generated MO files are
2704ea
different because they contain timestamp from the POT file.
2704ea
POT file is now automatically updated during 'make bumpver'.
2704ea
---
2704ea
 Makefile.am              |   1 +
2704ea
 po/Makefile.am           |  12 ++---
2704ea
 po/libbytesize.pot       | 103 +++++++++++++++++++++++++++++++++++++++
2704ea
 tests/canary_tests.sh.in |   9 +---
2704ea
 4 files changed, 111 insertions(+), 14 deletions(-)
2704ea
 create mode 100644 po/libbytesize.pot
2704ea
2704ea
diff --git a/Makefile.am b/Makefile.am
2704ea
index ce06f1f..185d754 100644
2704ea
--- a/Makefile.am
2704ea
+++ b/Makefile.am
2704ea
@@ -97,6 +97,7 @@ bumpver:
2704ea
 	mv dist/libbytesize.spec.in.new dist/libbytesize.spec.in ; rm -f speclog ; \
2704ea
 	sed -ri "s/(AC_INIT\(\[$(PACKAGE_NAME)\], \[)[0-9]+\.[0-9]+(\],.*)/\1$$VERSION.$$NEWSUBVERSION\2/" configure.ac ; \
2704ea
 	sed -ri "s/Version:(\\s+)[-0-9.]+/Version:\\1$$VERSION.$$NEWSUBVERSION/" dist/libbytesize.spec.in ;
2704ea
+	$(MAKE) -C po/ $(PACKAGE_NAME).pot-update
2704ea
2704ea
 archive: po-pull
2704ea
 	$(MAKE) distcheck
2704ea
diff --git a/po/Makefile.am b/po/Makefile.am
2704ea
index 5c288ab..de4ad7d 100644
2704ea
--- a/po/Makefile.am
2704ea
+++ b/po/Makefile.am
2704ea
@@ -161,12 +161,12 @@ MSGMERGE_V_OPTIONS_1 = $(MSGMERGE_OPTIONS) --verbose
2704ea
2704ea
 # Actually do stuff:
2704ea
 # .po files get distributed but not installed
2704ea
-dist_noinst_DATA = $(POFILES)
2704ea
+dist_noinst_DATA = $(POFILES) $(POTFILE)
2704ea
2704ea
 # Build the .mo files but don't actually do anything with them. The real
2704ea
 # install part is in the install-data-local target below. Build the .pot file
2704ea
 # as well, even if there are no .mo files to build, so it can be tested.
2704ea
-nodist_noinst_DATA = $(MOFILES) $(POTFILE)
2704ea
+nodist_noinst_DATA = $(MOFILES)
2704ea
2704ea
 # How to build the .pot file. This needs to be regenerated if anything that
2704ea
 # goes into it has changed.
2704ea
@@ -181,13 +181,13 @@ $(PACKAGE).pot-update:
2704ea
 	@$(MAKE) $(POTFILE)
2704ea
2704ea
 # How to build the merged .mpo files from the .po files
2704ea
-$(MERGED_POFILES): $(POFILES) $(POTFILE)
2704ea
+$(MERGED_POFILES): $(POFILES)
2704ea
2704ea
 .po.mpo:
2704ea
-	$(GETTEXT_V_MERGE)$(MSGMERGE) $(MSGMERGE_V_OPTIONS) -o $@ $< $(POTFILE)
2704ea
+	$(GETTEXT_V_MERGE)$(MSGMERGE) $(MSGMERGE_V_OPTIONS) -o $@ $< $(top_srcdir)/po/$(POTFILE)
2704ea
2704ea
 # How to build the .mo files from the .mpo files
2704ea
-$(MOFILES): $(MERGED_POFILES)
2704ea
+$(MOFILES): $(MERGED_POFILES) $(POTFILE)
2704ea
2704ea
 .mpo.mo:
2704ea
 	$(GETTEXT_V_FORMAT)$(MSGFMT) $(MSGFMT_V_OPTIONS) -o $@ $<
2704ea
@@ -210,4 +210,4 @@ uninstall-local:
2704ea
 		rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(PACKAGE).mo ; \
2704ea
 	done
2704ea
2704ea
-CLEANFILES = $(MERGED_POFILES) $(MOFILES) $(POTFILE)
2704ea
+CLEANFILES = $(MERGED_POFILES) $(MOFILES)
2704ea
diff --git a/po/libbytesize.pot b/po/libbytesize.pot
2704ea
new file mode 100644
2704ea
index 0000000..5431896
2704ea
--- /dev/null
2704ea
+++ b/po/libbytesize.pot
2704ea
@@ -0,0 +1,103 @@
2704ea
+# SOME DESCRIPTIVE TITLE.
2704ea
+# Copyright (C) YEAR Red Hat, Inc.
2704ea
+# This file is distributed under the same license as the libbytesize package.
2704ea
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
2704ea
+#
2704ea
+#, fuzzy
2704ea
+msgid ""
2704ea
+msgstr ""
2704ea
+"Project-Id-Version: libbytesize 2.1\n"
2704ea
+"Report-Msgid-Bugs-To: anaconda-devel-list@redhat.com\n"
2704ea
+"POT-Creation-Date: 2019-10-29 12:28+0100\n"
2704ea
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
2704ea
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
2704ea
+"Language-Team: LANGUAGE <LL@li.org>\n"
2704ea
+"Language: \n"
2704ea
+"MIME-Version: 1.0\n"
2704ea
+"Content-Type: text/plain; charset=CHARSET\n"
2704ea
+"Content-Transfer-Encoding: 8bit\n"
2704ea
+
2704ea
+#. TRANSLATORS: 'B' for bytes
2704ea
+#: src/bs_size.c:52 src/bs_size.c:73
2704ea
+msgid "B"
2704ea
+msgstr ""
2704ea
+
2704ea
+#. TRANSLATORS: abbreviation for kibibyte, 2**10 bytes
2704ea
+#: src/bs_size.c:54
2704ea
+msgid "KiB"
2704ea
+msgstr ""
2704ea
+
2704ea
+#. TRANSLATORS: abbreviation for mebibyte, 2**20 bytes
2704ea
+#: src/bs_size.c:56
2704ea
+msgid "MiB"
2704ea
+msgstr ""
2704ea
+
2704ea
+#. TRANSLATORS: abbreviation for gibibyte, 2**30 bytes
2704ea
+#: src/bs_size.c:58
2704ea
+msgid "GiB"
2704ea
+msgstr ""
2704ea
+
2704ea
+#. TRANSLATORS: abbreviation for tebibyte, 2**40 bytes
2704ea
+#: src/bs_size.c:60
2704ea
+msgid "TiB"
2704ea
+msgstr ""
2704ea
+
2704ea
+#. TRANSLATORS: abbreviation for pebibyte, 2**50 bytes
2704ea
+#: src/bs_size.c:62
2704ea
+msgid "PiB"
2704ea
+msgstr ""
2704ea
+
2704ea
+#. TRANSLATORS: abbreviation for exbibyte, 2**60 bytes
2704ea
+#: src/bs_size.c:64
2704ea
+msgid "EiB"
2704ea
+msgstr ""
2704ea
+
2704ea
+#. TRANSLATORS: abbreviation for zebibyte, 2**70 bytes
2704ea
+#: src/bs_size.c:66
2704ea
+msgid "ZiB"
2704ea
+msgstr ""
2704ea
+
2704ea
+#. TRANSLATORS: abbreviation for yobibyte, 2**80 bytes
2704ea
+#: src/bs_size.c:68
2704ea
+msgid "YiB"
2704ea
+msgstr ""
2704ea
+
2704ea
+#. TRANSLATORS: abbreviation for kilobyte, 10**3 bytes
2704ea
+#: src/bs_size.c:75
2704ea
+msgid "KB"
2704ea
+msgstr ""
2704ea
+
2704ea
+#. TRANSLATORS: abbreviation for megabyte, 10**6 bytes
2704ea
+#: src/bs_size.c:77
2704ea
+msgid "MB"
2704ea
+msgstr ""
2704ea
+
2704ea
+#. TRANSLATORS: abbreviation for gigabyte, 10**9 bytes
2704ea
+#: src/bs_size.c:79
2704ea
+msgid "GB"
2704ea
+msgstr ""
2704ea
+
2704ea
+#. TRANSLATORS: abbreviation for terabyte, 10**12 bytes
2704ea
+#: src/bs_size.c:81
2704ea
+msgid "TB"
2704ea
+msgstr ""
2704ea
+
2704ea
+#. TRANSLATORS: abbreviation for petabyte, 10**15 bytes
2704ea
+#: src/bs_size.c:83
2704ea
+msgid "PB"
2704ea
+msgstr ""
2704ea
+
2704ea
+#. TRANSLATORS: abbreviation for exabyte, 10**18 bytes
2704ea
+#: src/bs_size.c:85
2704ea
+msgid "EB"
2704ea
+msgstr ""
2704ea
+
2704ea
+#. TRANSLATORS: abbreviation for zettabyte, 10**21 bytes
2704ea
+#: src/bs_size.c:87
2704ea
+msgid "ZB"
2704ea
+msgstr ""
2704ea
+
2704ea
+#. TRANSLATORS: abbreviation for yottabyte, 10**24 bytes
2704ea
+#: src/bs_size.c:89
2704ea
+msgid "YB"
2704ea
+msgstr ""
2704ea
diff --git a/tests/canary_tests.sh.in b/tests/canary_tests.sh.in
2704ea
index 13357e8..d5a5815 100644
2704ea
--- a/tests/canary_tests.sh.in
2704ea
+++ b/tests/canary_tests.sh.in
2704ea
@@ -17,15 +17,8 @@ if [ -z "$top_srcdir" ]; then
2704ea
     top_srcdir="$(dirname "$0")/.."
2704ea
 fi
2704ea
2704ea
-if [ -z "$top_builddir" ] ; then
2704ea
-    top_builddir="$(dirname "$0")/.."
2704ea
-fi
2704ea
-
2704ea
-# Make sure libbytesize.pot is up to date
2704ea
-make -C ${top_builddir}/po libbytesize.pot-update >/dev/null 2>&1
2704ea
-
2704ea
 PYTHONPATH="${PYTHONPATH}:${top_srcdir}/translation-canary"
2704ea
 export PYTHONPATH
2704ea
2704ea
 # Run the translatable tests on the POT file
2704ea
-python3 -m translation_canary.translatable "${top_builddir}/po/libbytesize.pot"
2704ea
+python3 -m translation_canary.translatable "${top_srcdir}/po/libbytesize.pot"