There are still methods and variables with the word "folder" in the
name, but at least user-facing messages and warnings should use the
correct terminology.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
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>
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.
ClosesHomebrew/homebrew#9735.
Signed-off-by: Misty De Meo <mistydemeo@gmail.com>
Installing a formula via `brew install` may trigger upgrades of its
dependencies if the dependencies are installed but outdated. However, we
never unlinked the existing keg in FormulaInstaller#install_dependency
which caused the link step to fail.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
If the suggested modifications are already in place, just skip the
warning.
ClosesHomebrew/homebrew#8624.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Use `Formula.factory dep.path` instead of `Formula.factory dep.name` so that
non-standard dependencies specified as URLs or paths can be handled properly.
The ARGV filtering would strip `--HEAD` from dependency installations,
then proceed with trying to install the dependency from the latest
version in the formula. This causes an error if the latest version is
already installed, so check to see if formula is installed before
performing the installation.
ClosesHomebrew/homebrew#8869.
Signed-off-by: Charlie Sharpsteen <source@sharpsteen.net>
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?`.
FixesHomebrew/homebrew#8668.
ClosesHomebrew/homebrew#7724.
For now, don't strip `--HEAD` from `ARGV` prior to forking for install.
Currently this doesn't work because the formula object the installer is acting
on has its `prefix` set while under the influence of `--HEAD`. So, the
installer bails out when it sees that nothing is installed to `f.prefix`.
This is a hotfix for issue Homebrew/homebrew#8668 to allow formulae to keep building. A proper
fix should ensure that formula installers are operating on objects with
appropriately set `prefix` values.
The `filtered_args` method added to the `FormulaInstaller` makes a call
`ARGV.formulae`. Unfortunately, `ARGV.formulae` will throw a
`FormulaUnspecifiedError` instead of returning an empty list. This patch
avoids the issue by checking `ARGV.named.empty?` before calling
`ARGV.formulae`.
FixesHomebrew/homebrew#8576.
FormulaInstaller now loads the install recipt of a previous install and appends
the `used_options` to ARGV before forking to build. This means `brew upgrade`
will "remember" which options were invoked for the last install and re-use
them.
FixesHomebrew/homebrew#5250.
`ARVG` is now filtered before the formula installer forks a new process. This
allows a chance to do things like strip out `--HEAD` flags for formulae that
weren't explicitly passed as arguments but came in as dependencies.
FixesHomebrew/homebrew#7724.
Otherwise, for formula that making the very first install into `sbin`, the
following line will fail with a critical error:
bin = (HOMEBREW_PREFIX/bin.basename).realpath.to_s
Because `sbin` will not exist until after `link` runs.
This isn't very clean as it moves `check_PATH` away from the other checks in
`caveats`, but I couldn't think of a better hotfix that did not require a bit
of code shuffling and re-writing.
It was just confusing, and since the `brew upgrade` refactor this makes more sense too.
Shame it still downloads in there etc. but whatever. Homebrew 2 will fix!
Bottles now pour purely, without doing all the other unnecessary stuff that happened before the `brew upgrade` code shuffle.
Formula.pourable? removed since it was install-specific metadata and not related to the formula itself. Now all such logic is in the FormulaInstaller which is much cleaner.
I also changed the bottle cache location to the normal directory and added a .bottle pre-extension. Thus you can see everything in one directory without messing about.
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.
The refactor branch doesn't catch the UEDE and print the error message
containing information about which dependency and how to install
it. This adds back that logic.
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
optparse adds an "options" method to ARGV, and so does Homebrew.
Rename this method (and remove optparse blocking script) so that
Homebrew plays nicer with external Ruby software.
This fixes the issue where "gem install thin" would break
"brew server", for instance.
Kernel#system special-cases the first argument, so you have to
make the first argument the entire command to be invoked, and
subsequent arguments the actual arguments to that command. In
order to use the user's interpreter, the first argument must be
"/usr/bin/env <name>".
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
RubyCocoa is a large dependency, and any large system can cause unexpected errors. In this case the user's system was badly setup and RubyCocoa caused a dynamic loader issue.
We don't use beer_events currently due to other bugs that occurred sporadically with its use. So requiring it is unnecessary. So lets save ourselves trouble.
FixesHomebrew/homebrew#487
It's a great feature but it seems to conflict with our new system() replacement. Clearly the bug is still in our system() but what exactly it is is not clear and this bug sucks.
See Homebrew/homebrew#124
It just seems to behave strangely with SIGINT. Eg. SIGINT causes tar to exit, but the SIGINT is ignored by our process. This is not the case when used with curl.
Couldn't make this atomic, apologies.
Fixes a few things, like deps failing to build not aborting the install.
--force now works properly again.
Overall more robust code. I went back over it all and gave it a lot of
thought.
Cleaner separation of logic. Less code in brew, now the only code there is
ARGV handling, and basic sanity checks.
Not extending ARGV or ENV in global now as that would propagate to other tools
or utilities you may write.