|
31 | 31 | print_failed "Unable to get distro type..." |
32 | 32 | exit 1 |
33 | 33 | 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 |
34 | 46 | DISTRO_ROOT_PATH="$DISTRO_PATH/root" |
35 | 47 | DISTRO_OPT_PATH="$DISTRO_PATH/opt" |
36 | 48 | DISTRO_USER_HOME_PATH="$DISTRO_PATH/home/$USER_NAME" |
@@ -308,23 +320,6 @@ function download_file() { |
308 | 320 | return 1 |
309 | 321 | } |
310 | 322 |
|
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 | | - |
328 | 323 | # will check if the package is already installed or not, if it installed then reinstall and print success/failed message |
329 | 324 | function package_install_and_check { |
330 | 325 | log_debug "Starting package installation for: $*" |
@@ -854,10 +849,10 @@ SELECTED_DISTRO="$SELECTED_DISTRO" |
854 | 849 | EOF |
855 | 850 | fi |
856 | 851 | 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 |
858 | 853 | echo "$shell_setup_content" | sudo tee -a "$script_path" >/dev/null |
859 | 854 | 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" |
861 | 856 | echo "$shell_setup_content" >>"$script_path" |
862 | 857 | fi |
863 | 858 | # Make script executable |
|
0 commit comments