diff --git a/packages.conf b/packages.conf index f6e1603..cdbb82b 100644 --- a/packages.conf +++ b/packages.conf @@ -19,7 +19,7 @@ UTILITIES=( hamlib jdk-openjdk jq # patch-potacat.sh - libappindicator-gtk3 + libappindicator libkiwix libtorrent-rasterbar libnotify @@ -48,7 +48,6 @@ UTILITIES=( xdg-utils xdotool zim-tools - zimwriterfs ) # Ham applications diff --git a/tests/update.bats b/tests/update.bats index 86ca2e2..1214f21 100644 --- a/tests/update.bats +++ b/tests/update.bats @@ -65,9 +65,12 @@ setup() { @test "update removes stale state from older HamPack versions" { mkdir -p "$HAMPACK_STATE" printf 'Kiwix-Desktop=2.75.1\nkiwix-desktop=2.5.1\nKiwix-Tools=3.8.2\n' > "$HAMPACK_STATE/.installed_versions" + mark_installed $(all_hampack_packages) + printf 'fldigi\nlibappindicator-gtk3\nzim-tools\nzimwriterfs\n' > "$HAMPACK_STATE/installed-packages" touch "$HOME/.local/bin/hampackupdate" run bash "$REPO/update.sh" [ "$(cat "$HAMPACK_STATE/.installed_versions")" = "kiwix-desktop=2.5.1" ] + [ "$(cat "$HAMPACK_STATE/installed-packages")" = "$(printf 'fldigi\nlibappindicator\nzim-tools')" ] [ ! -e "$HOME/.local/bin/hampackupdate" ] grep -qx "sudo rm -f /etc/sudoers.d/hampack" "$STUB_LOG" } diff --git a/update.sh b/update.sh index 0975645..e7e0e2d 100644 --- a/update.sh +++ b/update.sh @@ -23,6 +23,14 @@ step() { fi } +# Rename a package in HamPack's record of packages it installed +rename_recorded_package() { + local list="$HAMPACK_STATE/installed-packages" + grep -qxF "$1" "$list" 2> /dev/null || return 0 + grep -vxF "$1" "$list" > "$list.tmp" + mv -f "$list.tmp" "$list" && record_installed installed-packages "$2" +} + remove_stale_files() { # The HamPack GUI app (a Go program) was removed, along with its source and build hook rm -f "$HOME/.local/bin/hampack" @@ -40,6 +48,11 @@ remove_stale_files() { # Versions recorded under app names HamPack no longer uses forget_version Kiwix-Desktop forget_version Kiwix-Tools + # Packages recorded under names only provided by another package, which + # hampackremove can't match with what's installed. zim-tools provides + # zimwriterfs, and was recorded with it + rename_recorded_package libappindicator-gtk3 libappindicator + rename_recorded_package zimwriterfs zim-tools # Build directories from before builds used a private temporary directory rm -rf /tmp/hampack-build /tmp/windowsapps 2> /dev/null # The passwordless sudoers file the old installer used, if a killed install left it behind