mirror of
https://github.com/narrrl/proton-drive-linux.git
synced 2026-11-04 00:47:00 +01:00
Removing the package left the user service running from the deleted binary, with ~/ProtonDrive still mounted. A user who then deleted the folder to clean up had every file in it moved to the Proton Drive trash, as any delete through the mount is. The .deb (prerm on remove), the .rpm (%preun on erase) and the Arch packages (pre_remove) now stop proton-drive.service for every user with a running user manager, through runuser with that user's XDG_RUNTIME_DIR, so no systemd-machined is needed. Upgrades are left alone. Queued writes stay in the state directory for a later install. The pacman install script lives once in packaging/ and the AUR directories link it; push.sh copies its content into each AUR repository. The uninstall guide now warns not to delete the mount point while the service runs. Reported on Reddit by a user who restored the files from the trash.
39 lines
1.4 KiB
Bash
Executable File
39 lines
1.4 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Publish the packages in this directory to their AUR repositories.
|
|
#
|
|
# Usage: ./push.sh [pkgbase ...] (default: all three)
|
|
# MESSAGE="..." ./push.sh (custom commit message)
|
|
set -euo pipefail
|
|
|
|
cd "$(dirname "$(readlink -f "$0")")"
|
|
|
|
packages=("$@")
|
|
if [[ ${#packages[@]} -eq 0 ]]; then
|
|
packages=(proton-drive-for-linux proton-drive-for-linux-git proton-drive-for-linux-bin)
|
|
fi
|
|
|
|
workdir="$(mktemp -d)"
|
|
trap 'rm -rf "$workdir"' EXIT
|
|
|
|
for pkg in "${packages[@]}"; do
|
|
test -f "$pkg/PKGBUILD" || { echo "no such package: $pkg" >&2; exit 1; }
|
|
|
|
# A fresh clone every time: the AUR repository, not this checkout, is what the
|
|
# commit history has to build on.
|
|
git -c init.defaultBranch=master clone -q "ssh://aur@aur.archlinux.org/$pkg.git" "$workdir/$pkg"
|
|
# proton-drive.install is a link into packaging/; install copies its content.
|
|
install -m644 "$pkg/PKGBUILD" "$pkg/.SRCINFO" "$pkg/.gitignore" "$pkg/LICENSE" \
|
|
"$pkg/proton-drive.install" "$workdir/$pkg/"
|
|
|
|
git -C "$workdir/$pkg" add -f PKGBUILD .SRCINFO .gitignore LICENSE proton-drive.install
|
|
if git -C "$workdir/$pkg" diff --cached --quiet; then
|
|
echo "$pkg: no changes"
|
|
continue
|
|
fi
|
|
|
|
version="$(sed -n 's/^\tpkgver = //p' "$pkg/.SRCINFO" | head -n1)"
|
|
git -C "$workdir/$pkg" commit -q -m "${MESSAGE:-Update to $version}"
|
|
git -C "$workdir/$pkg" push -q origin HEAD:master
|
|
echo "$pkg: pushed ${MESSAGE:-$version}"
|
|
done
|