Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
tests: remove quoting from [[ ]] when globs #3264
Conversation
|
LGTM, @zyga btw. are we using signed-off-by for snapd? I never used it so far and we should make it either a common thing everybody does or drop it. |
chipaca
approved these changes
May 3, 2017
Gah! I knew this, and missed in the last review. Sorry.
|
double brackets are a bash only feature, please do not use it if you can avoid it or make sure that either /bin/sh points to /bin/bash in your environment or your shebang is explicitly set to #! /bin/bash (to be more portable we should really make sure to only use POSIX shell unless it is unavoidable) |
|
@ogra1 this is in a spread |
|
@chipaca well, as long as we are sure this never runs in other distros or setups ... it doesnt do any harm to use [ ] over [[ ]] though (and makes no difference in execution apart from being portable) |
|
@ogra1 except that the reason it's using |
... about ten times as fast and more efficient ... (and portable as well) |
|
After re-running spread a number of times, I need to ask: are you sure you want to exit early from the test when the system isn't debian? I'm suspecting you meant the opposite. |
The test should be $SPREAD_SYSTEM = debian-* instead of $SPREAD_SYSTEM != debian-* This should solve the still failing CI. @zyga Can you change that? |
|
@morphis wouldn't it make sense to make it be |
We could but I will propose a change before we land any other SPREAD_SYSTEM which will make this check superfluous so lets fix this the easy way for now. |
zyga commentedMay 3, 2017
•
Edited 1 time
-
zyga
May 3, 2017
It seems that shell has a peculiar quoting rules when [[ ]] expressions
are used. [[ "foo" == f* ]] returns 0 while [[ "foo" == "f*" ]] returns 1.
The glob magic is on only if the expression on the right hand side is
unquoted.
Signed-off-by: Zygmunt Krynicki zygmunt.krynicki@canonical.com