Skip to content

Commit

Permalink
fix(build, getpkgbuild, installinfofetcher): make certain string tran…
Browse files Browse the repository at this point in the history
…slateable
  • Loading branch information
actionless committed Jan 17, 2025
1 parent 6c03e43 commit e17e045
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
12 changes: 10 additions & 2 deletions pikaur/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,11 @@ def isolated_mkdir(to_path: Path) -> None:
if mkdir_result.returncode != 0:
print_stdout(mkdir_result.stdout_text)
print_stderr(mkdir_result.stderr_text)
raise RuntimeError(translate(f"Can't create destination directory '{to_path}'."))
raise RuntimeError(
translate("Can't create destination directory '{to_path}'.").format(
to_path=to_path,
),
)


def copy_aur_repo(from_path: Path, to_path: Path) -> None:
Expand All @@ -124,7 +128,11 @@ def copy_aur_repo(from_path: Path, to_path: Path) -> None:
isolated_mkdir(to_path)
result = interactive_spawn(cmd_args)
if result.returncode != 0:
raise RuntimeError(translate(f"Can't copy '{from_path}' to '{to_path}'."))
raise RuntimeError(
translate("Can't copy '{from_path}' to '{to_path}'.").format(
from_path=from_path, to_path=to_path,
),
)


class PackageBuild(ComparableType):
Expand Down
6 changes: 5 additions & 1 deletion pikaur/getpkgbuild_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,11 @@ def clone_repo_pkgs(repo_pkgs: list["pyalpm.Package"], pwd: Path) -> None:
name = repo_pkg.base
repo_path = pwd / name
print_stdout()
print_stdout(translate(f"Package '{name}' going to be cloned into '{repo_path}'..."))
print_stdout(
translate("Package '{name}' going to be cloned into '{repo_path}'...").format(
name=name, repo_path=repo_path,
),
)
if repo_path.exists():
interactive_spawn([
"git",
Expand Down
6 changes: 5 additions & 1 deletion pikaur/install_info_fetcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,11 @@ def get_info_from_pkgbuilds(self) -> None:
aur_pkg = AURPackageInfo.from_srcinfo(srcinfo)
logger.debug(" 2 {} {} {}", pkg_name, aur_pkg, aur_pkg.packagebase)
if pkg_name in aur_updates_install_info_by_name:
raise RuntimeError(translate(f"{pkg_name} already added to the list"))
raise RuntimeError(
translate("{pkg_name} already added to the list").format(
pkg_name=pkg_name,
),
)
local_pkg = local_pkgs.get(pkg_name)
info = AURInstallInfo(
# @TODO: use data from srcinfo here?
Expand Down

0 comments on commit e17e045

Please sign in to comment.