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

get-stack: check deps before sudo #4074

Merged
merged 1 commit into from
Jun 25, 2018
Merged

Conversation

bukzor
Copy link
Contributor

@bukzor bukzor commented Jun 10, 2018

Don't need to invoke sudo if all deps are already installed.
Avoiding the sudo prompt where possible is going to be an improvement.

  • [ ✔️ ] Any changes that could be relevant to users have been recorded in the ChangeLog.md
  • [ ✔️ ] The documentation has been updated, if necessary.

Please also shortly describe how you tested your change. Bonus points for added tests!

I re-ran the script a few times, sometimes uninstalling libgmp-dev, and verified it skips sudo apt install
when appropriate.

Don't need to invoke sudo if all deps are already installed.
Avoiding the sudo prompt where possible is going to be an improvement.
@borsboom
Copy link
Contributor

A similar fix could probably be made for yum/dnf distros (CentOS, RHEL, etc), but that can be done separately.

@bukzor
Copy link
Contributor Author

bukzor commented Jun 18, 2018

@borsboom I agree. Anything else I should do?

@dbaynard
Copy link
Contributor

To follow up on this so it can be merged:

I can't speak for @borsboom, but it would be good to follow the suggestion, and also make the change to the following lines

https://github.com/bukzor/stack/blob/4a8d4dec2a2458a3eb4f7c3a785f447fef24422d/etc/scripts/get-stack.sh#L571-L597

@bukzor would you be able to do that?

@bukzor
Copy link
Contributor Author

bukzor commented Jun 23, 2018

What suggestion? The lines you point at are for systems I don't have.

Copy link
Contributor

@borsboom borsboom left a comment

Choose a reason for hiding this comment

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

Looks like I left a review comment "pending" without realizing it.

@@ -561,7 +561,9 @@ try_install_pkgs() {

# Install packages using apt-get
apt_get_install_pkgs() {
if ! sudocmd apt-get install -y ${QUIET:+-qq} "$@"; then
if dpkg-query -W "$@" > /dev/null; then
info "Already installed!"
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it clear that this "Already installed!" message is referring to apt dependencies? If not, clarifying would be good.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, because the previous line printed is "Installing dependencies...".

@borsboom
Copy link
Contributor

@bukzor If you are able, using Docker or Vagrant to run VMs with the other distros to make a similar change would be super helpful. That said, I don't think it should be a prerequisite for merging this PR.

@bukzor
Copy link
Contributor Author

bukzor commented Jun 25, 2018

@borsboom I agree that it shouldn't be a blocking issue.
I won't be investing time in these other distributions, full disclosure.
I believe you'll get contributions for them however, after this precedent is set.
Anything else I should do?

@borsboom borsboom merged commit b9bc6a6 into commercialhaskell:master Jun 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants