[arkdep] Code cleanup

This commit is contained in:
Dennis ten Hoove 2025-01-19 00:25:28 +01:00
parent ff138b607c
commit 5c82a4ffb6
No known key found for this signature in database
GPG key ID: 2BA91DC2563B83D1

12
arkdep
View file

@ -582,8 +582,8 @@ remove_deployment () {
# Ensure the deployment and all sub-volumes are writable
for volume in $(btrfs subvolume list / | grep -oE '[^ ]+$' | grep $target); do
btrfs property set -f -ts $(readlink -m $ARKDEP_ROOT/$volume) ro false \
|| printf "\e[1;33m<!>\e[0m\e[1m Failed to make subvolume $volume writable\e[0m\n"
btrfs property set -f -ts $(readlink -m $ARKDEP_ROOT/$volume) ro false ||
printf "\e[1;33m<!>\e[0m\e[1m Failed to make subvolume $volume writable\e[0m\n"
done
# Remove the deployment
@ -602,8 +602,8 @@ remove_deployment () {
cleanup_and_quit 'Failed to update tracker file'
fi
mv $arkdep_dir/tracker_tmp $arkdep_dir/tracker \
|| cleanup_and_quit 'Failed to move tracker_tmp file to tracker'
mv $arkdep_dir/tracker_tmp $arkdep_dir/tracker ||
cleanup_and_quit 'Failed to move tracker_tmp file to tracker'
# Remove images from cache if requested
if [[ $clean_cache_on_remove -eq 1 ]]; then
@ -1313,9 +1313,9 @@ layer () {
# Notify user of changes and ask for permission if interactive_mode is enabled
printf '\e[1;34m-->\e[0m\e[1m The following packages will be layered\e[0m\n'
printf "${progs_clean[@]}" | column
echo "${progs_clean[@]}" | column
if [[ $interactive_mode -eq 1 ]]; then
read -p 'Proceed with removal? [Y/n] ' remove_confirm
read -p 'Proceed with installation? [Y/n] ' remove_confirm
if [[ ! $remove_confirm =~ ^(y|Y|yes|YES|)$ ]]; then
unlock_and_quit 1