Skip to content

Commit

Permalink
Improve variant support for tup.
Browse files Browse the repository at this point in the history
Now gcc-rtags-wrapper.sh finds the tup variant directory by searching
for the tup.config file instead of using a name pattern.
  • Loading branch information
petersohn committed Dec 30, 2014
1 parent 221baa6 commit cda5129
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion bin/gcc-rtags-wrapper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,34 @@ if [ "$RTAGS_GCC_WRAPPER" = "1" ]; then
fi

# tup support

function eliminateTupVariant
{
topDir="$PWD"
while [ "$PWD" != / -a ! -e ../.tup -a ! -e .tup ]; do
cd ..
done

if [ -e tup.config ]; then
configDir=$PWD
cd ..
echo "$PWD${topDir#$configDir}"
else
echo "$topDir"
fi
}

pushd . >/dev/null
if pwd | grep --quiet /.tup/mnt/@tupjob-; then
# get out from the tup virtual filesystem
cd "/${PWD#*/.tup/mnt/@tupjob-*/}"
cd "$(pwd | sed 's|/build-[^/]*/|/|')"

# get out from the tup variant directory (if any)
cd "$(eliminateTupVariant)"
fi

# tup support end

rc=$(which rc)
for i in $(which -a "$(basename "$0")"); do
filename="$i"
Expand Down

0 comments on commit cda5129

Please sign in to comment.