From 2d102411f7a3bb1790cfdaea4b6f21fa34944d49 Mon Sep 17 00:00:00 2001 From: iVAN <88724353+ivan-hc@users.noreply.github.com> Date: Sun, 3 May 2026 04:28:39 +0200 Subject: [PATCH 01/19] Use static binaries as a fallback solution if missing dependencies --- APP-MANAGER | 48 +++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 43 insertions(+), 5 deletions(-) diff --git a/APP-MANAGER b/APP-MANAGER index c025cc115..d0ff388c3 100755 --- a/APP-MANAGER +++ b/APP-MANAGER @@ -1,6 +1,6 @@ #!/usr/bin/env bash -AMVERSION="10.1-4" +AMVERSION="10.1-5" # Determine main repository and branch AMREPO="https://raw.githubusercontent.com/ivan-hc/AM/main" @@ -491,10 +491,41 @@ _validate_and_download_lists_of_archived_and_obsolete_apps() { # SAFETY CHECKS +# Use static binaries as a fallback solution in case there are no dependencies +AM_core_dependencies="cat chmod chown curl grep sed wget" +AM_opt_dependencies="7z ar column file md5sum sha1sum sha256sum sha512sum tar unzip xz" +_deps_dl() { + if command -v curl >/dev/null 2>&1; then + curl -Lo "$CACHEDIR"/AMCACHEPATH/"$name" "$AM_UTILS_SOURCE/$name-$ARCH-static" 2>/dev/null + elif command -v wget >/dev/null 2>&1; then + wget -q "$AM_UTILS_SOURCE/$name-$ARCH-static" -O "$CACHEDIR"/AMCACHEPATH/"$name" + else + echo " 💀 ERROR: No curl or wget found" + exit 0 + fi +} + +if [ "$ARCH" = aarch64 ] || [ "$ARCH" = x86_64 ]; then + mkdir -p "$CACHEDIR"/AMCACHEPATH + amutils="$AM_core_dependencies $AM_opt_dependencies" + AM_UTILS_SOURCE="https://github.com/ivan-hc/am-utils/releases/download/$ARCH-20260502" + for name in $amutils; do + if ! command -v "$name" >/dev/null 2>&1; then + if [ -d "$CACHEDIR"/AMCACHEPATH/"$name" ] || [ -L "$CACHEDIR"/AMCACHEPATH/"$name" ] || [ ! -f "$CACHEDIR"/AMCACHEPATH/"$name" ]; then + rm -Rf "$CACHEDIR"/AMCACHEPATH/"$name" + printf "Missing command \"%b\", downloading static binary as a fallback solution\n" "$name" | _fit + _deps_dl && chmod a+x "$CACHEDIR"/AMCACHEPATH/"$name" + fi + else + rm -Rf "$CACHEDIR"/AMCACHEPATH/"$name" + fi + done + export PATH="$CACHEDIR"/AMCACHEPATH/:"${PATH}" +fi + # Check for essential commands required by the application missing_deps="" -AMDEPENDENCES="cat chmod chown curl grep sed wget" -for name in $AMDEPENDENCES; do +for name in $AM_core_dependencies; do if ! command -v "$name" >/dev/null 2>&1; then missing_deps="$name $missing_deps" fi @@ -542,9 +573,16 @@ _online_check() { # Check AMCACHEPATH integrity if [ -d "$CACHEDIR"/AMCACHEPATH ]; then - am_bins_allowed=$(echo "appimagetool" | tr ' ' '\n' | sed "s#^#$CACHEDIR/AMCACHEPATH/#g") + am_bins_allowed=$(echo "appimagetool $amutils" | tr ' ' '\n' | sed "s#^#$CACHEDIR/AMCACHEPATH/#g") am_bins_all=$(find "$CACHEDIR"/AMCACHEPATH -mindepth 1 -maxdepth 1 \( -type d -o -type f -o -type l \)) - for f in $am_bins_all; do if ! echo "$am_bins_allowed" | grep -q "$f$" 2>/dev/null; then rm "$f" 2>/dev/null; fi; done + if [ -n "$am_bins_all" ]; then + for f in "$CACHEDIR"/AMCACHEPATH/*; do + am_bin_item=$(echo "$f" | sed 's:.*/::') + if ! echo "$am_bins_allowed" | grep -q "$am_bin_item$" 2>/dev/null; then + rm -Rf "$f" + fi + done + fi fi # Check if appimagetool is installed, and if it is not installed, download and use it where it is needed From 742432ce8a1ab0bad1501bc8aed7c5fc46ba07ff Mon Sep 17 00:00:00 2001 From: iVAN <88724353+ivan-hc@users.noreply.github.com> Date: Sun, 3 May 2026 13:27:21 +0200 Subject: [PATCH 02/19] Add unxz and xzcat as opt dependencies --- APP-MANAGER | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/APP-MANAGER b/APP-MANAGER index ac8b47f17..708bab7e2 100755 --- a/APP-MANAGER +++ b/APP-MANAGER @@ -1,6 +1,6 @@ #!/usr/bin/env bash -AMVERSION="10.1-5" +AMVERSION="10.1-6" # Determine main repository and branch AMREPO="https://raw.githubusercontent.com/ivan-hc/AM/main" @@ -494,7 +494,7 @@ _validate_and_download_lists_of_archived_and_obsolete_apps() { # Use static binaries as a fallback solution in case there are no dependencies AM_core_dependencies="cat chmod chown curl grep sed wget" -AM_opt_dependencies="7z ar column file md5sum sha1sum sha256sum sha512sum tar unzip xz" +AM_opt_dependencies="7z ar column file md5sum sha1sum sha256sum sha512sum tar unxz unzip xz xzcat" _deps_dl() { if command -v curl >/dev/null 2>&1; then curl -Lo "$CACHEDIR"/AMCACHEPATH/"$name" "$AM_UTILS_SOURCE/$name-$ARCH-static" 2>/dev/null @@ -509,7 +509,7 @@ _deps_dl() { if [ "$ARCH" = aarch64 ] || [ "$ARCH" = x86_64 ]; then mkdir -p "$CACHEDIR"/AMCACHEPATH amutils="$AM_core_dependencies $AM_opt_dependencies" - AM_UTILS_SOURCE="https://github.com/ivan-hc/am-utils/releases/download/$ARCH-20260502" + AM_UTILS_SOURCE="https://github.com/ivan-hc/am-utils/releases/download/continuous-$ARCH" for name in $amutils; do if ! command -v "$name" >/dev/null 2>&1; then if [ -d "$CACHEDIR"/AMCACHEPATH/"$name" ] || [ -L "$CACHEDIR"/AMCACHEPATH/"$name" ] || [ ! -f "$CACHEDIR"/AMCACHEPATH/"$name" ]; then From 7da8a8b155c6efe4856d3d4b2c9f8f243abf7147 Mon Sep 17 00:00:00 2001 From: iVAN <88724353+ivan-hc@users.noreply.github.com> Date: Mon, 4 May 2026 03:16:33 +0200 Subject: [PATCH 03/19] Improve online check, one block for dependencies check - _online_check now can alternate between wget and curl - wget/curl availability is determined directly in _online_check - move _online_check before dependencies check - list missing dependencies before installing them, and show the source - remove appimagetool and other extra dependencies not in "am-utils" if the command is in $PATH always check "purity" of the AMCACHEPATH directory --- APP-MANAGER | 85 ++++++++++++++++++++++++++++++++++------------------- 1 file changed, 54 insertions(+), 31 deletions(-) diff --git a/APP-MANAGER b/APP-MANAGER index 708bab7e2..2372e9dbf 100755 --- a/APP-MANAGER +++ b/APP-MANAGER @@ -1,6 +1,6 @@ #!/usr/bin/env bash -AMVERSION="10.1-6" +AMVERSION="10.1-7" # Determine main repository and branch AMREPO="https://raw.githubusercontent.com/ivan-hc/AM/main" @@ -492,6 +492,25 @@ _validate_and_download_lists_of_archived_and_obsolete_apps() { # SAFETY CHECKS +# Function to check online connections (uses github.com by default, as the database and CLI itself are stored/hosted there) +_online_check_tool() { + if command -v wget >/dev/null 2>&1; then + wget -q --tries=10 --timeout=20 --spider https://github.com + elif command -v curl >/dev/null 2>&1; then + curl --output /dev/null --silent --head --fail https://github.com 1> /dev/null + else + printf $" ${RED}💀 ERROR! MISSING ESSENTIAL COMMANDS\033[0m: %s\n\n Install the above and try again! \n" "$(echo "curl, wget")" + exit 0 + fi +} + +_online_check() { + if ! _online_check_tool; then + printf $"\n %b is offline, please check your internet connection and try again\n\n" "$AMCLI" + exit 0 + fi +} + # Use static binaries as a fallback solution in case there are no dependencies AM_core_dependencies="cat chmod chown curl grep sed wget" AM_opt_dependencies="7z ar column file md5sum sha1sum sha256sum sha512sum tar unxz unzip xz xzcat" @@ -500,27 +519,53 @@ _deps_dl() { curl -Lo "$CACHEDIR"/AMCACHEPATH/"$name" "$AM_UTILS_SOURCE/$name-$ARCH-static" 2>/dev/null elif command -v wget >/dev/null 2>&1; then wget -q "$AM_UTILS_SOURCE/$name-$ARCH-static" -O "$CACHEDIR"/AMCACHEPATH/"$name" - else - echo " 💀 ERROR: No curl or wget found" - exit 0 fi } if [ "$ARCH" = aarch64 ] || [ "$ARCH" = x86_64 ]; then mkdir -p "$CACHEDIR"/AMCACHEPATH + # Download static binaries if commands are not available amutils="$AM_core_dependencies $AM_opt_dependencies" AM_UTILS_SOURCE="https://github.com/ivan-hc/am-utils/releases/download/continuous-$ARCH" for name in $amutils; do if ! command -v "$name" >/dev/null 2>&1; then if [ -d "$CACHEDIR"/AMCACHEPATH/"$name" ] || [ -L "$CACHEDIR"/AMCACHEPATH/"$name" ] || [ ! -f "$CACHEDIR"/AMCACHEPATH/"$name" ]; then rm -Rf "$CACHEDIR"/AMCACHEPATH/"$name" - printf "Missing command \"%b\", downloading static binary as a fallback solution\n" "$name" | _fit - _deps_dl && chmod a+x "$CACHEDIR"/AMCACHEPATH/"$name" + if [ -z "$fallback_binaries_needed" ]; then + fallback_binaries_needed="$name" + else + fallback_binaries_needed=$(echo "$fallback_binaries_needed $name" | tr ' ' '\n' | sort | xargs) + fi fi - else + fi + done + if [ -n "$fallback_binaries_needed" ]; then + _online_check + printf "%b\n" "$DIVIDING_LINE" + printf "Missing commands will be temporarily downloaded as static binaries:\n\n" | _fit + for name in $fallback_binaries_needed; do + _deps_dl && chmod a+x "$CACHEDIR"/AMCACHEPATH/"$name" && printf " - %b, downloaded from https://github.com/ivan-hc/am-utils\n" "$name" + done + printf "\n%b\n" "$DIVIDING_LINE" + fi + # Remove static binaries and other temporary utilities if related commands are already available in PATH + amutils="appimagetool $amutils" + for name in $amutils; do + if command -v "$name" >/dev/null 2>&1 && [ -f "$CACHEDIR"/AMCACHEPATH/"$name" ]; then rm -Rf "$CACHEDIR"/AMCACHEPATH/"$name" fi done + # Check AMCACHEPATH integrity + am_bins_allowed=$(echo "$amutils" | tr ' ' '\n' | sed "s#^#$CACHEDIR/AMCACHEPATH/#g") + am_bins_all=$(find "$CACHEDIR"/AMCACHEPATH -mindepth 1 -maxdepth 1 \( -type d -o -type f -o -type l \)) + if [ -n "$am_bins_all" ]; then + for f in "$CACHEDIR"/AMCACHEPATH/*; do + am_bin_item=$(echo "$f" | sed 's:.*/::') + if ! echo "$am_bins_allowed" | grep -q "$am_bin_item$" 2>/dev/null; then + rm -Rf "$f" + fi + done + fi export PATH="$CACHEDIR"/AMCACHEPATH/:"${PATH}" fi @@ -537,10 +582,10 @@ if [ -n "$missing_deps" ]; then echo "$DIVIDING_LINE" printf $" ${RED}💀 ERROR! MISSING ESSENTIAL COMMANDS\033[0m: %s\n\n Install the above and try again! \n" "${missing_deps[*]}" echo "$DIVIDING_LINE" - printf $"%bList of the %b core dependences\033[0m:\n\n%b\n" "${Green}" "$AMCLIUPPER $AMVERSION" "$AMDEPENDENCES" | _fit + printf $"%bList of the %b core dependences\033[0m:\n\n%b\n" "${Green}" "$AMCLIUPPER $AMVERSION" "$AM_core_dependencies" | _fit echo "$DIVIDING_LINE" printf $"If this message appears it is because you are missing some dependency and if its the first time its because something new has been introduced.\n\n" | _fit - printf $" See %bhttps://github.com/ivan-hc/AM#core-dependences\033[0m for more information\n" "${LightBlue}" + printf $" See %bhttps://github.com/ivan-hc/AM#installation\033[0m for more information\n" "${LightBlue}" echo "$DIVIDING_LINE" exit 1 fi @@ -564,28 +609,6 @@ _check_fedora_mess() { fi } -# Function to check online connections (uses github.com by default, as the database and CLI itself are stored/hosted there) -_online_check() { - if ! wget -q --tries=10 --timeout=20 --spider https://github.com; then - printf $"\n %b is offline, please check your internet connection and try again\n\n" "$AMCLI" - exit 0 - fi -} - -# Check AMCACHEPATH integrity -if [ -d "$CACHEDIR"/AMCACHEPATH ]; then - am_bins_allowed=$(echo "appimagetool $amutils" | tr ' ' '\n' | sed "s#^#$CACHEDIR/AMCACHEPATH/#g") - am_bins_all=$(find "$CACHEDIR"/AMCACHEPATH -mindepth 1 -maxdepth 1 \( -type d -o -type f -o -type l \)) - if [ -n "$am_bins_all" ]; then - for f in "$CACHEDIR"/AMCACHEPATH/*; do - am_bin_item=$(echo "$f" | sed 's:.*/::') - if ! echo "$am_bins_allowed" | grep -q "$am_bin_item$" 2>/dev/null; then - rm -Rf "$f" - fi - done - fi -fi - # Check if appimagetool is installed, and if it is not installed, download and use it where it is needed _download_appimagetool() { _determine_args From 6a0e9a9b45c27cdcc12e5a8eb73efefb49c904fd Mon Sep 17 00:00:00 2001 From: iVAN <88724353+ivan-hc@users.noreply.github.com> Date: Mon, 4 May 2026 04:32:36 +0200 Subject: [PATCH 04/19] Remove cmp dependency --- APP-MANAGER | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/APP-MANAGER b/APP-MANAGER index 2372e9dbf..3479ae2bd 100755 --- a/APP-MANAGER +++ b/APP-MANAGER @@ -1758,7 +1758,7 @@ _update_determine_apps_version_changes() { _update_list_updatable_apps OLDVER="$AMCACHEDIR/updatable-args-list-old" NEWVER="$AMCACHEDIR/updatable-args-list" - if cmp --silent -- "$NEWVER" "$OLDVER"; then + if [ "$(sort "$NEWVER")" = "$(sort "$OLDVER")" ]; then printf $" Nothing to do here! \n" else printf $" The following apps have been updated:\n\n" From 9a2ac8cd8f0772c78a5412e6b4b86141f5530a00 Mon Sep 17 00:00:00 2001 From: iVAN <88724353+ivan-hc@users.noreply.github.com> Date: Mon, 4 May 2026 04:52:37 +0200 Subject: [PATCH 05/19] Remove diff dependency --- APP-MANAGER | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/APP-MANAGER b/APP-MANAGER index 3479ae2bd..36bc744e1 100755 --- a/APP-MANAGER +++ b/APP-MANAGER @@ -1720,7 +1720,15 @@ _update_print_updated_apps_table() { app_header=$(printf $"App") old_header=$(printf $"Previous") new_header=$(printf $"Current") - diff "$OLDVER" "$NEWVER" | grep "^>" | sed 's/^> //g' | while IFS= read -r updated_app; do + awk ' + NR==FNR { a[NR]=$0; next } + { + if ($0 != a[FNR]) { + print "< " a[FNR] + print "> " $0 + } + } + ' "$OLDVER" "$NEWVER" | grep "^>" | sed 's/^> //g' | while IFS= read -r updated_app; do arg=$(printf "%s\n" "$updated_app" | awk '{print $2}') old_app=$(grep -F " ◆ $arg " "$OLDVER" | head -1) old_version=$(printf "%s\n" "$old_app" | sed "s/^ ◆ $arg //; s/\x1b\[[0-9;]*m//g; s/[✖✓🔒]//g; s/ */ /g; s/ $//") From 5c01b5ed68501533a70565471e9e3355bdbc861b Mon Sep 17 00:00:00 2001 From: iVAN <88724353+ivan-hc@users.noreply.github.com> Date: Mon, 4 May 2026 13:37:50 +0200 Subject: [PATCH 06/19] Pass the custom PATH to the installation script while running --- modules/install.am | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/modules/install.am b/modules/install.am index a93daa0fa..5ff7879c8 100644 --- a/modules/install.am +++ b/modules/install.am @@ -298,6 +298,14 @@ _ending_the_installation() { fi } +_install_exec_installation_script() { + if [ "$(ls -A "$CACHEDIR"/AMCACHEPATH 2>/dev/null)" ]; then + $SUDOCMD PATH="$PATH" ./"$arg" + else + $SUDOCMD ./"$arg" + fi +} + _install_script_retry() { # Determine if the installation has stopped when trying to download the app test_lastdir=$(ls -td "$APPSPATH"/* | head -1 | sed 's:.*/::') @@ -309,7 +317,7 @@ _install_script_retry() { if [ -z "$( ls -A "$test_lastdir_tmp" )" ]; then printf "\n The file was not downloaded, attempt %b of 5 will start in 5 seconds...\n\n" "$((TAKES_COUNT + 1))" sleep 5 - $SUDOCMD ./"$arg" + _install_exec_installation_script fi fi TAKES_COUNT=$((TAKES_COUNT + 1)) @@ -326,7 +334,7 @@ _install_script_retry() { printf -- "\n %b✔ Attempting to extend pages in progress...\033[0m\n\n" "${Gold}" sleep 5 sed -i 's#/releases #/releases?per\_page=100 #g' ./"$arg" - $SUDOCMD ./"$arg" || printf -- "\n %b✖ Failed! \033[0m \n" "${RED}" + _install_exec_installation_script || printf -- "\n %b✖ Failed! \033[0m \n" "${RED}" else # No patches found printf -- "\n %b✖ No patch available! \033[0m \n" "${RED}" @@ -354,7 +362,7 @@ _install_arg() { # Set trap to cleanup on interruption (Ctrl+C, kill, hangup, quit) trap _installation_cleanup INT TERM HUP QUIT # Install script - $SUDOCMD ./"$arg" || _install_script_retry + _install_exec_installation_script || _install_script_retry echo "" _post_installation_processes _ending_the_installation From 1cc9ff7ae46c05f52ebf9ad17098ca3194705dcd Mon Sep 17 00:00:00 2001 From: iVAN <88724353+ivan-hc@users.noreply.github.com> Date: Mon, 4 May 2026 13:43:34 +0200 Subject: [PATCH 07/19] Add notify-send as opt dependency see https://github.com/ivan-hc/AM/pull/2318#issuecomment-4368669256 --- APP-MANAGER | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/APP-MANAGER b/APP-MANAGER index 36bc744e1..2a05850c1 100755 --- a/APP-MANAGER +++ b/APP-MANAGER @@ -513,7 +513,7 @@ _online_check() { # Use static binaries as a fallback solution in case there are no dependencies AM_core_dependencies="cat chmod chown curl grep sed wget" -AM_opt_dependencies="7z ar column file md5sum sha1sum sha256sum sha512sum tar unxz unzip xz xzcat" +AM_opt_dependencies="7z ar column file md5sum notify-send sha1sum sha256sum sha512sum tar unxz unzip xz xzcat" _deps_dl() { if command -v curl >/dev/null 2>&1; then curl -Lo "$CACHEDIR"/AMCACHEPATH/"$name" "$AM_UTILS_SOURCE/$name-$ARCH-static" 2>/dev/null From bf25ea14f1b17bbd4ac3e90949781b1c3bfe7469 Mon Sep 17 00:00:00 2001 From: iVAN <88724353+ivan-hc@users.noreply.github.com> Date: Mon, 4 May 2026 18:30:51 +0200 Subject: [PATCH 08/19] Add checksum on standard dependencies see https://github.com/ivan-hc/AM/issues/2305#issuecomment-4372532247 --- APP-MANAGER | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/APP-MANAGER b/APP-MANAGER index 2a05850c1..2a9ae5148 100755 --- a/APP-MANAGER +++ b/APP-MANAGER @@ -1,6 +1,6 @@ #!/usr/bin/env bash -AMVERSION="10.1-7" +AMVERSION="10.1-8" # Determine main repository and branch AMREPO="https://raw.githubusercontent.com/ivan-hc/AM/main" @@ -511,9 +511,21 @@ _online_check() { fi } +_checksum_on_standard_dependencies() { + if [ -f "$CACHEDIR"/AMCACHEPATH/"$name" ]; then + dep_sum256_local=$(sha256sum "$CACHEDIR"/AMCACHEPATH/"$name" 2>/dev/null | awk '{print $1}') + dep_sum256_host=$(curl -Ls "$AM_UTILS_SOURCE"/"$name"-$ARCH-static 2>/dev/null| sha256sum | awk '{print $1}') + if [ "$dep_sum256_local" != "$dep_sum256_host" ]; then + rm -Rf "$CACHEDIR"/AMCACHEPATH/"$name" + _deps_dl && chmod a+x "$CACHEDIR"/AMCACHEPATH/"$name" && printf " - %b, downloaded from https://github.com/ivan-hc/am-utils\n" "$name" + fi + fi +} + # Use static binaries as a fallback solution in case there are no dependencies AM_core_dependencies="cat chmod chown curl grep sed wget" AM_opt_dependencies="7z ar column file md5sum notify-send sha1sum sha256sum sha512sum tar unxz unzip xz xzcat" +AM_standard_dependencies="$AM_core_dependencies $AM_opt_dependencies" _deps_dl() { if command -v curl >/dev/null 2>&1; then curl -Lo "$CACHEDIR"/AMCACHEPATH/"$name" "$AM_UTILS_SOURCE/$name-$ARCH-static" 2>/dev/null @@ -525,7 +537,7 @@ _deps_dl() { if [ "$ARCH" = aarch64 ] || [ "$ARCH" = x86_64 ]; then mkdir -p "$CACHEDIR"/AMCACHEPATH # Download static binaries if commands are not available - amutils="$AM_core_dependencies $AM_opt_dependencies" + amutils="$AM_standard_dependencies" AM_UTILS_SOURCE="https://github.com/ivan-hc/am-utils/releases/download/continuous-$ARCH" for name in $amutils; do if ! command -v "$name" >/dev/null 2>&1; then @@ -567,6 +579,11 @@ if [ "$ARCH" = aarch64 ] || [ "$ARCH" = x86_64 ]; then done fi export PATH="$CACHEDIR"/AMCACHEPATH/:"${PATH}" + # Check binaries integrity + for name in $AM_standard_dependencies; do + _checksum_on_standard_dependencies & + done + wait fi # Check for essential commands required by the application From 90808b2cfbc9202d05aadb0ede7c4a8e3ab52f6a Mon Sep 17 00:00:00 2001 From: iVAN <88724353+ivan-hc@users.noreply.github.com> Date: Mon, 4 May 2026 20:46:42 +0200 Subject: [PATCH 09/19] Improve checksum on standard dependencies --- APP-MANAGER | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/APP-MANAGER b/APP-MANAGER index 2a9ae5148..722d5339d 100755 --- a/APP-MANAGER +++ b/APP-MANAGER @@ -1,6 +1,6 @@ #!/usr/bin/env bash -AMVERSION="10.1-8" +AMVERSION="10.1-9" # Determine main repository and branch AMREPO="https://raw.githubusercontent.com/ivan-hc/AM/main" @@ -514,7 +514,7 @@ _online_check() { _checksum_on_standard_dependencies() { if [ -f "$CACHEDIR"/AMCACHEPATH/"$name" ]; then dep_sum256_local=$(sha256sum "$CACHEDIR"/AMCACHEPATH/"$name" 2>/dev/null | awk '{print $1}') - dep_sum256_host=$(curl -Ls "$AM_UTILS_SOURCE"/"$name"-$ARCH-static 2>/dev/null| sha256sum | awk '{print $1}') + dep_sum256_host=$(echo "$deps_sum256_all" | grep "$name-$ARCH-static$" 2>/dev/null | awk '{print $1}') if [ "$dep_sum256_local" != "$dep_sum256_host" ]; then rm -Rf "$CACHEDIR"/AMCACHEPATH/"$name" _deps_dl && chmod a+x "$CACHEDIR"/AMCACHEPATH/"$name" && printf " - %b, downloaded from https://github.com/ivan-hc/am-utils\n" "$name" @@ -523,7 +523,7 @@ _checksum_on_standard_dependencies() { } # Use static binaries as a fallback solution in case there are no dependencies -AM_core_dependencies="cat chmod chown curl grep sed wget" +AM_core_dependencies="cat chmod chown curl grep sed wget chroot swapon swapoff" AM_opt_dependencies="7z ar column file md5sum notify-send sha1sum sha256sum sha512sum tar unxz unzip xz xzcat" AM_standard_dependencies="$AM_core_dependencies $AM_opt_dependencies" _deps_dl() { @@ -580,10 +580,13 @@ if [ "$ARCH" = aarch64 ] || [ "$ARCH" = x86_64 ]; then fi export PATH="$CACHEDIR"/AMCACHEPATH/:"${PATH}" # Check binaries integrity - for name in $AM_standard_dependencies; do - _checksum_on_standard_dependencies & - done - wait + deps_sum256_all=$(curl -Ls "$AM_UTILS_SOURCE/$ARCH.sha256sum.txt" 2>/dev/null) + if [ -n "$deps_sum256_all" ]; then + for name in $AM_standard_dependencies; do + _checksum_on_standard_dependencies & + done + wait + fi fi # Check for essential commands required by the application From 91aba339a53d992830b655e526c702b996364f00 Mon Sep 17 00:00:00 2001 From: iVAN <88724353+ivan-hc@users.noreply.github.com> Date: Mon, 4 May 2026 21:00:32 +0200 Subject: [PATCH 10/19] Remove dependencies I used for tests --- APP-MANAGER | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/APP-MANAGER b/APP-MANAGER index 722d5339d..e8ec52791 100755 --- a/APP-MANAGER +++ b/APP-MANAGER @@ -523,7 +523,7 @@ _checksum_on_standard_dependencies() { } # Use static binaries as a fallback solution in case there are no dependencies -AM_core_dependencies="cat chmod chown curl grep sed wget chroot swapon swapoff" +AM_core_dependencies="cat chmod chown curl grep sed wget" AM_opt_dependencies="7z ar column file md5sum notify-send sha1sum sha256sum sha512sum tar unxz unzip xz xzcat" AM_standard_dependencies="$AM_core_dependencies $AM_opt_dependencies" _deps_dl() { From b3b33ca5d81d5bdee32be04d425bbb8b9e1ce544 Mon Sep 17 00:00:00 2001 From: iVAN <88724353+ivan-hc@users.noreply.github.com> Date: Tue, 5 May 2026 18:32:05 +0200 Subject: [PATCH 11/19] Warn about temporary static binaries / only run checksum if online --- APP-MANAGER | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/APP-MANAGER b/APP-MANAGER index e8ec52791..12f9def19 100755 --- a/APP-MANAGER +++ b/APP-MANAGER @@ -1,6 +1,6 @@ #!/usr/bin/env bash -AMVERSION="10.1-9" +AMVERSION="10.1-10" # Determine main repository and branch AMREPO="https://raw.githubusercontent.com/ivan-hc/AM/main" @@ -580,12 +580,19 @@ if [ "$ARCH" = aarch64 ] || [ "$ARCH" = x86_64 ]; then fi export PATH="$CACHEDIR"/AMCACHEPATH/:"${PATH}" # Check binaries integrity - deps_sum256_all=$(curl -Ls "$AM_UTILS_SOURCE/$ARCH.sha256sum.txt" 2>/dev/null) - if [ -n "$deps_sum256_all" ]; then - for name in $AM_standard_dependencies; do - _checksum_on_standard_dependencies & - done - wait + if [ "$(ls -A "$CACHEDIR"/AMCACHEPATH 2>/dev/null)" ]; then + if curl --output /dev/null --silent --head --fail https://github.com 1> /dev/null; then + deps_sum256_all=$(curl -Ls "$AM_UTILS_SOURCE/$ARCH.sha256sum.txt" 2>/dev/null) + if [ -n "$deps_sum256_all" ]; then + printf "%b\n" "$DIVIDING_LINE" + printf "Temporary static fallback binaries are used for the following commands:\n%b%b\033[0m\nInstall them via your system's package manager to avoid slowdowns.\n" "${Green}" "$(ls "$CACHEDIR"/AMCACHEPATH/ | xargs | _fit )" | _fit + printf "%b\n" "$DIVIDING_LINE" + for name in $AM_standard_dependencies; do + _checksum_on_standard_dependencies & + done + wait + fi + fi fi fi From 68e53800ae901d45656bdc90371e94195efd6135 Mon Sep 17 00:00:00 2001 From: iVAN <88724353+ivan-hc@users.noreply.github.com> Date: Tue, 5 May 2026 18:40:22 +0200 Subject: [PATCH 12/19] Export custom PATH only if it is not empty --- APP-MANAGER | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/APP-MANAGER b/APP-MANAGER index 12f9def19..4ba7a2a02 100755 --- a/APP-MANAGER +++ b/APP-MANAGER @@ -1,6 +1,6 @@ #!/usr/bin/env bash -AMVERSION="10.1-10" +AMVERSION="10.1-11" # Determine main repository and branch AMREPO="https://raw.githubusercontent.com/ivan-hc/AM/main" @@ -578,7 +578,6 @@ if [ "$ARCH" = aarch64 ] || [ "$ARCH" = x86_64 ]; then fi done fi - export PATH="$CACHEDIR"/AMCACHEPATH/:"${PATH}" # Check binaries integrity if [ "$(ls -A "$CACHEDIR"/AMCACHEPATH 2>/dev/null)" ]; then if curl --output /dev/null --silent --head --fail https://github.com 1> /dev/null; then @@ -593,6 +592,7 @@ if [ "$ARCH" = aarch64 ] || [ "$ARCH" = x86_64 ]; then wait fi fi + export PATH="$CACHEDIR"/AMCACHEPATH/:"${PATH}" fi fi From 0663cf04c3ff7d00bb32cac16c61ec4b8de6b56f Mon Sep 17 00:00:00 2001 From: iVAN <88724353+ivan-hc@users.noreply.github.com> Date: Tue, 5 May 2026 20:34:52 +0200 Subject: [PATCH 13/19] Made "fallback binaries" message more user friendly. --- APP-MANAGER | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/APP-MANAGER b/APP-MANAGER index 4ba7a2a02..181c7f998 100755 --- a/APP-MANAGER +++ b/APP-MANAGER @@ -1,6 +1,6 @@ #!/usr/bin/env bash -AMVERSION="10.1-11" +AMVERSION="10.1-12" # Determine main repository and branch AMREPO="https://raw.githubusercontent.com/ivan-hc/AM/main" @@ -584,7 +584,7 @@ if [ "$ARCH" = aarch64 ] || [ "$ARCH" = x86_64 ]; then deps_sum256_all=$(curl -Ls "$AM_UTILS_SOURCE/$ARCH.sha256sum.txt" 2>/dev/null) if [ -n "$deps_sum256_all" ]; then printf "%b\n" "$DIVIDING_LINE" - printf "Temporary static fallback binaries are used for the following commands:\n%b%b\033[0m\nInstall them via your system's package manager to avoid slowdowns.\n" "${Green}" "$(ls "$CACHEDIR"/AMCACHEPATH/ | xargs | _fit )" | _fit + printf "Temporary fallback binaries are in use for the commands below::\n%b%b\033[0m\nInstall them to avoid slow performance.\n" "${Green}" "$(ls "$CACHEDIR"/AMCACHEPATH/ | xargs | _fit )" | _fit printf "%b\n" "$DIVIDING_LINE" for name in $AM_standard_dependencies; do _checksum_on_standard_dependencies & From 9557f090d04cdd9c5a2adcdc1721cef54f8130b2 Mon Sep 17 00:00:00 2001 From: iVAN <88724353+ivan-hc@users.noreply.github.com> Date: Tue, 5 May 2026 20:41:10 +0200 Subject: [PATCH 14/19] Fix typo --- APP-MANAGER | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/APP-MANAGER b/APP-MANAGER index 181c7f998..e21004dd5 100755 --- a/APP-MANAGER +++ b/APP-MANAGER @@ -584,7 +584,7 @@ if [ "$ARCH" = aarch64 ] || [ "$ARCH" = x86_64 ]; then deps_sum256_all=$(curl -Ls "$AM_UTILS_SOURCE/$ARCH.sha256sum.txt" 2>/dev/null) if [ -n "$deps_sum256_all" ]; then printf "%b\n" "$DIVIDING_LINE" - printf "Temporary fallback binaries are in use for the commands below::\n%b%b\033[0m\nInstall them to avoid slow performance.\n" "${Green}" "$(ls "$CACHEDIR"/AMCACHEPATH/ | xargs | _fit )" | _fit + printf "Temporary fallback binaries are in use for the commands below:\n%b%b\033[0m\nInstall them to avoid slow performance.\n" "${Green}" "$(ls "$CACHEDIR"/AMCACHEPATH/ | xargs | _fit )" | _fit printf "%b\n" "$DIVIDING_LINE" for name in $AM_standard_dependencies; do _checksum_on_standard_dependencies & From 365822483f227c260b4426e452c14661ee98f839 Mon Sep 17 00:00:00 2001 From: iVAN <88724353+ivan-hc@users.noreply.github.com> Date: Tue, 5 May 2026 20:45:41 +0200 Subject: [PATCH 15/19] Allow transtaltion of new messages --- APP-MANAGER | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/APP-MANAGER b/APP-MANAGER index e21004dd5..40d359275 100755 --- a/APP-MANAGER +++ b/APP-MANAGER @@ -517,7 +517,7 @@ _checksum_on_standard_dependencies() { dep_sum256_host=$(echo "$deps_sum256_all" | grep "$name-$ARCH-static$" 2>/dev/null | awk '{print $1}') if [ "$dep_sum256_local" != "$dep_sum256_host" ]; then rm -Rf "$CACHEDIR"/AMCACHEPATH/"$name" - _deps_dl && chmod a+x "$CACHEDIR"/AMCACHEPATH/"$name" && printf " - %b, downloaded from https://github.com/ivan-hc/am-utils\n" "$name" + _deps_dl && chmod a+x "$CACHEDIR"/AMCACHEPATH/"$name" && printf $" - %b, downloaded from https://github.com/ivan-hc/am-utils\n" "$name" fi fi } @@ -554,9 +554,9 @@ if [ "$ARCH" = aarch64 ] || [ "$ARCH" = x86_64 ]; then if [ -n "$fallback_binaries_needed" ]; then _online_check printf "%b\n" "$DIVIDING_LINE" - printf "Missing commands will be temporarily downloaded as static binaries:\n\n" | _fit + printf $"Missing commands will be temporarily downloaded as static binaries:\n\n" | _fit for name in $fallback_binaries_needed; do - _deps_dl && chmod a+x "$CACHEDIR"/AMCACHEPATH/"$name" && printf " - %b, downloaded from https://github.com/ivan-hc/am-utils\n" "$name" + _deps_dl && chmod a+x "$CACHEDIR"/AMCACHEPATH/"$name" && printf $" - %b, downloaded from https://github.com/ivan-hc/am-utils\n" "$name" done printf "\n%b\n" "$DIVIDING_LINE" fi @@ -584,7 +584,7 @@ if [ "$ARCH" = aarch64 ] || [ "$ARCH" = x86_64 ]; then deps_sum256_all=$(curl -Ls "$AM_UTILS_SOURCE/$ARCH.sha256sum.txt" 2>/dev/null) if [ -n "$deps_sum256_all" ]; then printf "%b\n" "$DIVIDING_LINE" - printf "Temporary fallback binaries are in use for the commands below:\n%b%b\033[0m\nInstall them to avoid slow performance.\n" "${Green}" "$(ls "$CACHEDIR"/AMCACHEPATH/ | xargs | _fit )" | _fit + printf $"Temporary fallback binaries are in use for the commands below:\n%b%b\033[0m\nInstall them to avoid slow performance.\n" "${Green}" "$(ls "$CACHEDIR"/AMCACHEPATH/ | xargs | _fit )" | _fit printf "%b\n" "$DIVIDING_LINE" for name in $AM_standard_dependencies; do _checksum_on_standard_dependencies & From 833eb97dbe1807c5e985fdad66423d519ca4729d Mon Sep 17 00:00:00 2001 From: iVAN <88724353+ivan-hc@users.noreply.github.com> Date: Tue, 5 May 2026 21:03:13 +0200 Subject: [PATCH 16/19] Update install.am, remove obsolete checks --- modules/install.am | 25 ++----------------------- 1 file changed, 2 insertions(+), 23 deletions(-) diff --git a/modules/install.am b/modules/install.am index 5ff7879c8..235a3bd09 100644 --- a/modules/install.am +++ b/modules/install.am @@ -63,30 +63,18 @@ _check_argument() { } _check_if_optional_dependences_are_needed() { - # Determine generic build utils - app_deps="ar gcc glib-compile-schemas make tar unzip" # Determine if the argument is a script and not something else - if head -c10 ./"$arg" 2>/dev/null | grep -q "^#!"; then - script_content=$(cat ./"$arg") - elif head -c10 ./"$arg" 2>/dev/null | grep -qa '^.ELF....AI$'; then + if head -c10 ./"$arg" 2>/dev/null | grep -qa '^.ELF....AI$'; then printf $"💀 ERROR: this option is ment to handle installation scripts only! \n\n" | _fit printf $" If this AppImage is not in our database, open an issue or a pull request at\n https://github.com/ivan-hc/AM\n\n" | _fit _check_argument return 1 - else + elif ! head -c10 ./"$arg" 2>/dev/null | grep -q "^#!"; then printf $"💀 ERROR: \"$arg\" is not a valid file! \n\n" | _fit printf $"This option is ment to handle installation scripts only! \n\n" | _fit _check_argument return 1 fi - # Determine if this is an AppImage that can be compiled on-the-fly - if grep -qi "^wget.*.sh.*chmod.*&&" ./"$arg"; then - appimage_bulder_script=$(grep "^wget " ./"$arg" | tr '"' '\n' | grep -i "^http" | sed "s/\$APP/$arg/g") - if ! curl --output /dev/null --silent --head --fail "$appimage_bulder_script" 1> /dev/null; then - echo $" 💀 ERROR: cannot create \"$arg\", the builder does not exists" - return 1 - fi - fi # Determine if this script installs a Firefox webapp if grep -q 'ffwa-' ./"$arg"; then ffbrowser=$(find ${PATH//:/ } -maxdepth 1 -name "firefox*" | sort | head -1) @@ -97,15 +85,6 @@ _check_if_optional_dependences_are_needed() { sed -i 's#firefox --class#'"$(echo "$ffbrowser" | xargs -L 1 basename)"' --class#g' ./"$arg" fi fi - # Check missing dependency - for name in $app_deps; do - dependency_name="$name" - [ "$name" = "ar" ] && dependency_name="binutils" - if echo "$script_content" | grep -q "^$name" && ! command -v "$name" >/dev/null 2>&1; then - echo $" 💀 ERROR: cannot install \"$arg\" without \"$dependency_name\"" - return 1 - fi - done } _check_if_script_installs_a_metapackage() { From 1d8c5ec91cfa57314dd36164b6f00604d0589af3 Mon Sep 17 00:00:00 2001 From: iVAN <88724353+ivan-hc@users.noreply.github.com> Date: Wed, 6 May 2026 01:56:54 +0200 Subject: [PATCH 17/19] Update install.am - fix installations in AppMan, it don't require PATH --- modules/install.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/install.am b/modules/install.am index 235a3bd09..009cb0d41 100644 --- a/modules/install.am +++ b/modules/install.am @@ -278,7 +278,7 @@ _ending_the_installation() { } _install_exec_installation_script() { - if [ "$(ls -A "$CACHEDIR"/AMCACHEPATH 2>/dev/null)" ]; then + if [ "$(ls -A "$CACHEDIR"/AMCACHEPATH 2>/dev/null)" ] && [ -n "$SUDOCMD" ]; then $SUDOCMD PATH="$PATH" ./"$arg" else $SUDOCMD ./"$arg" From 3f8ce84211cd3a9161945a1fd5329010fc36f436 Mon Sep 17 00:00:00 2001 From: iVAN <88724353+ivan-hc@users.noreply.github.com> Date: Wed, 6 May 2026 04:10:44 +0200 Subject: [PATCH 18/19] Cache the sha256sum list to improve checksum speed for binaries --- APP-MANAGER | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/APP-MANAGER b/APP-MANAGER index 40d359275..6a8f0d07a 100755 --- a/APP-MANAGER +++ b/APP-MANAGER @@ -1,6 +1,6 @@ #!/usr/bin/env bash -AMVERSION="10.1-12" +AMVERSION="10.1-13" # Determine main repository and branch AMREPO="https://raw.githubusercontent.com/ivan-hc/AM/main" @@ -514,7 +514,7 @@ _online_check() { _checksum_on_standard_dependencies() { if [ -f "$CACHEDIR"/AMCACHEPATH/"$name" ]; then dep_sum256_local=$(sha256sum "$CACHEDIR"/AMCACHEPATH/"$name" 2>/dev/null | awk '{print $1}') - dep_sum256_host=$(echo "$deps_sum256_all" | grep "$name-$ARCH-static$" 2>/dev/null | awk '{print $1}') + dep_sum256_host=$(sort "$AMCACHEDIR/$ARCH.sha256sum.txt" | grep "$name-$ARCH-static$" 2>/dev/null | awk '{print $1}') if [ "$dep_sum256_local" != "$dep_sum256_host" ]; then rm -Rf "$CACHEDIR"/AMCACHEPATH/"$name" _deps_dl && chmod a+x "$CACHEDIR"/AMCACHEPATH/"$name" && printf $" - %b, downloaded from https://github.com/ivan-hc/am-utils\n" "$name" @@ -523,7 +523,7 @@ _checksum_on_standard_dependencies() { } # Use static binaries as a fallback solution in case there are no dependencies -AM_core_dependencies="cat chmod chown curl grep sed wget" +AM_core_dependencies="cat chmod chown curl grep sed wget swapon swapoff chroot" AM_opt_dependencies="7z ar column file md5sum notify-send sha1sum sha256sum sha512sum tar unxz unzip xz xzcat" AM_standard_dependencies="$AM_core_dependencies $AM_opt_dependencies" _deps_dl() { @@ -556,8 +556,9 @@ if [ "$ARCH" = aarch64 ] || [ "$ARCH" = x86_64 ]; then printf "%b\n" "$DIVIDING_LINE" printf $"Missing commands will be temporarily downloaded as static binaries:\n\n" | _fit for name in $fallback_binaries_needed; do - _deps_dl && chmod a+x "$CACHEDIR"/AMCACHEPATH/"$name" && printf $" - %b, downloaded from https://github.com/ivan-hc/am-utils\n" "$name" + _deps_dl && chmod a+x "$CACHEDIR"/AMCACHEPATH/"$name" && printf $" - %b, downloaded from https://github.com/ivan-hc/am-utils\n" "$name" & done + wait printf "\n%b\n" "$DIVIDING_LINE" fi # Remove static binaries and other temporary utilities if related commands are already available in PATH @@ -580,19 +581,24 @@ if [ "$ARCH" = aarch64 ] || [ "$ARCH" = x86_64 ]; then fi # Check binaries integrity if [ "$(ls -A "$CACHEDIR"/AMCACHEPATH 2>/dev/null)" ]; then - if curl --output /dev/null --silent --head --fail https://github.com 1> /dev/null; then - deps_sum256_all=$(curl -Ls "$AM_UTILS_SOURCE/$ARCH.sha256sum.txt" 2>/dev/null) - if [ -n "$deps_sum256_all" ]; then - printf "%b\n" "$DIVIDING_LINE" - printf $"Temporary fallback binaries are in use for the commands below:\n%b%b\033[0m\nInstall them to avoid slow performance.\n" "${Green}" "$(ls "$CACHEDIR"/AMCACHEPATH/ | xargs | _fit )" | _fit - printf "%b\n" "$DIVIDING_LINE" - for name in $AM_standard_dependencies; do - _checksum_on_standard_dependencies & - done - wait + if [ ! -f "$AMCACHEDIR"/"$ARCH".sha256sum.txt ]; then + if curl --output /dev/null --silent --head --fail https://github.com 1> /dev/null; then + deps_sum256_all=$(curl -Ls "$AM_UTILS_SOURCE/$ARCH.sha256sum.txt" 2>/dev/null) + if [ -n "$deps_sum256_all" ]; then + echo "$deps_sum256_all" > "$AMCACHEDIR"/"$ARCH".sha256sum.txt + fi fi + printf "%b\n" "$DIVIDING_LINE" + printf $"Temporary fallback binaries are in use for the commands below:\n%b%b\033[0m\nInstall them to avoid slow performance.\n" "${Green}" "$(ls "$CACHEDIR"/AMCACHEPATH/ | xargs | _fit )" | _fit + printf "%b\n" "$DIVIDING_LINE" + fi + if [ -f "$AMCACHEDIR"/"$ARCH".sha256sum.txt ]; then + for name in $AM_standard_dependencies; do + _checksum_on_standard_dependencies & + done + wait + export PATH="$CACHEDIR"/AMCACHEPATH/:"${PATH}" fi - export PATH="$CACHEDIR"/AMCACHEPATH/:"${PATH}" fi fi From 18475bc4480c2ccf66ed79e683d88502a915fc0d Mon Sep 17 00:00:00 2001 From: iVAN <88724353+ivan-hc@users.noreply.github.com> Date: Wed, 6 May 2026 04:17:43 +0200 Subject: [PATCH 19/19] Remove dependencies I use for my tests --- APP-MANAGER | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/APP-MANAGER b/APP-MANAGER index 6a8f0d07a..f3efc062c 100755 --- a/APP-MANAGER +++ b/APP-MANAGER @@ -523,7 +523,7 @@ _checksum_on_standard_dependencies() { } # Use static binaries as a fallback solution in case there are no dependencies -AM_core_dependencies="cat chmod chown curl grep sed wget swapon swapoff chroot" +AM_core_dependencies="cat chmod chown curl grep sed wget" AM_opt_dependencies="7z ar column file md5sum notify-send sha1sum sha256sum sha512sum tar unxz unzip xz xzcat" AM_standard_dependencies="$AM_core_dependencies $AM_opt_dependencies" _deps_dl() {