From b7f394a0e8460f75b10f256f46e74ddf0d0bb69d Mon Sep 17 00:00:00 2001 From: Paul M Date: Sun, 29 Oct 2023 18:35:12 -0500 Subject: [PATCH] A few tweaks and updates to allow for packages to be excluded --- README.md | 4 ++-- restore.arch.bash | 3 +++ syssetup.bash | 6 ++++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 994fc6c..4b286be 100644 --- a/README.md +++ b/README.md @@ -15,9 +15,9 @@ test.bash - Some file I was using to test something, you can ignore it To add flatpak support for making it more usable for desktops. Also at one point create a custom replacement for makeself thats specific to this script. -# Notes Oct 11 2023 +# Notes Oct 29 2023 -Well in a attempt to move my own VPS to another I teseted the script. Found a bug where apt didn't have needed permissions. Thats been fixed in the dev version. Now I need to find a way to handle packages that where installed manaully via a downloaded deb file. Aside from some form detection for manually installed packages. +I've been at it adding a few tweaks here or there. Trying to add a good system for exclusions to make things more protable. While the current version works great on say VPS running the same base image, its not so good on different ones. This is due to some packages perhaps having different names like kernel images, modules and headers. This also includes things installed from a single package file you downloaded that isn't in a repo. Technically not bugs, but I want more flexibility. # Special Thanks diff --git a/restore.arch.bash b/restore.arch.bash index 52e5546..3b6c7d4 100755 --- a/restore.arch.bash +++ b/restore.arch.bash @@ -32,6 +32,9 @@ function restore_config() { cp -R etc/pacman.d /etc cp pacman.conf /etc pacman --noconfirm -Sy + if [ -f ./exclusions ]; then + exclusions # this runs exclusions + fi pacman -S - < $aptpkgfile # we should be set app wise now the configs cp -R etc/ /etc diff --git a/syssetup.bash b/syssetup.bash index 78857af..5165097 100755 --- a/syssetup.bash +++ b/syssetup.bash @@ -1,6 +1,8 @@ #!/bin/bash -# set -x +# set -x # For debugging +set -eo pipefail # No -u that would just bother me +trap cleanup EXIT # A little more robust cleanup if [ "$(id -u)" != "0" ]; then echo "You should run this script as root" @@ -118,7 +120,7 @@ clear case $selection in 1 ) clear ; copy_config ; press_enter ;; 2 ) clear ; menu_option_two ; press_enter ;; - 0 ) clear ; cleanup ; exit ;; + 0 ) clear ; exit ;; * ) clear ; incorrect_selection ; press_enter ;; esac done