Skip to content

Commit 670a971

Browse files
author
Damian Rouson
committed
Completed patched-trunk-install.sh
1 parent 8653d3a commit 670a971

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

developer-scripts/patched-trunk-install.sh

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,20 @@ function usage()
1515

1616
patch_file="${1}"
1717

18+
function set_absolute_path()
19+
{
20+
: "${1?'set_absolute_path: no argument provided'}"
21+
22+
arg=${1}
23+
first_character=$(echo "${arg}" | cut -c1-1)
24+
if [[ "${first_character}" == "/" ]]; then
25+
absolute_path="${arg}"
26+
else
27+
absolute_path="${PWD%%/}${arg}"
28+
fi
29+
}
30+
set_absolute_path "${patch_file}"
31+
1832
# Exit on error or use of an unset variable:
1933
set -o errexit
2034
set -o nounset
@@ -106,12 +120,13 @@ install_if_missing flex
106120
### Install the prerequisites that must be built from source ###
107121

108122
# Download and build the GCC trunk:
109-
./install.sh --package gcc --install-branch trunk --only-download
123+
echo "Downloading the GCC trunk."
124+
./install.sh --only-download --package gcc --install-branch trunk
110125

111126
# Patch the GCC trunk and rebuild
112-
echo "Patching the GCC source."
127+
echo "Patching the GCC source using ${absolute_path}."
113128
pushd prerequisites/downloads/trunk
114-
patch -p0 < "${patch_file}"
129+
patch -p0 < "${absolute_path}"
115130
popd
116131

117132
# Build the patched GCC trunk

0 commit comments

Comments
 (0)