aboutsummaryrefslogtreecommitdiff
path: root/src/hydrilla/builder/local_apt.py
diff options
context:
space:
mode:
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'