Skip to content

Commit c60004f

Browse files
committed
Veuillez saisir le message de validation pour vos modifications. Les lignes
commençant par '' seront ignorées, et un message vide abandonne la validation. Sur la branche less-deps-feature-win-tweaks Votre branche est à jour avec 'origin/less-deps-feature-win-tweaks'. Modifications qui seront validées : modifié : scripts/build-appimage.sh modifié : src/lufus/drives/formatting.py
1 parent 9f94364 commit c60004f

2 files changed

Lines changed: 24 additions & 16 deletions

File tree

scripts/build-appimage.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,14 @@ ls -la
55

66
# Install system dependencies
77
echo "------------ Installing system libraries ------------"
8+
export DEBIAN_FRONTEND=noninteractive
89
INSTALLER="apt-get install -y"
10+
911
if [[ -f requirements-system.txt ]]; then
12+
echo "Updating apt package index..."
13+
apt-get update >> appimage-setup.log
14+
15+
echo "Installing system libraries from requirements-system.txt..."
1016
$INSTALLER $(cat requirements-system.txt) >> appimage-setup.log
1117
echo "System libraries installed."
1218
else

src/lufus/drives/formatting.py

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -360,22 +360,24 @@ def _apply_partition_scheme(drive: str) -> None:
360360
scheme = state.partition_scheme # 0 = GPT, 1 = MBR
361361

362362
scheme_name = "GPT" if scheme == 0 else "MBR"
363-
log.info("Applying %s partition scheme to %s...", scheme_name, raw_device)
364-
try:
365-
if scheme == 0:
366-
# GPT — used for UEFI targets
367-
subprocess.run([_find_tool("parted"), "-s", raw_device, "mklabel", "gpt"], check=True)
368-
subprocess.run(
369-
[_find_tool("parted"), "-s", raw_device, "mkpart", "primary", "1MiB", "100%"],
370-
check=True,
371-
)
372-
else:
373-
# MBR — used for BIOS/legacy targets
374-
subprocess.run([_find_tool("parted"), "-s", raw_device, "mklabel", "msdos"], check=True)
375-
subprocess.run(
376-
[_find_tool("parted"), "-s", raw_device, "mkpart", "primary", "1MiB", "100%"],
377-
check=True,
378-
)
363+
import shlex
364+
import subprocess
365+
...
366+
subprocess.run([_find_tool("parted"), "-s", raw_device, "mklabel", "gpt"], check=True)
367+
# Safe because subprocess.run accepts a list of arguments, avoiding shell injection.
368+
subprocess.run(
369+
[_find_tool("parted"), "-s", raw_device, "mkpart", "primary", "1MiB", "100%"],
370+
check=True,
371+
)
372+
else:
373+
# MBR — used for BIOS/legacy targets
374+
subprocess.run([_find_tool("parted"), "-s", raw_device, "mklabel", "msdos"], check=True)
375+
# Safe because subprocess.run accepts a list of arguments, avoiding shell injection.
376+
subprocess.run(
377+
[_find_tool("parted"), "-s", raw_device, "mkpart", "primary", "1MiB", "100%"],
378+
check=True,
379+
)
380+
379381
log.info("Partition scheme %s applied to %s.", scheme_name, raw_device)
380382
except FileNotFoundError:
381383
log.error("'parted' not found. Install parted.")

0 commit comments

Comments
 (0)