Compare commits
No commits in common. "c8b83741751fbbf7d3cc73801076940a649b2131" and "45e299cc90c4bf23fd4041dd9e669dd79a2d14e8" have entirely different histories.
c8b8374175
...
45e299cc90
6 changed files with 6 additions and 45 deletions
|
@ -1,6 +1,3 @@
|
|||
0.4.1 2024-07-14: Fixes "Cancel" option not exiting on package resolution
|
||||
Fixes whitespace preventing package list matches on "remove all"
|
||||
0.4.0 2024-07-14: "Add/remove all from configuration" resolution strategy
|
||||
0.3.1 2024-07-13: Refactor, new docs page, make cache refresh lazier
|
||||
0.3.0 2024-07-11: "Enter packages to install/uninstall" resolution strategy
|
||||
0.2.1 2024-07-10: Rename package_resolution.sh, document package conflicts
|
||||
|
|
|
@ -5,6 +5,5 @@
|
|||
|
||||
. "$TORI_ROOT/src/package/package_manager.sh"
|
||||
. "$TORI_ROOT/src/package/package_conflict_resolution.sh"
|
||||
. "$TORI_ROOT/src/package/package_tracking.sh"
|
||||
. "$TORI_ROOT/src/package/validate_input_packages.sh"
|
||||
. "$TORI_ROOT/src/package/update_package_cache.sh"
|
||||
|
|
|
@ -38,7 +38,6 @@ not_on_configuration_dialog() {
|
|||
|
||||
if [ "$strategy" = 6 ]; then
|
||||
log debug "[resolve_packages] User choice: Cancel or empty"
|
||||
return 0
|
||||
elif [ "$strategy" = 1 ]; then
|
||||
package_manager uninstall "$conflicted_packages"
|
||||
elif [ "$strategy" = 2 ]; then
|
||||
|
@ -46,23 +45,13 @@ not_on_configuration_dialog() {
|
|||
log debug "Input: input_packages = $input_packages"
|
||||
if validate_input_packages "$input_packages"; then
|
||||
package_manager uninstall "$input_packages"
|
||||
fi
|
||||
elif [ "$strategy" = 3 ]; then
|
||||
if validate_input_packages "$conflicted_packages"; then
|
||||
track_packages "$conflicted_packages"
|
||||
fi
|
||||
elif [ "$strategy" = 4 ]; then
|
||||
read -r -p "Enter space-separated packages to add to the configuation: " input_packages
|
||||
log debug "Input: input_packages = $input_packages"
|
||||
if validate_input_packages "$input_packages"; then
|
||||
track_packages "$input_packages"
|
||||
else
|
||||
not_on_configuration_dialog "$conflicted_packages"
|
||||
fi
|
||||
else
|
||||
log debug "[resolve_packages] Unexpected input: $strategy"
|
||||
not_on_configuration_dialog "$conflicted_packages"
|
||||
fi
|
||||
|
||||
check
|
||||
}
|
||||
|
||||
not_installed_dialog() {
|
||||
|
@ -82,7 +71,6 @@ not_installed_dialog() {
|
|||
|
||||
if [ "$strategy" = 6 ]; then
|
||||
log debug "[resolve_packages] User choice: Cancel or empty"
|
||||
return 0
|
||||
elif [ "$strategy" = 1 ]; then
|
||||
package_manager install "$conflicted_packages"
|
||||
elif [ "$strategy" = 2 ]; then
|
||||
|
@ -90,17 +78,11 @@ not_installed_dialog() {
|
|||
log debug "Input: input_packages = $input_packages"
|
||||
if validate_input_packages "$input_packages"; then
|
||||
package_manager install "$input_packages"
|
||||
else
|
||||
not_on_configuration_dialog "$conflicted_packages"
|
||||
fi
|
||||
elif [ "$strategy" = 3 ]; then
|
||||
untrack_packages "$conflicted_packages"
|
||||
elif [ "$strategy" = 4 ]; then
|
||||
read -r -p "Enter space-separated packages to remove from the configuation: " input_packages
|
||||
log debug "Input: input_packages = $input_packages"
|
||||
untrack_packages "$input_packages"
|
||||
else
|
||||
log debug "[resolve_packages] Unexpected input: $strategy"
|
||||
not_installed_dialog "$conflicted_packages"
|
||||
fi
|
||||
|
||||
check
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package_manager() {
|
||||
local command="$1"
|
||||
local output
|
||||
|
||||
local manager
|
||||
local authorizer="sudo"
|
||||
|
|
|
@ -1,18 +0,0 @@
|
|||
track_packages() {
|
||||
local packages="$1"
|
||||
|
||||
echo "$packages" | xargs | sed 's/ /\n/g' | while read -r package; do
|
||||
echo "$package" >> "$CONFIG_ROOT/packages"
|
||||
done
|
||||
}
|
||||
|
||||
untrack_packages() {
|
||||
local packages="$1"
|
||||
|
||||
log debug "[untrack_packages] Removing packages: $packages"
|
||||
|
||||
echo "$packages" | xargs | sed 's/ /\n/g' | while read -r package; do
|
||||
sed -i '' "/^[[:space:]]*$package[[:space:]]*$/d" "$CONFIG_ROOT/packages"
|
||||
log debug "[untrack_packages] Executed removal for $package with exit code $?"
|
||||
done
|
||||
}
|
2
tori
2
tori
|
@ -2,7 +2,7 @@
|
|||
|
||||
main() {
|
||||
# paths
|
||||
VERSION="0.4.1 2024-07-14"
|
||||
VERSION="0.3.1 2024-07-13"
|
||||
TORI_ROOT="$HOME/.local/share/tori"
|
||||
CONFIG_ROOT="$HOME/.config/tori"
|
||||
TMP_DIR="/tmp/tori"
|
||||
|
|
Loading…
Reference in a new issue