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:
@@ -0,0 +1,5 @@
|
|||||||
|
__pycache__/
|
||||||
|
*.pyc
|
||||||
|
*.egg-info/
|
||||||
|
dist/
|
||||||
|
build/
|
||||||
@@ -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])
|
||||||
|
|
||||||
|
|||||||
@@ -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])
|
||||||
|
|
||||||
|
|||||||
@@ -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])
|
||||||
|
|
||||||
|
|||||||
@@ -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,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
@@ -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*"]
|
||||||
|
|||||||
Reference in New Issue
Block a user