mirror of
https://github.com/narrrl/proton-drive-linux.git
synced 2026-11-22 18:33:31 +01:00
Places now draws the proton-map-rs basemap that Proton Gallery uses: seas by depth, lakes, rivers, built-up areas, borders and town names, in light and dark. Tiles render on two worker threads into the existing tile layer, so caching, ancestor stand-ins and density restarts work as before. Opening Places sends no request. The OpenFreeMap street map stays opt-in and replaces the basemap while it is turned on. Without the basemap file the map falls back to the coarse Natural Earth outlines. scripts/fetch-basemap.sh downloads basemap-v1.pmtiles and checks it against a pinned SHA-256. The deb, rpm, tarball, local and AUR PKGBUILDs, COPR spec and Nix package install it to /usr/share/proton-drive-linux. PDFS_BASEMAP points the app at another copy. The new credit and preference text is translated in every catalog.
71 lines
3.5 KiB
Bash
Executable File
71 lines
3.5 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Check a release tarball: install it into a throwaway home, check that every
|
|
# file landed with its paths rewritten and that the programs run, update it in
|
|
# place, then uninstall and check nothing is left. Touches no real home and no
|
|
# systemd (--no-service).
|
|
#
|
|
# usage: packaging/tarball/test.sh <tarball>
|
|
set -euo pipefail
|
|
|
|
if [ $# -ne 1 ]; then
|
|
echo "usage: $0 <tarball>" >&2
|
|
exit 2
|
|
fi
|
|
tarball="$(cd "$(dirname "$1")" && pwd)/$(basename "$1")"
|
|
work="$(mktemp -d)"
|
|
trap 'rm -rf "$work"' EXIT
|
|
|
|
fail() { echo "FAIL: $*" >&2; exit 1; }
|
|
|
|
tar -xzf "$tarball" -C "$work"
|
|
src="$(find "$work" -mindepth 1 -maxdepth 1 -type d -name 'proton-drive-linux-*')"
|
|
[ -x "$src/install.sh" ] || fail "no install.sh in the tarball"
|
|
|
|
export HOME="$work/home" XDG_CONFIG_HOME="$work/home/.config"
|
|
mkdir -p "$HOME"
|
|
prefix="$HOME/.local"
|
|
"$src/install.sh" --no-service --force >"$work/install.log" 2>&1 ||
|
|
{ cat "$work/install.log" >&2; fail "install.sh failed"; }
|
|
|
|
for exe in pdfs pdfs-app pdfs-tray pdfs-prompt; do
|
|
[ -x "$prefix/bin/$exe" ] || fail "$exe was not installed"
|
|
done
|
|
"$prefix/bin/pdfs" --version >/dev/null || fail "pdfs does not run"
|
|
app="$prefix/share/applications/io.narl.proton-drive-linux.desktop"
|
|
tray="$XDG_CONFIG_HOME/autostart/io.narl.proton-drive-linux-tray.desktop"
|
|
unit="$XDG_CONFIG_HOME/systemd/user/proton-drive.service"
|
|
grep -qx "Exec=\"$prefix/bin/pdfs-app\"" "$app" || fail "the app's Exec= was not rewritten: $(grep ^Exec= "$app")"
|
|
grep -qx "Exec=\"$prefix/bin/pdfs-tray\"" "$tray" || fail "the tray's Exec= was not rewritten: $(grep ^Exec= "$tray")"
|
|
grep -qx "ExecStart=\"$prefix/bin/pdfs\" daemon" "$unit" || fail "ExecStart= was not rewritten: $(grep ^ExecStart= "$unit")"
|
|
[ -f "$prefix/share/locale/de/LC_MESSAGES/pdfs.mo" ] || fail "no translations"
|
|
[ -f "$prefix/share/icons/hicolor/scalable/apps/io.narl.proton-drive-linux.svg" ] || fail "no icon"
|
|
[ -f "$prefix/share/bash-completion/completions/pdfs" ] || fail "no bash completion"
|
|
[ -f "$prefix/share/proton-drive-linux/basemap-v1.pmtiles" ] || fail "no Places basemap"
|
|
[ ! -e "$prefix/share/proton-drive-linux/managed-updates" ] || fail "the update check must stay on offer"
|
|
uninstaller="$prefix/share/proton-drive-linux/install.sh"
|
|
[ -x "$uninstaller" ] || fail "install.sh was not kept for --uninstall"
|
|
|
|
# An update from the same tarball leaves the same files.
|
|
before="$(cd "$work/home" && find . -type f | sort)"
|
|
"$src/install.sh" --no-service --force >"$work/update.log" 2>&1 ||
|
|
{ cat "$work/update.log" >&2; fail "updating failed"; }
|
|
after="$(cd "$work/home" && find . -type f | sort)"
|
|
[ "$before" = "$after" ] || fail "an update changed the set of files: $(diff <(echo "$before") <(echo "$after"))"
|
|
|
|
# A file an older version installed and this one does not is removed.
|
|
stale="$prefix/share/locale/xx/LC_MESSAGES/pdfs.mo"
|
|
mkdir -p "$(dirname "$stale")" && : >"$stale"
|
|
echo "$stale" >>"$prefix/share/proton-drive-linux/installed-files"
|
|
"$src/install.sh" --no-service --force >/dev/null 2>&1
|
|
[ ! -e "$stale" ] || fail "a file the new version does not ship was left behind"
|
|
|
|
# Settings are not the installer's: uninstalling keeps them.
|
|
mkdir -p "$XDG_CONFIG_HOME/proton-drive-linux"
|
|
echo '{}' >"$XDG_CONFIG_HOME/proton-drive-linux/config.json"
|
|
"$uninstaller" --uninstall --no-service >"$work/uninstall.log" 2>&1 ||
|
|
{ cat "$work/uninstall.log" >&2; fail "uninstall failed"; }
|
|
left="$(cd "$work/home" && find . -type f | sort)"
|
|
[ "$left" = "./.config/proton-drive-linux/config.json" ] || fail "uninstall left files behind: $left"
|
|
|
|
echo "tarball OK: $(basename "$tarball")"
|