From 73fe1ef6f70193c851c210bfea3da311cd46fb5e Mon Sep 17 00:00:00 2001 From: David Young Date: Fri, 20 Mar 2026 20:59:23 -0600 Subject: [PATCH] fixes --- compile.conf | 1 + install-compiled.sh | 32 +++++++++++++++++++------------- 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/compile.conf b/compile.conf index 6918eb4..07e40ec 100644 --- a/compile.conf +++ b/compile.conf @@ -2,6 +2,7 @@ version=0.1 wget=http://www.cantab.net/users/john.wiseman/Downloads/QtTermSource.zip install=$HOME/.local/bin/QtTermTCP +gui=true steps=qmake, make, mv QtTermTCP $HOME/.local/bin/ [Kiwix-Desktop] diff --git a/install-compiled.sh b/install-compiled.sh index e70fa09..9737de4 100755 --- a/install-compiled.sh +++ b/install-compiled.sh @@ -9,14 +9,17 @@ VERSION_FILE="$HOME/.local/state/HamPack/.installed_versions" # Get the installed version of an app get_installed_version() { local app="$1" + local gui="$2" - # Try --version flag first - if command -v "$app" &> /dev/null; then - local ver - ver=$("$app" --version 2>&1 | grep -oP '\d+\.\d+[\.\d]*' | head -n1) - if [ -n "$ver" ]; then - echo "$ver" - return + # Skip --version check for GUI apps as it would launch them + if [ "$gui" != "true" ]; then + if command -v "$app" &> /dev/null; then + local ver + ver=$("$app" --version 2>&1 | grep -oP '\d+\.\d+[\.\d]*' | head -n1) + if [ -n "$ver" ]; then + echo "$ver" + return + fi fi fi @@ -63,6 +66,7 @@ needs_update() { local app="$1" local install_path="$2" local latest="$3" + local gui="$4" # Not installed at all if ! command -v "$app" &> /dev/null && [ ! -f "$install_path" ]; then @@ -71,7 +75,7 @@ needs_update() { fi local installed - installed=$(get_installed_version "$app") + installed=$(get_installed_version "$app" "$gui") if [ "$installed" = "unknown" ]; then if ask_user_proceed "$app" "$latest"; then @@ -216,6 +220,7 @@ process_app() { local steps="$5" local version="$6" local desktop="$7" + local gui="$8" echo "" echo "=== $app ===" @@ -235,7 +240,7 @@ process_app() { echo " Skipping $app." return fi - elif ! needs_update "$app" "$install_path" "$version"; then + elif ! needs_update "$app" "$install_path" "$version" "$gui"; then return fi @@ -248,17 +253,17 @@ process_app() { # Parse compile.conf and process each app process_conf() { - local app="" git_url="" wget_url="" install_path="" steps="" version="" desktop="" + local app="" git_url="" wget_url="" install_path="" steps="" version="" desktop="" gui="" while IFS= read -r line || [ -n "$line" ]; do [[ -z "$line" || "$line" == \#* ]] && continue if [[ "$line" =~ ^\[(.+)\]$ ]]; then if [ -n "$app" ]; then - process_app "$app" "$git_url" "$wget_url" "$install_path" "$steps" "$version" "$desktop" + process_app "$app" "$git_url" "$wget_url" "$install_path" "$steps" "$version" "$desktop" "$gui" fi app="${BASH_REMATCH[1]}" - git_url="" wget_url="" install_path="" steps="" version="" desktop="" + git_url="" wget_url="" install_path="" steps="" version="" desktop="" gui="" continue fi @@ -273,13 +278,14 @@ process_conf() { steps) steps="$value" ;; version) version="$value" ;; desktop) desktop="$value" ;; + gui) gui="$value" ;; esac done < "$CONF_FILE" # Process the last app in the file if [ -n "$app" ]; then - process_app "$app" "$git_url" "$wget_url" "$install_path" "$steps" "$version" "$desktop" + process_app "$app" "$git_url" "$wget_url" "$install_path" "$steps" "$version" "$desktop" "$gui" fi }