fix: xbps --yes for non-interactive bootstrap, sudo chroot, LD_LIBRARY_PATH injection
This commit is contained in:
@@ -8,6 +8,7 @@ from abc import ABC, abstractmethod
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
_BUNDLED = Path(__file__).resolve().parent.parent / "bin"
|
_BUNDLED = Path(__file__).resolve().parent.parent / "bin"
|
||||||
|
_LIB = Path(__file__).resolve().parent.parent / "lib"
|
||||||
|
|
||||||
|
|
||||||
class Distro(ABC):
|
class Distro(ABC):
|
||||||
@@ -48,11 +49,16 @@ class Distro(ABC):
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _run(cmd: list[str], **kw) -> subprocess.CompletedProcess:
|
def _run(cmd: list[str], **kw) -> subprocess.CompletedProcess:
|
||||||
|
import os
|
||||||
|
|
||||||
print(f" \033[90m$\033[0m \033[1m{' '.join(cmd)}\033[0m")
|
print(f" \033[90m$\033[0m \033[1m{' '.join(cmd)}\033[0m")
|
||||||
return subprocess.run(cmd, check=True, **kw)
|
env = kw.pop("env", None) or os.environ.copy()
|
||||||
|
lib_str = str(_LIB)
|
||||||
|
env["LD_LIBRARY_PATH"] = f"{lib_str}:{env.get('LD_LIBRARY_PATH', '')}"
|
||||||
|
return subprocess.run(cmd, check=True, env=env, **kw)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _run_chroot(rootfs: Path, cmd: list[str], **kw) -> subprocess.CompletedProcess:
|
def _run_chroot(rootfs: Path, cmd: list[str], **kw) -> subprocess.CompletedProcess:
|
||||||
full = ["chroot", str(rootfs), "/bin/sh", "-c", " ".join(cmd)]
|
full = ["sudo", "chroot", str(rootfs), "/bin/sh", "-c", " ".join(cmd)]
|
||||||
print(f" \033[90m$\033[0m \033[33m[chroot]\033[0m \033[1m{' '.join(cmd)}\033[0m")
|
print(f" \033[90m$\033[0m \033[33m[chroot]\033[0m \033[1m{' '.join(cmd)}\033[0m")
|
||||||
return subprocess.run(full, check=True, **kw)
|
return subprocess.run(full, check=True, **kw)
|
||||||
|
|||||||
@@ -27,7 +27,8 @@ class Void(Distro):
|
|||||||
|
|
||||||
cmd = [
|
cmd = [
|
||||||
self._tool("xbps-install"),
|
self._tool("xbps-install"),
|
||||||
"-S",
|
"-Sy",
|
||||||
|
"--yes",
|
||||||
"-r", str(rootfs),
|
"-r", str(rootfs),
|
||||||
"-R", repo,
|
"-R", repo,
|
||||||
*base_pkgs,
|
*base_pkgs,
|
||||||
|
|||||||
Symlink
+1
@@ -0,0 +1 @@
|
|||||||
|
libalpm.so.16
|
||||||
Symlink
+1
@@ -0,0 +1 @@
|
|||||||
|
libalpm.so.16.0.1
|
||||||
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
+1
@@ -0,0 +1 @@
|
|||||||
|
libsmartcols.so.1.1.0
|
||||||
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Reference in New Issue
Block a user