From 2e00140e8267a2840828f1d4646cd01a0ed4e4b8 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Tue, 17 Sep 2024 22:08:14 +0200 Subject: [PATCH] doc/deb --- rwx/deb/__init__.py | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/rwx/deb/__init__.py b/rwx/deb/__init__.py index fcd4198..2537321 100644 --- a/rwx/deb/__init__.py +++ b/rwx/deb/__init__.py @@ -1,5 +1,7 @@ """Wrap Debian commands.""" +from pathlib import Path + from rwx import cmd, ps cmd.need("debootstrap") @@ -8,14 +10,22 @@ BOOTSTRAP_ARCHITECTURE = "amd64" BOOTSTRAP_VARIANT = "minbase" -def bootstrap(root_path: str, suite: str, mirror_location: str) -> None: - """Boostrap a base operating filesystem.""" - command = [ - ("debootstrap",), +def bootstrap(root_path: Path, suite: str, mirror_location: str) -> None: + """Boostrap a base operating filesystem. + + :param root_path: target output path + :type root_path: Path + :param suite: target distribution name + :type suite: str + :param mirror_location: source input repository + :type mirror_location: str + """ + command = ( + "debootstrap", ("--arch", BOOTSTRAP_ARCHITECTURE), ("--variant", BOOTSTRAP_VARIANT), - (suite,), - (root_path,), - (mirror_location,), - ] + suite, + str(root_path), + mirror_location, + ) ps.run(*command)