From 1210a3828a7abe25c9191423c5480f71cf2b9dc6 Mon Sep 17 00:00:00 2001 From: Dennis ten Hoove Date: Sun, 9 Jun 2024 21:46:20 +0200 Subject: [PATCH] Equalize test configs with stable --- .../bin => post_bootstrap/usr/arkdep_bin}/pacman | 13 ++++++------- .../usr/bin/arkane-readonly | 0 .../bin => post_bootstrap/usr/arkdep_bin}/pacman | 13 ++++++------- .../usr/bin/arkane-readonly | 0 4 files changed, 12 insertions(+), 14 deletions(-) rename arkdep-build.d/test-arkanelinux-kde/overlay/{post_install/usr/local/bin => post_bootstrap/usr/arkdep_bin}/pacman (71%) rename arkdep-build.d/test-arkanelinux-kde/overlay/{post_install => post_bootstrap}/usr/bin/arkane-readonly (100%) rename arkdep-build.d/test-arkanelinux-pantheon/overlay/{post_install/usr/local/bin => post_bootstrap/usr/arkdep_bin}/pacman (71%) rename arkdep-build.d/test-arkanelinux-pantheon/overlay/{post_install => post_bootstrap}/usr/bin/arkane-readonly (100%) diff --git a/arkdep-build.d/test-arkanelinux-kde/overlay/post_install/usr/local/bin/pacman b/arkdep-build.d/test-arkanelinux-kde/overlay/post_bootstrap/usr/arkdep_bin/pacman similarity index 71% rename from arkdep-build.d/test-arkanelinux-kde/overlay/post_install/usr/local/bin/pacman rename to arkdep-build.d/test-arkanelinux-kde/overlay/post_bootstrap/usr/arkdep_bin/pacman index 890f48d..ad60783 100755 --- a/arkdep-build.d/test-arkanelinux-kde/overlay/post_install/usr/local/bin/pacman +++ b/arkdep-build.d/test-arkanelinux-kde/overlay/post_bootstrap/usr/arkdep_bin/pacman @@ -1,12 +1,12 @@ #!/usr/bin/env bash -if [[ ! $EUID -eq 0 ]]; then - printf 'You have to be root to perform this action.\n' - exit 1 -fi +# Elevate permissions to root +[[ $EUID -eq 0 ]] || exec sudo bash $0 $@ -# If -r is defined do not check, we may be running pacstrap -if [[ ! $@ =~ (-r|--root) ]]; then +[[ $@ =~ (-r|--root) ]] && no_check=1 # Do not check if custom root is defined +[[ $LD_LIBRARY_PATH =~ (libfakeroot) ]] && no_check=1 # Do not check if running as fakeroot + +if [[ ! $no_check ]]; then # Check if the disk is ro'ed using subvolume properties if btrfs property get / 2> /dev/null | grep -q 'ro=true'; then cat <<- END @@ -28,4 +28,3 @@ fi # No exit statement here, we return pacman's exit code /usr/bin/pacman $@ - diff --git a/arkdep-build.d/test-arkanelinux-kde/overlay/post_install/usr/bin/arkane-readonly b/arkdep-build.d/test-arkanelinux-kde/overlay/post_bootstrap/usr/bin/arkane-readonly similarity index 100% rename from arkdep-build.d/test-arkanelinux-kde/overlay/post_install/usr/bin/arkane-readonly rename to arkdep-build.d/test-arkanelinux-kde/overlay/post_bootstrap/usr/bin/arkane-readonly diff --git a/arkdep-build.d/test-arkanelinux-pantheon/overlay/post_install/usr/local/bin/pacman b/arkdep-build.d/test-arkanelinux-pantheon/overlay/post_bootstrap/usr/arkdep_bin/pacman similarity index 71% rename from arkdep-build.d/test-arkanelinux-pantheon/overlay/post_install/usr/local/bin/pacman rename to arkdep-build.d/test-arkanelinux-pantheon/overlay/post_bootstrap/usr/arkdep_bin/pacman index 890f48d..ad60783 100755 --- a/arkdep-build.d/test-arkanelinux-pantheon/overlay/post_install/usr/local/bin/pacman +++ b/arkdep-build.d/test-arkanelinux-pantheon/overlay/post_bootstrap/usr/arkdep_bin/pacman @@ -1,12 +1,12 @@ #!/usr/bin/env bash -if [[ ! $EUID -eq 0 ]]; then - printf 'You have to be root to perform this action.\n' - exit 1 -fi +# Elevate permissions to root +[[ $EUID -eq 0 ]] || exec sudo bash $0 $@ -# If -r is defined do not check, we may be running pacstrap -if [[ ! $@ =~ (-r|--root) ]]; then +[[ $@ =~ (-r|--root) ]] && no_check=1 # Do not check if custom root is defined +[[ $LD_LIBRARY_PATH =~ (libfakeroot) ]] && no_check=1 # Do not check if running as fakeroot + +if [[ ! $no_check ]]; then # Check if the disk is ro'ed using subvolume properties if btrfs property get / 2> /dev/null | grep -q 'ro=true'; then cat <<- END @@ -28,4 +28,3 @@ fi # No exit statement here, we return pacman's exit code /usr/bin/pacman $@ - diff --git a/arkdep-build.d/test-arkanelinux-pantheon/overlay/post_install/usr/bin/arkane-readonly b/arkdep-build.d/test-arkanelinux-pantheon/overlay/post_bootstrap/usr/bin/arkane-readonly similarity index 100% rename from arkdep-build.d/test-arkanelinux-pantheon/overlay/post_install/usr/bin/arkane-readonly rename to arkdep-build.d/test-arkanelinux-pantheon/overlay/post_bootstrap/usr/bin/arkane-readonly