{homebrew,syncplay}: avoid /tmp here as well, while unnecessary

This commit is contained in:
Aminda Suomalainen 2026-01-22 09:13:46 +02:00
parent c66ab1e411
commit 89fc6d39e0
Signed by: Mikaela
GPG Key ID: 99392F62BAE30723
2 changed files with 16 additions and 5 deletions

View File

@ -8,8 +8,13 @@ if [ -d /var/roothome ]; then
set -x set -x
export LC_ALL=C.utf8 export LC_ALL=C.utf8
if [ -f "/tmp/brew.$(id -u).$(date -I)" ]; then if ! hash xdg-user-dir 2> /dev/null; then
echo "Homebrew has been patched today. If this is wrong, rm /tmp/brew.$(id -u).$(date -I)" echo "xdg-user-dir is required for my laziness"
exit 1
fi
if [ -f "$(xdg-user-dir RUNTIME)/brew.$(date -I)" ]; then
echo "Homebrew has been patched today. If this is wrong, rm $(xdg-user-dir RUNTIME)/brew.$(date -I)"
else else
if [ ! -d "/home/linuxbrew/.linuxbrew" ]; then if [ ! -d "/home/linuxbrew/.linuxbrew" ]; then
echo "Homebrew not found." echo "Homebrew not found."
@ -19,7 +24,7 @@ if [ -d /var/roothome ]; then
cd /home/linuxbrew/.linuxbrew/bin/ cd /home/linuxbrew/.linuxbrew/bin/
cp /home/linuxbrew/.linuxbrew/bin/brew /home/linuxbrew/.linuxbrew/bin/brew2 cp /home/linuxbrew/.linuxbrew/bin/brew /home/linuxbrew/.linuxbrew/bin/brew2
sed -i 's/pwd\ \-P/pwd/g' /home/linuxbrew/.linuxbrew/bin/brew2 sed -i 's/pwd\ \-P/pwd/g' /home/linuxbrew/.linuxbrew/bin/brew2
touch "/tmp/brew.$(id -u).$(date -I)" touch "$(xdg-user-dir RUNTIME)/brew.$(date -I)"
fi fi
/home/linuxbrew/.linuxbrew/bin/brew2 $@ /home/linuxbrew/.linuxbrew/bin/brew2 $@

View File

@ -5,7 +5,12 @@
set -x set -x
export LC_ALL=C.utf8 export LC_ALL=C.utf8
if [ -f "/tmp/syncplay.$(id -u).$(date -I)" ]; then if ! hash xdg-user-dir 2> /dev/null; then
echo "xdg-user-dir is required for my laziness"
exit 1
fi
if [ -f "$(xdg-user-dir RUNTIME)/syncplay.$(date -I)" ]; then
echo "Syncplay has been touched today" echo "Syncplay has been touched today"
else else
# If syncplay doesn't exist, get it # If syncplay doesn't exist, get it
@ -36,7 +41,7 @@ else
pip3 install pip --upgrade pip3 install pip --upgrade
pip3 install -r requirements.txt --upgrade pip3 install -r requirements.txt --upgrade
pip3 install -r requirements_gui.txt --upgrade pip3 install -r requirements_gui.txt --upgrade
touch /tmp/syncplay.$(id -u).$(date -I) touch $(xdg-user-dir RUNTIME)/syncplay.$(date -I)
fi fi
# finally launch the syncplay with any flags specified # finally launch the syncplay with any flags specified
@ -44,5 +49,6 @@ fi
~/src/github.com/syncplay/syncplay/syncplayClient.py "$@" ~/src/github.com/syncplay/syncplay/syncplayClient.py "$@"
# my syncplay launcher says this is a terminal app, so in case something goes # my syncplay launcher says this is a terminal app, so in case something goes
# wrong, let it stay open for a moment for me to see what. # wrong, let it stay open for a moment for me to see what.
echo ""
sleep 5 sleep 5
set +x set +x