From 755a3ac60fda331eaf3dce1539967bc286daa6fb Mon Sep 17 00:00:00 2001 From: Aminda Suomalainen Date: Tue, 24 Jun 2025 17:40:07 +0300 Subject: [PATCH] homebrew: bypass the patching and all if not on Fedora Atomic --- bash/usr-local-bin/homebrew | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/bash/usr-local-bin/homebrew b/bash/usr-local-bin/homebrew index d89c7eb..d27ee24 100755 --- a/bash/usr-local-bin/homebrew +++ b/bash/usr-local-bin/homebrew @@ -4,22 +4,26 @@ # Based on the syncplay script in this folder and the patching idea is from # https://github.com/orgs/Homebrew/discussions/1282#discussioncomment-1281288 -set -x -export LC_ALL=C.utf8 +if [ -d /var/roothome ]; then + set -x + export LC_ALL=C.utf8 -if [ -f "/tmp/brew.$(id -u).$(date -I)" ]; then - echo "Homebrew has been patched today. If this is wrong, rm /tmp/brew.$(id -u).$(date -I)" -else - if [ ! -d "/home/linuxbrew/.linuxbrew" ]; then - echo "Homebrew not found." - exit 1 + if [ -f "/tmp/brew.$(id -u).$(date -I)" ]; then + echo "Homebrew has been patched today. If this is wrong, rm /tmp/brew.$(id -u).$(date -I)" + else + if [ ! -d "/home/linuxbrew/.linuxbrew" ]; then + echo "Homebrew not found." + exit 1 + fi + + cd /home/linuxbrew/.linuxbrew/bin/ + cp brew brew2 + sed -i 's/pwd\ \-P/pwd/g' brew2 + touch "/tmp/brew.$(id -u).$(date -I)" fi - cd /home/linuxbrew/.linuxbrew/bin/ - cp brew brew2 - sed -i 's/pwd\ \-P/pwd/g' brew2 - touch "/tmp/brew.$(id -u).$(date -I)" + env brew2 $@ + set +x +else + env brew $@ fi - -env brew2 $@ -set +x