aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2023-11-27 16:17:55 -0300
committerSilvio Rhatto <rhatto@riseup.net>2023-11-27 16:17:55 -0300
commitf3e611896029c62baa9d374918c77fc61b2c922b (patch)
treeaa8ab5bc626ba8697fa0247efc4bfbe45bd8ddfd
parentf32f5d5a4d28dfaeeb5c109cd5a3caac54e74c46 (diff)
downloadtrashman-f3e611896029c62baa9d374918c77fc61b2c922b.tar.gz
trashman-f3e611896029c62baa9d374918c77fc61b2c922b.tar.bz2
Fix: hoarder: tor-browser: use different folder schemes for the alpha and the stable
-rwxr-xr-xshare/hoarder/tor-browser/unix/linux/install42
1 files changed, 30 insertions, 12 deletions
diff --git a/share/hoarder/tor-browser/unix/linux/install b/share/hoarder/tor-browser/unix/linux/install
index 393af13..2503eeb 100755
--- a/share/hoarder/tor-browser/unix/linux/install
+++ b/share/hoarder/tor-browser/unix/linux/install
@@ -57,21 +57,39 @@ rm -rf $WORK/.gnupg || exi
# Unpack
tar xvf $WORK/$FILE -C $WORK || exit 1
+# Prepare the destination folder
+mkdir -p $HOME/.local/share || exit 1
+
# Install
-mkdir -p $HOME/.local/share || exit 1
-cd $HOME/.local/share || exit 1
-rm -rf $APP/$ARCH/$VERSION || exit 1
-mkdir -p $APP/$ARCH || exit 1
-mv $WORK/tor-browser $APP/$ARCH/$VERSION || exit 1
-rm -rf $WORK || exit 1
-rm -rf $APP/$ARCH/latest || exit 1
-cd $APP/$ARCH && ln -s $VERSION latest || exit 1
+if [ "$APP" == "tor-browser" ]; then
+ # Always use the "latest" folder. Tor Browser has a self-update mechanism that
+ # will ensure that this installation is always the latest.
+ mkdir -p $HOME/.local/share || exit 1
+ cd $HOME/.local/share || exit 1
+ rm -rf $APP/$ARCH/latest || exit 1
+ mkdir -p $APP/$ARCH || exit 1
+ mv $WORK/tor-browser $APP/$ARCH/latest || exit 1
+ rm -rf $WORK || exit 1
+elif [ "$APP" == "tor-browser-alpha" ]; then
+ # Since this is an alpha version, use per-version folders
+ cd $HOME/.local/share || exit 1
+ rm -rf $APP/$ARCH/$VERSION || exit 1
+ mkdir -p $APP/$ARCH || exit 1
+ mv $WORK/tor-browser $APP/$ARCH/$VERSION || exit 1
+ rm -rf $WORK || exit 1
+ rm -rf $APP/$ARCH/latest || exit 1
+ cd $APP/$ARCH && ln -s $VERSION latest || exit 1
+fi
# Create symlink to scripts
-mkdir -p $HOME/.local/bin || exit 1
-cd $HOME/.local/bin || exit 1
-ln -sf $HOME/.local/share/$APP/$ARCH/latest/Browser/start-tor-browser $APP-${ARCH} || exit 1
-ln -sf $HOME/.local/share/$APP/$ARCH/$VERSION/Browser/start-tor-browser $APP-${ARCH}-${VERSION} || exit 1
+mkdir -p $HOME/.local/bin || exit 1
+cd $HOME/.local/bin || exit 1
+ln -sf $HOME/.local/share/$APP/$ARCH/latest/Browser/start-tor-browser $APP-${ARCH} || exit 1
+
+# Additional symlink for the alpha version
+if [ "$APP" == "tor-browser-alpha" ]; then
+ ln -sf $HOME/.local/share/$APP/$ARCH/$VERSION/Browser/start-tor-browser $APP-${ARCH}-${VERSION} || exit 1
+fi
# Remove old symlink to the Tor Browser script
rm -f $HOME/.local/bin/$APP