diff options
author | Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> | 2012-01-16 23:36:42 +0100 |
---|---|---|
committer | Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> | 2012-01-16 23:36:42 +0100 |
commit | b86899a341a756088e065edbf9c63c6187ff3fb6 (patch) | |
tree | ea1711c1eed7dd7149565ffbbb8a0a51b829b39c /scripts | |
parent | b03575409e7dd7911cdd4bebb8637826e34ddc12 (diff) | |
download | crosstool-ng-b86899a341a756088e065edbf9c63c6187ff3fb6.tar.gz crosstool-ng-b86899a341a756088e065edbf9c63c6187ff3fb6.tar.bz2 crosstool-ng-b86899a341a756088e065edbf9c63c6187ff3fb6.zip |
scripts: fix tools override
The tools found by the new autostuff configure can contain arguments,
for example: grep -E
This needs separating the paths set for the Makfile from the paths
set for the scripts.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/addToolVersion.sh | 4 | ||||
-rw-r--r-- | scripts/crosstool-NG.sh.in | 6 | ||||
-rwxr-xr-x | scripts/patch-renumber.sh | 4 | ||||
-rw-r--r-- | scripts/saveSample.sh.in | 2 | ||||
-rwxr-xr-x | scripts/showSamples.sh | 2 | ||||
-rw-r--r-- | scripts/showTuple.sh.in | 2 |
6 files changed, 11 insertions, 9 deletions
diff --git a/scripts/addToolVersion.sh b/scripts/addToolVersion.sh index c394d245..b82d4857 100755 --- a/scripts/addToolVersion.sh +++ b/scripts/addToolVersion.sh @@ -7,10 +7,10 @@ myname="$0" # Parse the tools' paths configuration # It is expected that this script is only to be run from the # source directory of crosstool-NG, so it is trivial to find -# paths.mk (we can't use ". paths.mk", as POSIX states that +# paths.sh (we can't use ". paths.sh", as POSIX states that # $PATH should be searched for, and $PATH most probably doe # not include "."), hence the "./". -. "./paths.mk" +. "./paths.sh" doHelp() { cat <<-EOF diff --git a/scripts/crosstool-NG.sh.in b/scripts/crosstool-NG.sh.in index 057559f2..2c520479 100644 --- a/scripts/crosstool-NG.sh.in +++ b/scripts/crosstool-NG.sh.in @@ -78,11 +78,13 @@ CT_TestOrAbort "The CONFIG_SHELL '${CT_CONFIG_SHELL}' is not valid" -f "${CT_CON CT_TOOLS_OVERIDE_DIR="${CT_WORK_DIR}/tools" CT_DoLog DEBUG "Creating bin-override for tools in '${CT_TOOLS_OVERIDE_DIR}'" CT_DoExecLog DEBUG mkdir -p "${CT_TOOLS_OVERIDE_DIR}/bin" -cat "${CT_LIB_DIR}/paths.mk" |while read trash line; do +cat "${CT_LIB_DIR}/paths.sh" |while read trash line; do tool="${line%%=*}" path="${line#*=}" CT_DoLog DEBUG "Creating script-override for '${tool}' -> '${path}'" - printf "#${BANG}${CT_CONFIG_SHELL}\nexec '${path}' \"\${@}\"\n" >"${CT_TOOLS_OVERIDE_DIR}/bin/${tool}" + # Note: we need to supress the " in the path because + # there can be arguments in there (thanks autostuff...) + printf "#${BANG}${CT_CONFIG_SHELL}\nexec ${path//\"/} \"\${@}\"\n" >"${CT_TOOLS_OVERIDE_DIR}/bin/${tool}" CT_DoExecLog ALL chmod 700 "${CT_TOOLS_OVERIDE_DIR}/bin/${tool}" done export PATH="${CT_TOOLS_OVERIDE_DIR}/bin:${PATH}" diff --git a/scripts/patch-renumber.sh b/scripts/patch-renumber.sh index 3604df57..c56473b4 100755 --- a/scripts/patch-renumber.sh +++ b/scripts/patch-renumber.sh @@ -7,10 +7,10 @@ myname="$0" # Parse the tools' paths configuration # It is expected that this script is only to be run from the # source directory of crosstool-NG, so it is trivial to find -# paths.mk (we can't use ". paths.mk", as POSIX states that +# paths.sh (we can't use ". paths.sh", as POSIX states that # $PATH should be searched for, and $PATH most probably doe # not include "."), hence the "./". -. "./paths.mk" +. "./paths.sh" doUsage() { cat <<_EOF_ diff --git a/scripts/saveSample.sh.in b/scripts/saveSample.sh.in index de3ef311..8967d54a 100644 --- a/scripts/saveSample.sh.in +++ b/scripts/saveSample.sh.in @@ -9,7 +9,7 @@ # - info about who reported the sample # Parse the tools' paths configuration -. "${CT_LIB_DIR}/paths.mk" +. "${CT_LIB_DIR}/paths.sh" # We'll need the stdout later, save it exec 7>&1 diff --git a/scripts/showSamples.sh b/scripts/showSamples.sh index 777eb96b..774794b1 100755 --- a/scripts/showSamples.sh +++ b/scripts/showSamples.sh @@ -5,7 +5,7 @@ # the versions of the main tools # Use tools discovered by ./configure -. "${CT_LIB_DIR}/paths.mk" +. "${CT_LIB_DIR}/paths.sh" [ "$1" = "-v" ] && opt="$1" && shift [ "$1" = "-w" ] && opt="$1" && shift diff --git a/scripts/showTuple.sh.in b/scripts/showTuple.sh.in index 9753bb52..074e5507 100644 --- a/scripts/showTuple.sh.in +++ b/scripts/showTuple.sh.in @@ -4,7 +4,7 @@ # - the .config file # Parse the tools' paths configuration -. "${CT_LIB_DIR}/paths.mk" +. "${CT_LIB_DIR}/paths.sh" # We'll need the stdout later, save it exec 7>&1 |