-
Notifications
You must be signed in to change notification settings - Fork 986
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
Fixes #37627 - Only update repositories once in global registration #10237
base: develop
Are you sure you want to change the base?
Conversation
Instead of using shell to compose a file, this uses ERB to determine the content once.
Rather than doing this for each repository, it is now performed once.
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.
Changes look sensible to me. Code works fine on my Ubuntu 20.04 host.
@@ -98,13 +96,18 @@ elif [ -f /etc/debian_version ]; then | |||
curl --silent --show-error --output /etc/apt/trusted.gpg.d/client<%= index %>.asc <%= shell_escape repo_gpg_key_url %> | |||
fi | |||
<% end -%> | |||
apt-get update | |||
|
|||
else | |||
echo "Unsupported operating system, can't add repository." | |||
cleanup_and_exit 1 | |||
fi |
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.
fi | |
fi | |
While you are at it, you could add a newline such that the code blocks that configure a repository will be separated by a newline in the resulting shell script.
Test failure does not look related to the change, does it? |
Rather than doing this for each repository, it is now performed once.
It also simplifies writing out the repo file to make the write atomic. Right now it doesn't use
save_to_file
, but that could simplify it even further.