Compare commits
No commits in common. "de634f3749c834b16ede0478eaa98af3dc0fdc5f" and "4b6a9569954df8f6688100ca77f7e9d79764f845" have entirely different histories.
de634f3749
...
4b6a956995
3 changed files with 9 additions and 20 deletions
|
@ -54,27 +54,15 @@ file_merge_tree() {
|
||||||
return 0
|
return 0
|
||||||
elif [ "$strategy" -eq 1 ]; then
|
elif [ "$strategy" -eq 1 ]; then
|
||||||
backup_paths "$absolute_path"
|
backup_paths "$absolute_path"
|
||||||
if [ -r "$config_path" ] && [ -w "$absolute_path" ]; then
|
cp -vi "$config_path" "$absolute_path"
|
||||||
cp -vi "$config_path" "$absolute_path"
|
|
||||||
else
|
|
||||||
$AUTHORIZE_COMMAND cp -vi "$config_path" "$absolute_path"
|
|
||||||
fi
|
|
||||||
return 1
|
return 1
|
||||||
elif [ "$strategy" -eq 2 ]; then
|
elif [ "$strategy" -eq 2 ]; then
|
||||||
backup_paths "$config_path"
|
backup_paths "$config_path"
|
||||||
if [ -r "$absolute_path" ] && [ -w "$config_path" ]; then
|
cp -vi "$absolute_path" "$config_path"
|
||||||
cp -vi "$absolute_path" "$config_path"
|
|
||||||
else
|
|
||||||
$AUTHORIZE_COMMAND cp -vi "$absolute_path" "$config_path"
|
|
||||||
fi
|
|
||||||
return 1
|
return 1
|
||||||
elif [ "$strategy" -eq 3 ]; then
|
elif [ "$strategy" -eq 3 ]; then
|
||||||
echo "< $(tildify "$absolute_path") | $(echo "$config_path" | sed "s*$CONFIG_ROOT/**") >"
|
echo "< $(tildify "$absolute_path") | $(echo "$config_path" | sed "s*$CONFIG_ROOT/**") >"
|
||||||
if [ -r "$absolute_path" ] && [ -r "$config_path" ]; then
|
diff "$absolute_path" "$config_path"
|
||||||
diff "$absolute_path" "$config_path"
|
|
||||||
else
|
|
||||||
$AUTHORIZE_COMMAND diff "$absolute_path" "$config_path"
|
|
||||||
fi
|
|
||||||
return 1
|
return 1
|
||||||
else
|
else
|
||||||
log user 'Invalid choice'
|
log user 'Invalid choice'
|
||||||
|
|
|
@ -2,6 +2,7 @@ package_manager() {
|
||||||
local command="$1"
|
local command="$1"
|
||||||
|
|
||||||
local manager
|
local manager
|
||||||
|
local authorizer="sudo"
|
||||||
local args__install
|
local args__install
|
||||||
local args__uninstall
|
local args__uninstall
|
||||||
local args__get_manually_installed
|
local args__get_manually_installed
|
||||||
|
@ -24,11 +25,11 @@ package_manager() {
|
||||||
if [ "$command" = 'get_manually_installed' ]; then
|
if [ "$command" = 'get_manually_installed' ]; then
|
||||||
eval $manager "$args__get_manually_installed"
|
eval $manager "$args__get_manually_installed"
|
||||||
elif [ "$command" = 'install' ]; then
|
elif [ "$command" = 'install' ]; then
|
||||||
$AUTHORIZE_COMMAND $manager $args__install $args__user_args
|
$authorizer $manager $args__install $args__user_args
|
||||||
elif [ "$command" = 'uninstall' ]; then
|
elif [ "$command" = 'uninstall' ]; then
|
||||||
$AUTHORIZE_COMMAND $manager $args__uninstall $args__user_args
|
$authorizer $manager $args__uninstall $args__user_args
|
||||||
elif [ "$command" = 'update' ]; then
|
elif [ "$command" = 'update' ]; then
|
||||||
$AUTHORIZE_COMMAND $manager $args__update
|
$authorizer $manager $args__update
|
||||||
elif [ "$command" = 'get_available' ]; then
|
elif [ "$command" = 'get_available' ]; then
|
||||||
eval $manager "$args__get_available"
|
eval $manager "$args__get_available"
|
||||||
else
|
else
|
||||||
|
|
4
tori
4
tori
|
@ -19,14 +19,14 @@ main() {
|
||||||
parameter="$2"
|
parameter="$2"
|
||||||
|
|
||||||
# import source
|
# import source
|
||||||
|
|
||||||
check_core_paths
|
check_core_paths
|
||||||
. "$TORI_ROOT/src/index.sh"
|
. "$TORI_ROOT/src/index.sh"
|
||||||
|
set_opts on
|
||||||
|
|
||||||
## os-dependent state
|
## os-dependent state
|
||||||
set_opts on
|
|
||||||
OS="$(get_operating_system)"
|
OS="$(get_operating_system)"
|
||||||
PACKAGE_CACHE="$CACHE_ROOT/${OS}_packages.cache"
|
PACKAGE_CACHE="$CACHE_ROOT/${OS}_packages.cache"
|
||||||
AUTHORIZE_COMMAND="sudo"
|
|
||||||
|
|
||||||
base_files=
|
base_files=
|
||||||
bkp_files=
|
bkp_files=
|
||||||
|
|
Loading…
Reference in a new issue