summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWojtek Kosior <koszko@koszko.org>2022-05-10 16:47:47 +0200
committerWojtek Kosior <koszko@koszko.org>2022-05-10 16:48:26 +0200
commitbd588eb9a4b2890da6f9db928f302e2e98a7b9ce (patch)
tree76ad822f028c847190a0a14a07c8a3b1bcc554d6 /src
parent61f0aa75c64732063988826400ebc9f8e01ee3bb (diff)
downloadhydrilla-builder-bd588eb9a4b2890da6f9db928f302e2e98a7b9ce.tar.gz
hydrilla-builder-bd588eb9a4b2890da6f9db928f302e2e98a7b9ce.zip
add missing english translations and verify message texts of raised exceptions in tests
Diffstat (limited to 'src')
-rw-r--r--src/hydrilla/builder/build.py5
-rw-r--r--src/hydrilla/builder/local_apt.py14
-rw-r--r--src/hydrilla/builder/locales/en_US/LC_MESSAGES/hydrilla-messages.po90
3 files changed, 80 insertions, 29 deletions
diff --git a/src/hydrilla/builder/build.py b/src/hydrilla/builder/build.py
index ce4935c..feecdfe 100644
--- a/src/hydrilla/builder/build.py
+++ b/src/hydrilla/builder/build.py
@@ -83,10 +83,11 @@ def generate_spdx_report(root: Path) -> bytes:
try:
cp = subprocess.run(command, capture_output=True, text=True)
except FileNotFoundError:
- raise ReuseError(_('couldnt_execute_reuse_is_it_installed'))
+ msg = _('couldnt_execute_{}_is_it_installed').format('reuse')
+ raise ReuseError(msg)
if cp.returncode != 0:
- msg = _('reuse_command_{}_failed').format(' '.join(command))
+ msg = _('command_{}_failed').format(' '.join(command))
raise ReuseError(msg, cp)
return cp.stdout.encode()
diff --git a/src/hydrilla/builder/local_apt.py b/src/hydrilla/builder/local_apt.py
index 8382af8..4c93a4d 100644
--- a/src/hydrilla/builder/local_apt.py
+++ b/src/hydrilla/builder/local_apt.py
@@ -114,10 +114,11 @@ class Apt:
try:
cp = run(command, **kwargs)
except FileNotFoundError:
- raise AptError(_('couldnt_execute_apt_get_is_it_installed'))
+ msg = _('couldnt_execute_{}_is_it_installed').format('apt-get')
+ raise AptError(msg)
if cp.returncode != 0:
- msg = _('apt_get_command_{}_failed').format(' '.join(command))
+ msg = _('command_{}_failed').format(' '.join(command))
raise AptError(msg, cp)
return cp
@@ -185,7 +186,7 @@ def apt_keyring(keys: [str]) -> bytes:
try:
from gnupg import GPG
except ModuleNotFoundError:
- raise GpgError(_('couldnt_import_gnupg_is_it_installed'))
+ raise GpgError(_('couldnt_import_{}_is_it_installed').format('gnupg'))
gpg = GPG(keyring=str(cache_dir() / 'master_keyring.gpg'))
for key in keys:
@@ -193,7 +194,7 @@ def apt_keyring(keys: [str]) -> bytes:
continue
if gpg.recv_keys(default_keyserver, key).imported == 0:
- raise GpgError(_('gpg_couldnt_recv_key'))
+ raise GpgError(_('gpg_couldnt_recv_key_{}').format(key))
return gpg.export_keys(keys, armor=False, minimal=True)
@@ -404,10 +405,11 @@ def piggybacked_system(piggyback_def: dict, foreign_packages: Optional[Path]) \
try:
cp = run(command)
except FileNotFoundError:
- raise AptError(_('couldnt_execute_dpkg_deb_is_it_installed'))
+ msg = _('couldnt_execute_{}_is_it_installed'.format('dpkg-deb'))
+ raise AptError(msg)
if cp.returncode != 0:
- msg = _('dpkg_deb_command_{}_failed').format(' '.join(command))
+ msg = _('command_{}_failed').format(' '.join(command))
raise AptError(msg, cp)
docs_dir = root / 'usr' / 'share' / 'doc'
diff --git a/src/hydrilla/builder/locales/en_US/LC_MESSAGES/hydrilla-messages.po b/src/hydrilla/builder/locales/en_US/LC_MESSAGES/hydrilla-messages.po
index e3ab525..a6c6e83 100644
--- a/src/hydrilla/builder/locales/en_US/LC_MESSAGES/hydrilla-messages.po
+++ b/src/hydrilla/builder/locales/en_US/LC_MESSAGES/hydrilla-messages.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: hydrilla.builder 0.1.dev16+g4e46d7f.d20220211\n"
"Report-Msgid-Bugs-To: koszko@koszko.org\n"
-"POT-Creation-Date: 2022-04-19 13:51+0200\n"
+"POT-Creation-Date: 2022-05-10 16:47+0200\n"
"PO-Revision-Date: 2022-02-12 00:00+0000\n"
"Last-Translator: Wojtek Kosior <koszko@koszko.org>\n"
"Language: en_US\n"
@@ -18,45 +18,63 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.8.0\n"
-#: src/hydrilla/builder/build.py:118
-msgid "couldnt_import_reuse_is_it_installed"
-msgstr ""
-"Could not import 'reuse'. Is the tool installed and visible to this "
-"Python instance?"
+#: src/hydrilla/builder/build.py:86 src/hydrilla/builder/local_apt.py:117
+#: src/hydrilla/builder/local_apt.py:408
+msgid "couldnt_execute_{}_is_it_installed"
+msgstr "Could not execute '{}'. Is the tool installed and reachable via PATH?"
+
+#: src/hydrilla/builder/build.py:90 src/hydrilla/builder/local_apt.py:121
+#: src/hydrilla/builder/local_apt.py:412
+msgid "command_{}_failed"
+msgstr "The following command finished execution with a non-zero exit status: {}"
-#: src/hydrilla/builder/build.py:123
-msgid "spdx_report_from_reuse_incompliant"
-msgstr "Attempt to generate an SPDX report for a REUSE-incompliant package."
+#: src/hydrilla/builder/build.py:198
+msgid "path_contains_double_dot_{}"
+msgstr ""
+"Attempt to load '{}' which includes a forbidden parent reference ('..') "
+"in the path."
-#: src/hydrilla/builder/build.py:207
+#: src/hydrilla/builder/build.py:205
msgid "loading_{}_outside_package_dir"
msgstr "Attempt to load '{}' which lies outside package source directory."
-#: src/hydrilla/builder/build.py:211
+#: src/hydrilla/builder/build.py:209
msgid "loading_reserved_index_json"
msgstr "Attempt to load 'index.json' which is a reserved filename."
-#: src/hydrilla/builder/build.py:329
+#: src/hydrilla/builder/build.py:350
msgid "report_spdx_not_in_copyright_list"
msgstr ""
"Told to generate 'report.spdx' but 'report.spdx' is not listed among "
"copyright files. Refusing to proceed."
-#: src/hydrilla/builder/build.py:402
+#: src/hydrilla/builder/build.py:421
+msgid "build_package_from_srcdir_to_dstdir"
+msgstr ""
+"Build Hydrilla package from `scrdir` and write the resulting files under "
+"`dstdir`."
+
+#: src/hydrilla/builder/build.py:423
msgid "source_directory_to_build_from"
msgstr "Source directory to build from."
-#: src/hydrilla/builder/build.py:404
+#: src/hydrilla/builder/build.py:425
msgid "path_instead_of_index_json"
msgstr ""
"Path to file to be processed instead of index.json (if not absolute, "
"resolved relative to srcdir)."
-#: src/hydrilla/builder/build.py:406
+#: src/hydrilla/builder/build.py:427
+msgid "path_instead_for_piggyback_files"
+msgstr ""
+"Path to a non-standard directory with foreign packages' archive files to "
+"use."
+
+#: src/hydrilla/builder/build.py:429
msgid "built_package_files_destination"
msgstr "Destination directory to write built package files to."
-#: src/hydrilla/builder/build.py:408
+#: src/hydrilla/builder/build.py:431
#, python-format
msgid "%(prog)s_%(version)s_license"
msgstr ""
@@ -67,15 +85,45 @@ msgstr ""
"This is free software: you are free to change and redistribute it.\n"
"There is NO WARRANTY, to the extent permitted by law."
-#: src/hydrilla/builder/build.py:409
+#: src/hydrilla/builder/build.py:432
msgid "version_printing"
msgstr "Print version information and exit."
-#: src/hydrilla/builder/build.py:415
-msgid "build_package_from_srcdir_to_dstdir"
+#: src/hydrilla/builder/common_errors.py:62
+msgid "STDOUT_OUTPUT_heading"
+msgstr "## Command's standard output ##"
+
+#: src/hydrilla/builder/common_errors.py:65
+msgid "STDERR_OUTPUT_heading"
+msgstr "## Command's standard error output ##"
+
+#: src/hydrilla/builder/local_apt.py:146
+msgid "distro_{}_unknown"
+msgstr "Attempt to use an unknown software distribution '{}'."
+
+#: src/hydrilla/builder/local_apt.py:189
+msgid "couldnt_import_{}_is_it_installed"
msgstr ""
-"Build Hydrilla package from `scrdir` and write the resulting files under "
-"`dstdir`."
+"Could not import '{}'. Is the module installed and visible to this Python"
+" instance?"
+
+#: src/hydrilla/builder/local_apt.py:197
+msgid "gpg_couldnt_recv_key_{}"
+msgstr "Could not import PGP key '{}'."
+
+#: src/hydrilla/builder/local_apt.py:314
+msgid "apt_install_output_not_understood"
+msgstr "The output of an 'apt-get install' command was not understood."
+
+#: src/hydrilla/builder/local_apt.py:342
+msgid "apt_download_gave_bad_filename_{}"
+msgstr "The 'apt-get download' command produced a file with unexpected name '{}'."
+
+#: src/hydrilla/builder/piggybacking.py:102
+msgid "loading_{}_outside_piggybacked_dir"
+msgstr ""
+"Attempt to load '{}' which lies outside piggybacked packages files root "
+"directory."
#: src/hydrilla/util/_util.py:79
msgid "bad_comment"