aboutsummaryrefslogtreecommitdiff
path: root/src/hydrilla/builder/local_apt.py
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/hydrilla/builder/local_apt.py
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/hydrilla/builder/local_apt.py')
-rw-r--r--src/hydrilla/builder/local_apt.py14
1 files changed, 8 insertions, 6 deletions
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'