From 8078b7a56bd1e76b2337b2d065fc8b62e120fb8b Mon Sep 17 00:00:00 2001 From: Mirko Brombin Date: Mon, 28 Nov 2022 16:17:47 +0100 Subject: [PATCH] core: Fix abroot exec not being called properly also add support for the !noSudo bang --- debian/vanilla-first-setup.substvars | 2 ++ recipe.json | 28 +++++++++++++------------- vanilla_first_setup/utils/processor.py | 15 +++++++------- 3 files changed, 24 insertions(+), 21 deletions(-) create mode 100644 debian/vanilla-first-setup.substvars diff --git a/debian/vanilla-first-setup.substvars b/debian/vanilla-first-setup.substvars new file mode 100644 index 0000000..e6b63de --- /dev/null +++ b/debian/vanilla-first-setup.substvars @@ -0,0 +1,2 @@ +misc:Depends=dconf-gsettings-backend | gsettings-backend +misc:Pre-Depends= diff --git a/recipe.json b/recipe.json index eec3442..4c35ca0 100644 --- a/recipe.json +++ b/recipe.json @@ -3,12 +3,12 @@ "distro_name": "Vanilla OS", "distro_logo": "io.github.vanilla-os.FirstSetup", "pre_run": [ - "sudo apt update", - "sudo apt install -f" + "apt update", + "apt install -f" ], "post_run": [ - "sudo apt update", - "sudo apt install -f" + "apt update", + "apt install -f" ], "tour": { "abroot": { @@ -45,7 +45,7 @@ "if": "warp::immutability", "type": "command", "commands": [ - "sudo apt remove -y gnome-software" + "apt remove -y gnome-software" ] } ] @@ -74,8 +74,8 @@ "if": "flatpak", "type": "command", "commands": [ - "sudo apt install -y flatpak gnome-software-plugin-flatpak", - "flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo", + "apt install -y flatpak gnome-software-plugin-flatpak", + "!noSudo flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo", "gsettings set org.gnome.software packaging-format-preference '[\"flatpak\", \"snap\", \"deb\"]'" ] }, @@ -83,14 +83,14 @@ "if": "snap", "type": "command", "commands": [ - "sudo apt install -y snapd", + "apt install -y snapd", "gsettings set org.gnome.software packaging-format-preference '[\"flatpak\", \"snap\", \"deb\"]'" ] }, { "if": "appimage", "type": "command", - "commands": ["sudo apt install -y fuse2 libfuse2"] + "commands": ["apt install -y fuse2 libfuse2"] } ] }, @@ -115,7 +115,7 @@ { "if": "nvidia", "type": "command", - "commands": ["sudo _ubuntu-drivers install --recommended"] + "commands": ["_ubuntu-drivers install --recommended"] } ] }, @@ -140,7 +140,7 @@ { "if": "vm", "type": "command", - "commands": ["sudo apt install -y open-vm-tools"] + "commands": ["apt install -y open-vm-tools"] } ] }, @@ -162,7 +162,7 @@ { "if": "codecs", "type": "command", - "commands": ["sudo apt install -y ubuntu-restricted-addons ubuntu-restricted-extras"] + "commands": ["apt install -y ubuntu-restricted-addons ubuntu-restricted-extras"] } ] }, @@ -183,7 +183,7 @@ "if": "apport", "type": "command", "commands": [ - "sudo apt install -y apport", + "apt install -y apport", "systemctl enable apport.service || true" ] }, @@ -192,7 +192,7 @@ "condition": false, "type": "command", "commands": [ - "sudo apt remove -y apport", + "apt remove -y apport", "systemctl disable apport.service || true" ] } diff --git a/vanilla_first_setup/utils/processor.py b/vanilla_first_setup/utils/processor.py index 022ddf8..4fababe 100644 --- a/vanilla_first_setup/utils/processor.py +++ b/vanilla_first_setup/utils/processor.py @@ -41,14 +41,11 @@ class Processor: f.write("# This file was created by FirstSetup\n") f.write("# Do not edit this file manually\n\n") - if abroot_bin := shutil.which("abroot"): - f.write("abroot exec --assume-yes <