Skip to content

Commit

Permalink
Fixup incorrect ordering of directories in toll and library paths.
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/tools/make/trunk@27167 72102866-910b-0410-8b05-ffd578937521
  • Loading branch information
rfm committed Nov 28, 2008
1 parent 667e85d commit 52f5827
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
2008-11-28 Richard Frith-Macdonald <[email protected]>

* print_unique_pathlist.sh: Reverse the order of the path fragments
so that, when the caller iterates through them and prepends them to
other paths, they end up prepended in the correct order.

2008-11-13 Richard Frith-Macdonald <[email protected]>

* Documentation/README.MingW: Change instructions to use libffi
Expand Down
23 changes: 23 additions & 0 deletions print_unique_pathlist.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@
# from Win32 to Unix style), and prints the 4 paths separated by ':',
# removing duplicates.

# The order of the paths printed is the REVERSE of the order in which
# they were supplied, this is so that code which iterates through them
# prepending them to a PATH will leave them in the correct order in
# that path.

# GNUSTEP_MAKEFILES needs to be defined when you execute this script.

if [ ! $# -eq 5 ]; then
Expand Down Expand Up @@ -79,4 +84,22 @@ if [ "$GS_MAKE_PATH_4" != "$GS_MAKE_PATH_1" ]; then
fi
fi

# Now reverse the order of the path fragments so that the calling code
# can iterate through them and prepend each in turn to another path.
old_IFS="$IFS"
IFS=:
reversed=""
for dir in $GS_MAKE_RESULT; do
path_fragment="$dir"
if [ -z "$reversed" ]; then
reversed="$path_fragment"
else
reversed="$path_fragment:$reversed"
fi
done
GS_MAKE_RESULT="$reversed"
IFS="$old_IFS"
unset reversed
unset old_IFS

echo "$GS_MAKE_RESULT"

0 comments on commit 52f5827

Please sign in to comment.