Blame SOURCES/libbytesize-potfile.patch

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