fix: syntax errors in all backends, wrong import path, entry point

- fix f-string escape bug in all 5 backends (user password handling)
- fix void.py import: from ..dinit (not .dinit — dinit.py is at package root)
- fix pyproject.toml entry point: cli:cli not cli:main
- add .gitignore for __pycache__
This commit is contained in:
2026-08-26 20:39:42 +02:00
parent e0c78f476d
commit 5c65baeb27
7 changed files with 17 additions and 7 deletions
+5
View File
@@ -0,0 +1,5 @@
__pycache__/
*.pyc
*.egg-info/
dist/
build/
+2 -1
View File
@@ -47,7 +47,8 @@ class Alpine(Distro):
shell = user.get("shell", "/bin/bash") shell = user.get("shell", "/bin/bash")
self._run_chroot(rootfs, ["adduser", "-D", "-s", shell, name]) self._run_chroot(rootfs, ["adduser", "-D", "-s", shell, name])
if "password" in user: if "password" in user:
self._run_chroot(rootfs, ["bash", "-c", f"echo '{name}:{user[\"password\"]}' | chpasswd"]) pw = user["password"]
self._run_chroot(rootfs, ["bash", "-c", f"echo '{name}:{pw}' | chpasswd"])
for group in user.get("groups", []): for group in user.get("groups", []):
self._run_chroot(rootfs, ["adduser", name, group]) self._run_chroot(rootfs, ["adduser", name, group])
+2 -1
View File
@@ -50,7 +50,8 @@ class Arch(Distro):
shell = user.get("shell", "/bin/bash") shell = user.get("shell", "/bin/bash")
self._run_chroot(rootfs, ["useradd", "-m", "-s", shell, name]) self._run_chroot(rootfs, ["useradd", "-m", "-s", shell, name])
if "password" in user: if "password" in user:
self._run_chroot(rootfs, ["bash", "-c", f"echo '{name}:{user[\"password\"]}' | chpasswd"]) pw = user["password"]
self._run_chroot(rootfs, ["bash", "-c", f"echo '{name}:{pw}' | chpasswd"])
for group in user.get("groups", []): for group in user.get("groups", []):
self._run_chroot(rootfs, ["usermod", "-aG", group, name]) self._run_chroot(rootfs, ["usermod", "-aG", group, name])
+2 -1
View File
@@ -53,7 +53,8 @@ class Debian(Distro):
shell = user.get("shell", "/bin/bash") shell = user.get("shell", "/bin/bash")
self._run_chroot(rootfs, ["useradd", "-m", "-s", shell, name]) self._run_chroot(rootfs, ["useradd", "-m", "-s", shell, name])
if "password" in user: if "password" in user:
self._run_chroot(rootfs, ["bash", "-c", f"echo '{name}:{user[\"password\"]}' | chpasswd"]) pw = user["password"]
self._run_chroot(rootfs, ["bash", "-c", f"echo '{name}:{pw}' | chpasswd"])
for group in user.get("groups", []): for group in user.get("groups", []):
self._run_chroot(rootfs, ["usermod", "-aG", group, name]) self._run_chroot(rootfs, ["usermod", "-aG", group, name])
+2 -1
View File
@@ -49,7 +49,8 @@ class Fedora(Distro):
shell = user.get("shell", "/bin/bash") shell = user.get("shell", "/bin/bash")
self._run_chroot(rootfs, ["useradd", "-m", "-s", shell, name]) self._run_chroot(rootfs, ["useradd", "-m", "-s", shell, name])
if "password" in user: if "password" in user:
self._run_chroot(rootfs, ["bash", "-c", f"echo '{name}:{user[\"password\"]}' | chpasswd"]) pw = user["password"]
self._run_chroot(rootfs, ["bash", "-c", f"echo '{name}:{pw}' | chpasswd"])
for group in user.get("groups", []): for group in user.get("groups", []):
self._run_chroot(rootfs, ["usermod", "-aG", group, name]) self._run_chroot(rootfs, ["usermod", "-aG", group, name])
+3 -2
View File
@@ -3,7 +3,7 @@
from pathlib import Path from pathlib import Path
from .base import Distro from .base import Distro
from .dinit import install_all from ..dinit import install_all
class Void(Distro): class Void(Distro):
@@ -53,7 +53,8 @@ class Void(Distro):
shell = user.get("shell", "/bin/bash") shell = user.get("shell", "/bin/bash")
self._run_chroot(rootfs, ["useradd", "-m", "-s", shell, name]) self._run_chroot(rootfs, ["useradd", "-m", "-s", shell, name])
if "password" in user: if "password" in user:
self._run_chroot(rootfs, ["bash", "-c", f"echo '{name}:{user[\"password\"]}' | chpasswd"]) pw = user["password"]
self._run_chroot(rootfs, ["bash", "-c", f"echo '{name}:{pw}' | chpasswd"])
for group in user.get("groups", []): for group in user.get("groups", []):
self._run_chroot(rootfs, ["usermod", "-aG", group, name]) self._run_chroot(rootfs, ["usermod", "-aG", group, name])
+1 -1
View File
@@ -10,7 +10,7 @@ requires-python = ">=3.10"
dependencies = ["pyyaml>=6", "click>=8"] dependencies = ["pyyaml>=6", "click>=8"]
[project.scripts] [project.scripts]
euri-mklive = "euri_mklive.cli:main" euri-mklive = "euri_mklive.cli:cli"
[tool.setuptools.packages.find] [tool.setuptools.packages.find]
include = ["euri_mklive*"] include = ["euri_mklive*"]