Skip to content
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

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

ekohl
Copy link
Member

@ekohl ekohl commented Jul 4, 2024

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.

ekohl added 2 commits July 4, 2024 16:17
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.
Copy link
Contributor

@nadjaheitmann nadjaheitmann left a 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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants