Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

Add wrapper shell script for brew. #17548

Closed
wants to merge 2 commits into from
Closed

Add wrapper shell script for brew. #17548

wants to merge 2 commits into from

Conversation

MikeMcQuaid
Copy link
Member

To allow easier configuration for non-OSX platforms.

References #16344.

@adamv
Copy link
Contributor

adamv commented Feb 3, 2013

Need to dereference the brew symlink before looking for a relative Library folder.

exit 1
if [ "$BREW_SYSTEM" = "darwin" ]
then
exec $BREW_DIRECTORY/brew $*
Copy link
Contributor

Choose a reason for hiding this comment

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

"$@" instead of $*

@MikeMcQuaid
Copy link
Member Author

Updated.

@MikeMcQuaid
Copy link
Member Author

Updated again to resolve (one) symlink. Think we should do either do the brew-$(uname) stuff or remove the shebang. Both seems kinda pointless. I guess from what @sjackman has said so far the latter might be more use.

@MikeMcQuaid
Copy link
Member Author

Let me know how this looks now when you get a chance. Thanks.

@sjackman
Copy link
Member

sjackman commented Feb 6, 2013

On OS X we want to use a particular Ruby interpreter. On other systems we want to use the Ruby interpreter found in the path. I suggest the following.

if [ "$BREW_SYSTEM" = "darwin" ]
then
    exec "$BREW_DIRECTORY/brew.rb" "$@"
else
    exec ruby -W0 "$BREW_DIRECTORY/brew.rb" "$@"
fi

Cheers,
Shaun

@MikeMcQuaid
Copy link
Member Author

@sjackman Do you see a use in having your own brew-linux script which could do setup/checks for various things and avoid patches?

@sjackman
Copy link
Member

sjackman commented Feb 6, 2013

@MikeMcQuaid Not immediately, unless we go the monkey patch route, but I'm not convinced that's the best solution.

@MikeMcQuaid
Copy link
Member Author

I think some monkey patching would be a good idea but I'll try and get some of the stuff merged from your other pull where it makes sense.

@MikeMcQuaid
Copy link
Member Author

Updated. Split into two commits so Git's rename detection behaves properly and used @sjackman's changes.

This allows us to force using the system Ruby on OSX but allow
the development of Homebrew for Linux or Windows to not rely
on OSX paths.

Closes #17548.
@jacknagel
Copy link
Contributor

Haven't tested it but the approach looks fine.

@MikeMcQuaid
Copy link
Member Author

@Sharpie @mistydemeo @mxcl Thoughts?

@mxcl
Copy link
Contributor

mxcl commented Feb 7, 2013

Approved.

FFR: making brew work on Linux is worth it IMO.

Though making the formula in Library/Formula a tap will be a prerequisite for it working well on Linux.

@MikeMcQuaid
Copy link
Member Author

Pushed this. It may well destroy the universe so I'll watch out for that.

@MikeMcQuaid MikeMcQuaid deleted the brew-sh-wrapper branch February 8, 2013 01:55
@MikeMcQuaid MikeMcQuaid restored the brew-sh-wrapper branch February 9, 2013 04:32
@MikeMcQuaid MikeMcQuaid deleted the brew-sh-wrapper branch February 9, 2013 04:33
Sharpie pushed a commit to Sharpie/homebrew that referenced this pull request Feb 19, 2013
This allows us to force using the system Ruby on OSX but allow
the development of Homebrew for Linux or Windows to not rely
on OSX paths.

Closes Homebrew#17548.
@Homebrew Homebrew locked and limited conversation to collaborators Feb 16, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants