Commit Graph
46 Commits
Author SHA1 Message Date
Jack Nagel e17d2a24fc Use Hardware::CPU module 2013-06-14 10:34:17 -05:00
Jack Nagel 453a581150 install: remove overcautious array manipulation 2013-06-12 09:02:20 -05:00
Adam Vandenberg 4b014a4ed1 Consolidate sudo checks.
Closes #20318.
2013-06-08 20:44:56 -07:00
Jack Nagel 950c9b0bee Refactor Xcode/CLT version checks 2013-05-22 22:30:38 -05:00
Jack Nagel 591496ccbf Don't error out when a package is already installed
Fixes #17010.
2013-04-03 18:27:28 -05:00
Jack Nagel 30a08f5cc7 Don't attempt installation multiple times
When a dependency of a formula specified on the command-line is also
specified, *after* the dependent formula, installation proceeds as part
of the dependent's dependency tree and then is attempted again because
the user asked for it explicitly. This results in the installer raising
a CannotInstallFormulaError because it has already been installed.

For example:

  $ brew install graphviz pkg-config
  ==> Installing graphviz dependency: pkg-config
  ...
  ==> Installing graphviz
  ...
  Error: pkg-config-0.27.1 already installed

We already have a mechanism for dealing with this, but it does not kick
in early enough. Move the installation attempt check into
FormulaInstaller#check_install_sanity and catch the exception in the
appropriate places.

Fixes #16957.
2013-01-10 16:46:54 -06:00
Misty De Meo 2c2caf7cf0 Replace sceaga/homebrew with mistydemeo/tigerbrew
@sceaga has discontinued his homebrew fork, so tigerbrew is now PPC/
Tiger users' best bet.
2012-12-27 21:55:15 -04:00
Jack Nagel ac86882a1e Better reporting for MacPorts/Fink installations
closes #15853.
2012-12-17 17:18:22 -06:00
Adam Vandenberg 9fc68bdb38 Error out on lowercase --head parameter to install.
Fixes #14815.
2012-11-01 08:08:40 -07:00
Max Howell d414d9b613 Doctor check for unlicensed Xcode
Checking the license text is probably the most future proofed method. Though for future reference other possible methods are listed in the below ticket.

Closes #14558.
2012-08-31 10:22:11 -04:00
Adam Vandenberg 4df2082fc3 remove trailing whitespace 2012-08-10 07:23:48 -07:00
Max Howell 2f8f17f133 Be more verbose when users insist on being sudoers
If you google for "Cowardly refusing to sudo brew" you get a lot of confused users who didn't read any of the Homebrew documentation and then had a hissy-fit.
2012-08-10 09:33:44 -04:00
Brandon Black 8aa4f9dd3b Fix issues with writable? detection in brew doctor
Closes #13689.

Signed-off-by: Max Howell <mxcl@me.com>

There are subtle distinctions between writable? and writable_real? we don't
understand precisely why we need this, but it fixes the bugs :/
2012-08-06 22:02:38 -04:00
Max Howell e93477c1b4 Don't blacklist tapped-dupes
If a formula is in Formula due to tapping or otherwise, don't prohibit installation.

Really we should make the blacklist *really* stuff that should be blacklisted and then if it is available still require a --force. But currently with okay stuff like vim in there, and libxml2 being both blacklisted *and* in mxcl/master, we are screwing ourselves.

TL;DR we should do some work on this component.

Fixes #13234.
2012-08-06 14:22:22 -04:00
Mike McQuaid 34c970b103 Add ofail command and fix bottle command output. 2012-04-30 21:38:08 +08:00
Mike McQuaid 48a82e5f02 Exit with bad exit code on command failures. 2012-03-29 18:44:37 +11:00
Jack Nagel 5a8c2af99b Update Xcode version checks
Closes #11044.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-03-20 19:06:59 -05:00
Mike McQuaid 9728610ca0 Remove bad exit status; need to fix another way. 2012-03-10 08:18:42 +13:00
Mike McQuaid 2e63ae9f71 Add better Unix exit codes.
Closes #10809.
2012-03-09 19:16:33 +13:00
Max Howell 5bddaf2e35 Stop supporting `brew install --force'
Rationale: it breaks stuff. You should not be able to install over something already installed *and* linked. brew now prompts you to unlink the existing linked keg first.

I came to fix this because I discovered that `brew install foo` works without --force provided foo's formula version is different to that which is installed and linked. I'm not sure if this was intentionally broken, but it led to at least two tickets I found where people were getting crazy issues trying to install over the top of already installed previous versions.

So I also fixed a whole category of other issues, mostly by moving error handling into FormulaInstaller. Now error's can be caught in Homebrew.install and handled on a formula-by-formula basis. I will next port this behaviour to upgrade.
2012-03-07 12:33:47 +00:00
Max Howell 8585c69af6 Warn, don't advertise with a status header 2012-02-21 12:45:20 +00:00
Max Howell 9c9d9a7133 Move this code into FormulaInstaller
The correct location for it IMO. Also added warning for the user.
2012-02-21 11:40:06 +00:00
Adam Vandenberg f7d4e5715d don't quit if already installed 2012-02-19 14:07:42 -08:00
Jack Nagel b609f69839 Remove LinkedKegs entry if we're writing the same one
If a keg has been uninstalled via `rm -rf <keg>`, and a user tries to
reinstall it without `brew unlink`ing it first, it will fail to link as
the LinkedKegs entry still exists. This isn't desirable, and the user
should be able to reinstall the same formula on top of the old, dead
symlinks without problems, so let's just remove the LinkedKegs entry if
it matches the one we are installing anyway.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-02-10 23:53:12 -06:00
Jack Nagel 17743d34a3 Don't return nil from Formula#linked_keg
Doing so was the result of a quick hack to fix the "deps installed as
upgrades don't get linked" bug, but it was a mistake. Instead, always
return the LinkedKegs entry as a Pathname object, and let callers be
responsible for checking that it exists.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-02-10 23:52:01 -06:00
Jack Nagel a38ae664cc Revert "install: unlink old kegs"
This reverts commit 2eabe2cbc8.

When Keg#unlink looks for symlinks relative to the keg, it can hit false
positives that actually belong to a different keg and unlink them
anyway. This breaks our "force identical directory symlinks to be shared
real directory" case.

This may be a problem in general with the unlinking code and should be
investigated.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-02-10 12:58:24 -06:00
Jack Nagel 2eabe2cbc8 install: unlink old kegs
If a formula makes it all the way to the actual install step, it is safe
to unlink the keg before linking; this will prune dead symlinks in the
case where a keg was removed with `rm -rf <keg>` but not unlinked with
`brew unlink`.

Fixes #10077.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-02-10 08:57:11 +00:00
Jack Nagel bc14dcf976 Warn the user of required arguments
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-02-04 00:27:05 -06:00
Misty De Meo aedacdf209 Add devel to the DSL, + stable and bottle blocks
This commit adds a `devel` entry to the DSL, allowing formulae to
specify an unstable branch.

`devel` takes a block, which should contain standard `url` and `md5`
fields (and `version`, if necessary). This must come after the standard
DSL fields.

This commit also migrates over all formulae currently using `devel` to
the new syntax, as well as formulae which used `head` for non-VCS urls.

The new syntax is also available for `stable` and `bottle`. `stable` is
an option alongside the old syntax. `bottle` replaces the old syntax.

Note that the @stable ivar in Formula has been renamed to @standard,
and the @bottle ivar has been renamed to @bottle_url.

Closes #9735.

Signed-off-by: Misty De Meo <mistydemeo@gmail.com>
2012-01-25 21:45:19 -06:00
Adam Vandenberg 72fc9fc3ef --HEAD checks
* Force --HEAD for head-only installs
* Don't allow --HEAD for stable-only formulae
2011-12-18 16:24:56 -08:00
Adam Vandenberg 697d2ae39e Idioms 2011-12-08 21:32:58 -08:00
Misty De Meo eb89df88dc Restore --force behaviour in brew-install
Fixes #8933.
Closes #8936.

Signed-off-by: Charlie Sharpsteen <source@sharpsteen.net>
2011-12-02 09:36:38 -08:00
Charlie Sharpsteen 3edc9d212b Re-work ARGV filtering to properly handle --HEAD
Previously, stripping arguments like `--HEAD` for dependencies failed because
that flag affects the installation prefix encoded into formula objects. The
previous implementation of `ARGV` filtering tried to contain all changes to a
single method call before the `FormulaInstaller` forks. This update spreads
things out a bit:

  - The Homebrew `ARGV` extension adds a new method, `filter_for_dependencies`
    which strips flags like `--HEAD`, yields to a block, then restores the
    original contents of ARGV.

  - The `explicitly_requested?` test, which returns true or false depending on
    if a formula object is a member of `ARGV.formulae`, is now a method of
    `Formula` objects.

  - `FormulaInstaller` objects now execute the installation of dependencies
    inside an `ARGV.filter_for_dependencies` block if the dependency was
    `explicitly_requested?`.

Fixes #8668.
Closes #7724.
2011-11-27 14:37:31 -08:00
Max Howell a0b940acb7 Check Cellar can be made before installing stuff
Refs #5188.
2011-09-15 10:57:22 +01:00
Adam Vandenberg 88849ddce0 Edit port/fink warning 2011-09-01 10:14:26 -07:00
Adam Vandenberg 279a1dea3d Edit port/fink warning 2011-09-01 10:08:21 -07:00
Max Howell 2e80976a43 Allow brew install --force again 2011-09-01 10:27:47 +01:00
Max Howell 3da76d0f37 Record which keg is linked
Will be useful for a variety of reasons, but for now, I'm just using it to ensure install won't install again if something is already installed (use brew upgrade instead).

But means that brew switch and that can work properly etc.
2011-08-24 22:30:44 +01:00
Max Howell 81f1fb38a9 brew upgrade
Consequence: you can no longer install when something is already installed, you must upgrade it. This doesn't apply if the formula in question was unlinked. You can still --force installs though.

Rationale: the old way of installing over the top would leave symlinks to multiple versions in /usr/local if the old version had a file the newer version didn't. The new upgrade command handles everything properly.
2011-08-24 22:30:43 +01:00
Max Howell 63da621a3f Only error out for sudo brew install
Note this only happens if Homebrew is *not* installed sudo. Which is most of the time true.

Fixes #6899
2011-08-17 12:30:21 +01:00
Max Howell ce8c849578 Don't abort if /usr/local is not writable
Since this is our new policy for /usr/local.
2011-07-30 11:03:34 +01:00
Adam Vandenberg 3d1e533057 Reformat minimum Xcode check 2011-06-06 08:03:07 -07:00
Max Howell 5cd927b8b5 Some Cleanup 2011-03-12 11:55:03 -08:00
Max Howell c051e2d91a Refactor the blacklists
Also don't abort searches if the query matches a blacklist. Eg.
`brew search vim` should return macvim and the information that vim itself is
not packaged.
2011-03-12 11:55:02 -08:00
Max Howell 58e508d19c More modular cmd/install and FormulaInstaller 2011-03-12 11:55:02 -08:00
Max Howell 9afc85ad33 Refactor the brew command into one file per command
The code was sucking. To the extent that maintenance was hard. It's a lot
easier to work with code that is sensibly split at sensible boundaries. So
now it is more like that.

But the refactor is minimal. Because we don't want you to have more merge
hell than absolutely necessary.

If you merge you will need to pay attention to brew.h.rb (as it is deleted)
and bin/brew (as command logic is gone). It will be painful, but you will just
have to help git out by moving any changes around manually.

Note compatibility.rb. It ensures that any function renames or removals don't
break anything. We're pretty serious about backwards compatibility. And that's
because we encourage you to hack around with the innards. And we couldn't do
that if we would then just make stuff disappear behind your back.
2011-03-12 11:55:02 -08:00