* [meta-mingw][PATCH] classes/toolchain-scripts-mingw32: Fix bad cmd flag
@ 2019-02-20 21:34 Joshua Watt
2019-02-21 11:29 ` Burton, Ross
0 siblings, 1 reply; 2+ messages in thread
From: Joshua Watt @ 2019-02-20 21:34 UTC (permalink / raw)
To: yocto
The command to properly set the exit code at the end of the toolchain
environment was using the correct flag delimiter '/', but the code to
coerce all the unix-style paths to windows paths was incorrectly
changing this to a '\'. This worked find in wines cmd, but on an actual
Windows host, this caused cmd to wait indefinitely. Fix this by
appending the command after the path separators are coerced.
Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
---
classes/toolchain-scripts-mingw32.bbclass | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/classes/toolchain-scripts-mingw32.bbclass b/classes/toolchain-scripts-mingw32.bbclass
index 32493d7..0afbf7d 100644
--- a/classes/toolchain-scripts-mingw32.bbclass
+++ b/classes/toolchain-scripts-mingw32.bbclass
@@ -38,6 +38,17 @@ toolchain_create_sdk_env_script_sdkmingw32 () {
# Change unix '/' to Win32 '\'
sed -e 's,/,\\,g' -i $script
+ # set has some annoying properties:
+ # 1) If it is successful %ERRORLEVEL% is unchanged (as opposed to being set
+ # to 0 to indicate success)
+ # 2) Making an assignment like "set A=" is considered an error and sets
+ # %ERRORLEVEL% to 1.
+ #
+ # Practically, this means that if any of the set calls make an empty
+ # assignment that error will be propagated. To prevent this, a command is
+ # run to ensure that the "exit code" of this script is 0
+ echo "@%COMSPEC% /C exit 0 > NUL" >> $script
+
# Make the file windows friendly...
awk 'sub("$", "\r")' $script > $script.new
mv $script.new $script
@@ -81,17 +92,6 @@ toolchain_shared_env_script_sdkmingw32 () {
FOR %%x IN (%OECORE_NATIVE_SYSROOT%\\environment-setup.d\\*.bat) DO call "%%x"
)
EOF
-
- # set has some annoying properties:
- # 1) If it is successful %ERRORLEVEL% is unchanged (as opposed to being set
- # to 0 to indicate success)
- # 2) Making an assignment like "set A=" is considered an error and sets
- # %ERRORLEVEL% to 1.
- #
- # Practically, this means that if any of the set calls make an empty
- # assignment that error will be propagated. To prevent this, a command is
- # run to ensure that the "exit code" of this script is 0
- echo "@%COMSPEC% /C exit 0 > NUL" >> $script
}
toolchain_create_sdk_siteconfig_append_sdkmingw32 () {
--
2.20.1
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [meta-mingw][PATCH] classes/toolchain-scripts-mingw32: Fix bad cmd flag
2019-02-20 21:34 [meta-mingw][PATCH] classes/toolchain-scripts-mingw32: Fix bad cmd flag Joshua Watt
@ 2019-02-21 11:29 ` Burton, Ross
0 siblings, 0 replies; 2+ messages in thread
From: Burton, Ross @ 2019-02-21 11:29 UTC (permalink / raw)
To: Joshua Watt; +Cc: Yocto-mailing-list
+1, feel free to push.
Ross
On Wed, 20 Feb 2019 at 21:35, Joshua Watt <jpewhacker@gmail.com> wrote:
>
> The command to properly set the exit code at the end of the toolchain
> environment was using the correct flag delimiter '/', but the code to
> coerce all the unix-style paths to windows paths was incorrectly
> changing this to a '\'. This worked find in wines cmd, but on an actual
> Windows host, this caused cmd to wait indefinitely. Fix this by
> appending the command after the path separators are coerced.
>
> Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
> ---
> classes/toolchain-scripts-mingw32.bbclass | 22 +++++++++++-----------
> 1 file changed, 11 insertions(+), 11 deletions(-)
>
> diff --git a/classes/toolchain-scripts-mingw32.bbclass b/classes/toolchain-scripts-mingw32.bbclass
> index 32493d7..0afbf7d 100644
> --- a/classes/toolchain-scripts-mingw32.bbclass
> +++ b/classes/toolchain-scripts-mingw32.bbclass
> @@ -38,6 +38,17 @@ toolchain_create_sdk_env_script_sdkmingw32 () {
> # Change unix '/' to Win32 '\'
> sed -e 's,/,\\,g' -i $script
>
> + # set has some annoying properties:
> + # 1) If it is successful %ERRORLEVEL% is unchanged (as opposed to being set
> + # to 0 to indicate success)
> + # 2) Making an assignment like "set A=" is considered an error and sets
> + # %ERRORLEVEL% to 1.
> + #
> + # Practically, this means that if any of the set calls make an empty
> + # assignment that error will be propagated. To prevent this, a command is
> + # run to ensure that the "exit code" of this script is 0
> + echo "@%COMSPEC% /C exit 0 > NUL" >> $script
> +
> # Make the file windows friendly...
> awk 'sub("$", "\r")' $script > $script.new
> mv $script.new $script
> @@ -81,17 +92,6 @@ toolchain_shared_env_script_sdkmingw32 () {
> FOR %%x IN (%OECORE_NATIVE_SYSROOT%\\environment-setup.d\\*.bat) DO call "%%x"
> )
> EOF
> -
> - # set has some annoying properties:
> - # 1) If it is successful %ERRORLEVEL% is unchanged (as opposed to being set
> - # to 0 to indicate success)
> - # 2) Making an assignment like "set A=" is considered an error and sets
> - # %ERRORLEVEL% to 1.
> - #
> - # Practically, this means that if any of the set calls make an empty
> - # assignment that error will be propagated. To prevent this, a command is
> - # run to ensure that the "exit code" of this script is 0
> - echo "@%COMSPEC% /C exit 0 > NUL" >> $script
> }
>
> toolchain_create_sdk_siteconfig_append_sdkmingw32 () {
> --
> 2.20.1
>
> --
> _______________________________________________
> yocto mailing list
> yocto@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-02-21 11:29 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-02-20 21:34 [meta-mingw][PATCH] classes/toolchain-scripts-mingw32: Fix bad cmd flag Joshua Watt
2019-02-21 11:29 ` Burton, Ross
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.