Giter VIP home page Giter VIP logo

Comments (6)

zbentley avatar zbentley commented on August 23, 2024 1

While this module can and maybe should handle this case, it does seem like a useful feature to have in Homebrew itself, if only for consistency with how other subcommands behave. I opened Homebrew/brew#1514 for this.

from puppet-homebrew.

TheKevJames avatar TheKevJames commented on August 23, 2024

Huh. Well, that's not great.

Looks like this is an issue with puppet-homebrew rather than brew itself. We should be able to look up the aliases in a few different ways and keep that in mind when deciding whether or not to install.


Notes-to-self:

See:

[kevinc@atomicbox(zsh):/usr/local] brew install mosh
==> Installing dependencies for mobile-shell: protobuf
==> Installing mobile-shell dependency: protobuf
==> Downloading https://homebrew.bintray.com/bottles/protobuf-3.1.0.el_capitan.bottle.tar.gz
######################################################################## 100.0%
==> Pouring protobuf-3.1.0.el_capitan.bottle.tar.gz
==> Caveats
Editor support and examples have been installed to:
  /usr/local/Cellar/protobuf/3.1.0/share/doc/protobuf
==> Summary
🍺  /usr/local/Cellar/protobuf/3.1.0: 253 files, 16M
==> Installing mobile-shell
==> Downloading https://homebrew.bintray.com/bottles/mobile-shell-1.2.6_3.el_capitan.bottle.tar.gz
######################################################################## 100.0%
==> Pouring mobile-shell-1.2.6_3.el_capitan.bottle.tar.gz
==> Caveats
Bash completion has been installed to:
  /usr/local/etc/bash_completion.d
==> Summary
🍺  /usr/local/Cellar/mobile-shell/1.2.6_3: 13 files, 939.2K
[kevinc@atomicbox(zsh):/usr/local] brew install mosh
Warning: mobile-shell-1.2.6_3 already installed

I can't find an easy way to look up homebrew aliases. It looks like homebrew creates aliases manually, which makes it unlikely they've built a way to look these up automatically. This may help, but I'm not yet sure how to use this.

It looks like homebrew core knows about these, probably somewhere in the update payload. In /usr/local/Homebrew, we seem to only have Homebrew/Library/Taps/caskroom/homebrew-cask/Casks/mosh.rb and Homebrew/Library/Taps/homebrew/homebrew-core/Formula/mobile-shell.rb... the latter would be the one we want to look at, but it looks like it's only a one-way lookup.

brew list mosh in the case where mosh is not installed returns this alias (Error: No such keg: /usr/local/Cellar/mobile-shell), but that doesn't help us too much since it shows paths only when the package is installed.

Regardless of whether mosh is installed, the first line of info returns it's real name:

[kevinc@atomicbox(zsh):/usr/local] brew info mosh
mobile-shell: stable 1.2.6 (bottled), HEAD
# snip

Output parsing is gross, but it might be helpful in this case.


from puppet-homebrew.

zbentley avatar zbentley commented on August 23, 2024

Radical and probably-bad (haven't thought about it too hard) idea: do brew install during the existence check phase. An "already-installed" result (happens quickly for installed packages) results in an existence-check-success. An "installing...installed" successful operation (as is currently done during the "install" phase) results in a no-op/notify install operation. An error gets captured and re-thrown during the "install" phase.

from puppet-homebrew.

edestecd avatar edestecd commented on August 23, 2024

This behavior is the same with the yum provider and aliases.
Just don't use the alias. Use the real package name.

from puppet-homebrew.

TheKevJames avatar TheKevJames commented on August 23, 2024

@zbentley It looks like this is now fixed due to Homebrew/brew#1520, please feel free to reopen the issue if that is not the case.

from puppet-homebrew.

zbentley avatar zbentley commented on August 23, 2024

Seems to be working now. Thanks!

from puppet-homebrew.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.