From 5c65baeb27f07daede1f4f3ca8fb3fb6b95bcaa8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82?= Date: Wed, 26 Aug 2026 20:39:42 +0200 Subject: [PATCH] fix: syntax errors in all backends, wrong import path, entry point MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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__ --- .gitignore | 5 +++++ euri_mklive/distros/alpine.py | 3 ++- euri_mklive/distros/arch.py | 3 ++- euri_mklive/distros/debian.py | 3 ++- euri_mklive/distros/fedora.py | 3 ++- euri_mklive/distros/void.py | 5 +++-- pyproject.toml | 2 +- 7 files changed, 17 insertions(+), 7 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1b5ea51 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +__pycache__/ +*.pyc +*.egg-info/ +dist/ +build/ diff --git a/euri_mklive/distros/alpine.py b/euri_mklive/distros/alpine.py index 8ef7c1a..577f675 100644 --- a/euri_mklive/distros/alpine.py +++ b/euri_mklive/distros/alpine.py @@ -47,7 +47,8 @@ class Alpine(Distro): shell = user.get("shell", "/bin/bash") self._run_chroot(rootfs, ["adduser", "-D", "-s", shell, name]) 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", []): self._run_chroot(rootfs, ["adduser", name, group]) diff --git a/euri_mklive/distros/arch.py b/euri_mklive/distros/arch.py index d0df1ca..28c1d21 100644 --- a/euri_mklive/distros/arch.py +++ b/euri_mklive/distros/arch.py @@ -50,7 +50,8 @@ class Arch(Distro): shell = user.get("shell", "/bin/bash") self._run_chroot(rootfs, ["useradd", "-m", "-s", shell, name]) 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", []): self._run_chroot(rootfs, ["usermod", "-aG", group, name]) diff --git a/euri_mklive/distros/debian.py b/euri_mklive/distros/debian.py index e0a00e0..ab3bd8d 100644 --- a/euri_mklive/distros/debian.py +++ b/euri_mklive/distros/debian.py @@ -53,7 +53,8 @@ class Debian(Distro): shell = user.get("shell", "/bin/bash") self._run_chroot(rootfs, ["useradd", "-m", "-s", shell, name]) 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", []): self._run_chroot(rootfs, ["usermod", "-aG", group, name]) diff --git a/euri_mklive/distros/fedora.py b/euri_mklive/distros/fedora.py index 4f395c5..98cde34 100644 --- a/euri_mklive/distros/fedora.py +++ b/euri_mklive/distros/fedora.py @@ -49,7 +49,8 @@ class Fedora(Distro): shell = user.get("shell", "/bin/bash") self._run_chroot(rootfs, ["useradd", "-m", "-s", shell, name]) 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", []): self._run_chroot(rootfs, ["usermod", "-aG", group, name]) diff --git a/euri_mklive/distros/void.py b/euri_mklive/distros/void.py index 16e2c29..0a258c5 100644 --- a/euri_mklive/distros/void.py +++ b/euri_mklive/distros/void.py @@ -3,7 +3,7 @@ from pathlib import Path from .base import Distro -from .dinit import install_all +from ..dinit import install_all class Void(Distro): @@ -53,7 +53,8 @@ class Void(Distro): shell = user.get("shell", "/bin/bash") self._run_chroot(rootfs, ["useradd", "-m", "-s", shell, name]) 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", []): self._run_chroot(rootfs, ["usermod", "-aG", group, name]) diff --git a/pyproject.toml b/pyproject.toml index 476a1de..59ae6c9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -10,7 +10,7 @@ requires-python = ">=3.10" dependencies = ["pyyaml>=6", "click>=8"] [project.scripts] -euri-mklive = "euri_mklive.cli:main" +euri-mklive = "euri_mklive.cli:cli" [tool.setuptools.packages.find] include = ["euri_mklive*"]