-
Notifications
You must be signed in to change notification settings - Fork 2k
Fix update.sh invocation with unknown variant #1161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This doesn't seem to work Before this change:
After this change:
|
If update.sh was invoked with non-existing variant, it updated all variants. Change in_variants_to_update to return true always if second variant argument was not given, but not when given variant argument does not match to available variants.
5bab97c
to
6c3fa2f
Compare
Ok, problem fixed! |
@@ -97,7 +97,7 @@ function in_variants_to_update() { | |||
local variant=$1 | |||
|
|||
if [ "${#update_variants[@]}" -eq 0 ]; then | |||
echo 0 | |||
echo 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Echo? Not exit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah because it's a function that needs to return a boolean. This causes the script to skip the unrecognized variant
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe catch the error and give it a more clear prompt message?
Can that be done in a separate PR? Right now it breaks but with the change it will ignore it. |
I prefer not to separate that to another PR, the change here did prevent a strange situation but also added one, |
How do you get that error? |
I mean |
I used to get that error but this PR fixes this. |
I thought |
Aaaah,that comment was before I fixed it. |
Oh, I misunderstood, sorry! |
Tried to run the update.sh for 10.18.1, but it wouldn't work till I reverted this locally |
@nschonni do you have more details? |
Running |
Really? |
I don't think it's necessarily this one that broke it but the one before that. |
No, just flipping the $ ./update.sh
Updating version 10...
Updating version 12...
Updating version 13...
Updating version chakracore/10...
chakracore/10/Dockerfile is already up to date!
Done!
$ git revert --no-edit 6c3fa2f322cbff89885a849a7dfe69972ce97a30
Auto-merging update.sh
[master e961171] Revert "Fix update.sh invocation with unknown variant"
Date: Fri Jan 10 15:37:30 2020 +0100
1 file changed, 1 insertion(+), 1 deletion(-)
$ git diff origin/master
diff --git c/update.sh w/update.sh
index 25d61dc..87f1c86 100755
--- c/update.sh
+++ w/update.sh
@@ -97,7 +97,7 @@ function in_variants_to_update() {
local variant=$1
if [ "${#update_variants[@]}" -eq 0 ]; then
- echo 1
+ echo 0
return
fi
$ ./update.sh
Updating version 10...
Updating version 12...
Updating version 13...
10/jessie/Dockerfile is already up to date!
10/jessie-slim/Dockerfile is already up to date!
10/stretch/Dockerfile is already up to date!
10/buster/Dockerfile is already up to date!
10/buster-slim/Dockerfile is already up to date!
12/stretch/Dockerfile is already up to date!
12/buster/Dockerfile is already up to date!
10/stretch-slim/Dockerfile is already up to date!
12/buster-slim/Dockerfile is already up to date!
Updating version chakracore/10...
12/stretch-slim/Dockerfile is already up to date!
13/buster/Dockerfile is already up to date!
13/stretch/Dockerfile is already up to date!
13/stretch-slim/Dockerfile is already up to date!
13/buster-slim/Dockerfile is already up to date!
10/alpine3.10/Dockerfile is already up to date!
10/alpine3.11/Dockerfile is already up to date!
10/alpine3.9/Dockerfile is already up to date!
chakracore/10/Dockerfile is already up to date!
12/alpine3.9/Dockerfile is already up to date!
12/alpine3.11/Dockerfile is already up to date!
12/alpine3.10/Dockerfile is already up to date!
13/alpine3.10/Dockerfile is already up to date!
13/alpine3.11/Dockerfile is already up to date!
Done! |
You're right. #1192 |
If update.sh was invoked with non-existing variant, it updated all
variants. Change in_variants_to_update to return true always if
second variant argument was not given, but not when given variant
argument does not match to available variants.