Skip to content

Commit e8b2ff0

Browse files
committed
fix: few fixes in the inbuild_functions
1 parent bc2f6d2 commit e8b2ff0

1 file changed

Lines changed: 14 additions & 19 deletions

File tree

appstore/inbuild_functions/inbuild_functions

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,18 @@ else
3131
print_failed "Unable to get distro type..."
3232
exit 1
3333
fi
34+
# shellcheck disable=SC1091
35+
if [[ -f "/data/data/com.termux/files/usr/bin/termux-setup-package-manager" ]]; then
36+
source "/data/data/com.termux/files/usr/bin/termux-setup-package-manager"
37+
fi
38+
39+
if [[ "$TERMUX_APP_PACKAGE_MANAGER" == "apt" ]]; then
40+
PACKAGE_MANAGER="apt"
41+
elif [[ "$TERMUX_APP_PACKAGE_MANAGER" == "pacman" ]]; then
42+
PACKAGE_MANAGER="pacman"
43+
else
44+
PACKAGE_MANAGER="pkg"
45+
fi
3446
DISTRO_ROOT_PATH="$DISTRO_PATH/root"
3547
DISTRO_OPT_PATH="$DISTRO_PATH/opt"
3648
DISTRO_USER_HOME_PATH="$DISTRO_PATH/home/$USER_NAME"
@@ -308,23 +320,6 @@ function download_file() {
308320
return 1
309321
}
310322

311-
function detact_package_manager() {
312-
# shellcheck disable=SC1091
313-
if [[ -f "/data/data/com.termux/files/usr/bin/termux-setup-package-manager" ]]; then
314-
source "/data/data/com.termux/files/usr/bin/termux-setup-package-manager"
315-
fi
316-
317-
if [[ "$TERMUX_APP_PACKAGE_MANAGER" == "apt" ]]; then
318-
PACKAGE_MANAGER="apt"
319-
elif [[ "$TERMUX_APP_PACKAGE_MANAGER" == "pacman" ]]; then
320-
PACKAGE_MANAGER="pacman"
321-
else
322-
PACKAGE_MANAGER="pkg"
323-
print_failed " Could not detect your package manager, Switching To pkg "
324-
fi
325-
log_debug "Package manager: $PACKAGE_MANAGER"
326-
}
327-
328323
# will check if the package is already installed or not, if it installed then reinstall and print success/failed message
329324
function package_install_and_check {
330325
log_debug "Starting package installation for: $*"
@@ -854,10 +849,10 @@ SELECTED_DISTRO="$SELECTED_DISTRO"
854849
EOF
855850
fi
856851
if [[ "$SELECTED_DISTRO_TYPE" == "chroot" ]]; then
857-
typeset -f _progress_emit progress_report progress_phase progress_done progress_error check_termux log_warn log_error log_debug print_success print_failed print_warn print_msg wait_for_keypress check_and_create_directory check_and_delete check_and_backup check_and_restore download_file detact_package_manager package_install_and_check package_remove_and_check get_file_name_number extract download_and_extract count_subfolders get_latest_release install_font_for_style select_an_option read_conf print_to_config update_sys fix_exec install_appimage get_latest_version _pd_package_install_and_check_internal _pd_package_remove_and_check_internal _pd_update_sys_internal distro_run pd_check_and_create_directory pd_check_and_delete pd_check_and_backup pd_check_and_restore set_distro_paths | sudo tee -a "$script_path" >/dev/null
852+
typeset -f _progress_emit progress_report progress_phase progress_done progress_error check_termux log_warn log_error log_debug print_success print_failed print_warn print_msg wait_for_keypress check_and_create_directory check_and_delete check_and_backup check_and_restore download_file package_install_and_check package_remove_and_check get_file_name_number extract download_and_extract count_subfolders get_latest_release install_font_for_style select_an_option print_to_config update_sys fix_exec install_appimage get_latest_version _pd_package_install_and_check_internal _pd_package_remove_and_check_internal _pd_update_sys_internal distro_run pd_check_and_create_directory pd_check_and_delete pd_check_and_backup pd_check_and_restore | sudo tee -a "$script_path" >/dev/null
858853
echo "$shell_setup_content" | sudo tee -a "$script_path" >/dev/null
859854
else
860-
typeset -f _progress_emit progress_report progress_phase progress_done progress_error check_termux log_warn log_error log_debug print_success print_failed print_warn print_msg wait_for_keypress check_and_create_directory check_and_delete check_and_backup check_and_restore download_file detact_package_manager package_install_and_check package_remove_and_check get_file_name_number extract download_and_extract count_subfolders get_latest_release install_font_for_style select_an_option read_conf print_to_config update_sys fix_exec install_appimage get_latest_version _pd_package_install_and_check_internal _pd_package_remove_and_check_internal _pd_update_sys_internal distro_run pd_check_and_create_directory pd_check_and_delete pd_check_and_backup pd_check_and_restore set_distro_paths >>"$script_path"
855+
typeset -f _progress_emit progress_report progress_phase progress_done progress_error check_termux log_warn log_error log_debug print_success print_failed print_warn print_msg wait_for_keypress check_and_create_directory check_and_delete check_and_backup check_and_restore download_file package_install_and_check package_remove_and_check get_file_name_number extract download_and_extract count_subfolders get_latest_release install_font_for_style select_an_option print_to_config update_sys fix_exec install_appimage get_latest_version _pd_package_install_and_check_internal _pd_package_remove_and_check_internal _pd_update_sys_internal distro_run pd_check_and_create_directory pd_check_and_delete pd_check_and_backup pd_check_and_restore >>"$script_path"
861856
echo "$shell_setup_content" >>"$script_path"
862857
fi
863858
# Make script executable

0 commit comments

Comments
 (0)