Skip to content

Commit

Permalink
feat(args, alpm): implement support for pacman's --dbpath and --root …
Browse files Browse the repository at this point in the history
…flags
  • Loading branch information
actionless committed Sep 2, 2024
1 parent a89ebf9 commit 4b2d6ab
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
3 changes: 3 additions & 0 deletions maintenance_scripts/mypy_stubs/pycman/config.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@ from collections import OrderedDict
from pyalpm import Handle
from typing_extensions import TypedDict


class PacmanOptions(TypedDict):
IgnorePkg: list[str]
RootDir: str
DBPath: str


class PacmanConfig:
Expand Down
7 changes: 6 additions & 1 deletion pikaur/alpm.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,12 @@
class PacmanConfig(PycmanConfig):

def __init__(self) -> None:
super().__init__(conf=parse_args().config or "/etc/pacman.conf")
args = parse_args()
super().__init__(conf=args.config or "/etc/pacman.conf")
if args.root:
self.options["RootDir"] = args.root
if args.dbpath:
self.options["DBPath"] = args.dbpath


class PyAlpmWrapper:
Expand Down
5 changes: 4 additions & 1 deletion pikaur/args.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ def get_pacman_str_opts(action: str | None = None) -> ArgSchema:
return list(set(result))
return [
(None, "color", None, None),
("b", "dbpath", None, None), # @TODO: pyalpm?
("b", "dbpath", None, None),
("r", "root", None, None),
(None, "arch", None, None), # @TODO
(None, "cachedir", None, None), # @TODO
Expand Down Expand Up @@ -468,6 +468,9 @@ class PikaurArgs(Namespace):
config: str | None
refresh: int
clean: int
dbpath: str | None
root: str | None

aur_clone_concurrency: int | None
skip_aur_pull: bool | None
positional: list[str]
Expand Down

0 comments on commit 4b2d6ab

Please sign in to comment.