898 Commits

Author SHA1 Message Date
Max Howell
12d17155cf If we delete stuff in the clean step, make fuss
/cc @jwheare
2012-09-18 16:27:34 -04:00
Max Howell
523f50862b Install plists in FormulaInstaller, not build.rb
Build rb should only build!
2012-09-13 17:00:02 -04:00
Jack Nagel
e909b54c96 Tighten post-install checks
- Avoid ENOTDIR by ensuring that the directories we are checking are
   actually directories.
 - DRY up the check_PATH method; paths are already available via the
   global ORIGINAL_PATHS.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-09-11 00:45:45 -05:00
Max Howell
5790f4b523 Display skip-clean warning only before clean
Not anytime the formula loads.
2012-08-29 15:43:28 -04:00
Max Howell
336c4d1b05 If installed but not linked, say so
Rationale: if ack is unlinked but installed, typing ack does nothing, but then user tries to install and it says it is already installed. What gives? The user thinks.

Formula ending up unlinked can happen due to failures during the link phase and we recommend unlinking formula for conflicts. So common enough to justify this amendment.
2012-08-29 12:41:35 -04:00
Max Howell
20ce16a3ff Much better CTRL-C handling
Let's not show weird error messages when user interrupts during various stages of brew initialization.

Tested by doing `for x in $(brew search); do brew install $x; done` and pressing CTRL-C at random short intervals.
2012-08-29 12:41:35 -04:00
Max Howell
57df15afd0 Use opt paths in keg-only messages 2012-08-29 12:41:34 -04:00
Max Howell
f02d81ecbf Create active symlinks for installed formula
Similar to the LinkedKegs record, we write a symlink for installed kegs to PREFIX/opt.

Unlike the linked-keg record, unlinking doesn't remove the link, only uninstalling, and keg-only formula have a record too.

The reason for this addition is so that formula that depend on keg-only formula can build against the opt directory and not the cellar keg. Thus surviving upgrades.

To enforce this fix_install_names and built were adapted to use the opt path.

Standard kegs also create an opt symlink so that caveats can now refer to the opt directory and thus provide steps that survive upgrades too.

Thus the choice of /opt. It is short, neat and the right choice: POSIX dictates that opt is for stand-alone prefixes of software.
2012-08-29 12:41:33 -04:00
Jack Nagel
d423519766 Don't download bottles when building from source
The recent fix that prevents "-v" from triggering source downloads
exposed a different bug that allowed the build script to download the
bottled package instead of the source package; fix the logic.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-28 18:00:27 -05:00
samueljohn
537de9c046 formula_installer: make "linking" more clear
When building software "linking step did not complete" sounds
like ld failed. Let's be clear about this.

Closes Homebrew/homebrew#14407.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2012-08-25 15:36:13 -07:00
Max Howell
4e7bb6c637 Better message if multiple kegs need linking 2012-08-21 12:09:05 -04:00
Jack Nagel
c6b3cd7cf4 Don't lie about upgrading up-to-date formulae
Usually, the "foo-version already installed" error is printed by
FormulaInstaller. However, if an up-to-date formula that has outdated
deps is passed on the command line, we proceed to upgrade the deps and
then print a message saying that the formulae given on the command line
is already installed.

Catch this earlier, when the outdated list is being populated, print an
appropriate message, and skip the up-to-date formula.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-18 19:33:39 -05:00
Jack Nagel
8a21bd52d5 Add ARGV.ignore_deps?
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-18 19:33:39 -05:00
Jack Nagel
a81da08732 Refer to the real keg when dying because the keg exists
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-18 11:26:00 -05:00
Jack Nagel
83cdc64b40 FormulaInstaller: filter ARGV when testing for installed deps
In FormulaInstaller#install, needed_deps is created without first
filtering ARGV for flags like --HEAD. In practice, this means that
sometimes needed_deps will contain dependencies that are actually
already installed; --HEAD causes Formula#installed_prefix to differ and
thus checking Formula#installed? will result in false negatives.

This can trigger weird bugs; for example, Homebrew/homebrew#10380, where the "Installing
foo" header is displayed even though no dependencies were previously
installed.

Fix this by filtering ARGV before testing for installed dependencies,
and do the same for requirements to maintain symmetry, and because some
requiremnts check Formula#installed? as well.

Fixes Homebrew/homebrew#10380.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-15 22:39:52 -05:00
Jack Nagel
140dc4c419 Don't print an empty line if all requirements are satisfied
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-14 23:30:15 -05:00
Jack Nagel
c38bc4fd67 Recursively expand requirements in FormulaInstaller
Currently FormulaInstaller "forgets" about the requirements of
dependencies, as dependencies are recursively expanded by the first
FormulaInstaller instance, and then ignored by subsequent instances to
prevent duplicate installation attempts. These requirements then have
their messages displayed, but the fatal check is skipped and thus no
exception is raised.

Now that we have Formula#recursive_requirements, we can mirror what we
are doing with dependencies and recursively expand requirements up
front.

While at it, fix a bug in determining Requirement equality that resulted
in unique requirements being eliminated from a formula's set of
recursive requirements.

Fixes Homebrew/homebrew#12290.
Fixes Homebrew/homebrew#14084.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-14 23:26:50 -05:00
Max Howell
88e79a9098 Uninstall keg if error during build & tab creation
Previously if error occurred in code around the logic you'd get a keg that is installed without a tab, which breaks brew.
2012-08-13 10:14:59 -04:00
Jack Nagel
a054dc5019 Add :when_xquartz_installed as a keg-only reason
Using :when_xquartz_installed will tell the keg-only machinery to activate
if XQuartz is installed.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-12 17:28:15 -05:00
Jack Nagel
c9f824b54a Make Set available globally
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-12 00:58:31 -05:00
Jack Nagel
c2725aa048 Simplify conditional
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-07 15:33:29 -05:00
Jack Nagel
1d295ff3bc Automatically append shell completion caveats
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-07 15:32:00 -05:00
Adam Vandenberg
8c8701f268 Allow multiple unsatisfied fatal requirements
Closes Homebrew/homebrew#13335.
2012-08-07 10:49:45 -07:00
Max Howell
97b841c1d5 Don't output Ruby warnings
We don't want bug reports about this crap, even though the user REALLY should listen to the warning message. What actually happens is they blame us instead.

This kind of warning in particular:

warning: Insecure world writable dir /usr/local/bin in PATH
2012-08-06 13:06:36 -04:00
Jack Nagel
62482504a9 Split Xcode and CLT methods into separate modules
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-07-25 11:58:01 -05:00
Adam Vandenberg
50b2a32f9a Add some comments 2012-07-09 08:39:36 -07:00
Jack Nagel
98a11b8e57 Introduce new formula specs 2012-07-04 22:47:32 -05:00
Adam Vandenberg
62f269d0aa Simplify check_non_libraries 2012-06-27 10:21:28 -07:00
Misty De Meo
7af4622b0f Replace /usr/bin/ruby with full Framework path
Rationale: some users insist on replacing the /usr/bin/ruby symlink
to point to another ruby on their system, which may break homebrew.
Use the full Framework path instead, which is less likely to be tampered with.

This also reorganizes the brew --config checks to reflect the different path.

Fixes Homebrew/homebrew#12009.

Closes Homebrew/homebrew#12333.

Signed-off-by: Misty De Meo <mistydemeo@gmail.com>
2012-06-01 09:24:25 -05:00
Will Ross
beb85c0d90 Do not warn about JNI libraries in lib
JNI libraries in OS X are suffixed with jnilib. Additionally,
/usr/local/lib is a default search location for JNI libraries,
so Homebrew shouldn't complain when it installs .jnilibs into lib.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2012-05-26 21:10:04 -07:00
Jack Nagel
28f89c59a2 FormulaInstaller: fold dirlist helper into check_m4
Having in_aclocal_dirlist? defined as a method on FormulaInstaller is a
little weird; since its just a return condition of check_m4, move the
code there.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-05-13 18:43:14 -05:00
Nicolas Despres
c2fdcf1a34 Honor build options and bottles when upgrading
Fixes Homebrew/homebrew#11552.
Closes Homebrew/homebrew#11777.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-05-05 12:24:56 -05:00
Mike McQuaid
f833041765 Fix Git installation warnings (again).
We have to install them to lib; anywhere else requires root
access, a non-system perl or patching Git.

Tried just moving them in 9597d5 but that breaks git-svn.
2012-04-16 20:26:06 +10:00
Mike McQuaid
c703c6f1ee Fix Qt installation warnings.
PRL files are necessary in lib so whitelist them.

Debian installs them too:
http://packages.debian.org/squeeze/amd64/libqt4-dev/filelist
2012-04-16 16:46:39 +10:00
Adam Vandenberg
f09e0c8e1e Don't warn about .o files in lib 2012-04-11 19:30:24 -07:00
Jack Nagel
1bc6313694 Pass the tab to FormulaInstaller
Callers of FormulaInstaller now usually unlink the existing keg prior to
running the installer. However, Tab.for_formula uses the LinkedKeg
record to obtain the tab.

Since we need the tab to persist install options across upgrades, we
must start creating the Tab object before unlinking the old keg and
passing it to the FormulaInstaller.

Fixes Homebrew/homebrew#11086.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-03-23 13:05:08 -05:00
Mike McQuaid
d47cf55f68 Use fetch for downloading bottles.
Fixes Homebrew/homebrew#10958.
2012-03-18 15:16:57 +13:00
Max Howell
3d5b4af523 Tell the user to tap (if req.) for tapped deps
Also propagate dependency info through exception if possible so the error message is more useful.
2012-03-16 21:06:17 +00:00
Max Howell
765ae96180 Leave kegs keg-only if linking step fails
Rationale: well, it should always have been like this!

However now we are opening ourselves up to more-mixed installations of formula not maintained by us, it's important that
2012-03-16 21:06:16 +00:00
Max Howell
59436b194d Abort installs if reps are installed but not linked
Except for keg-only reps of course.

I suspect quite a few bug reports we receive are due to this sort of thing.

Ideally we'd not do this check for deps, since they have already been checked. I fear some weird consequences. But this check *should* be done before unlinking the previously installed brew in the case of upgrades. And the ignore_deps flag is set after the initialiser. There are ways round this but the code would be less nice.
2012-03-15 13:02:47 +00:00
Adam Vandenberg
cef5429f93 Use new Requirements code in Homebrew 2012-03-10 09:24:10 -08:00
Mike McQuaid
552dcdc703 Move most bottle stuff to a bottles.rb file. 2012-03-10 18:10:40 +13:00
Mike McQuaid
4a306f32f4 Support bottles for non-Lion OSX versions. 2012-03-10 18:09:35 +13:00
Max Howell
8fd2778a95 Allow dependencies to still install
Oops bug.
2012-03-07 13:48:04 +00:00
Max Howell
76aa0a62f3 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
Adam Vandenberg
d22eed3f16 Add support for Luarocks dependencies. 2012-02-29 20:52:20 -08:00
Max Howell
2049ce9f5c Autoconf, Automake and Libtool
We need these now for Xcode-4.3/CLT4X installations.

Also prevent m4 error in installer. And prevent brew doctor complaining if we're Xcode 4.3 or above.

Closes Homebrew/homebrew#10349. Fixes Homebrew/homebrew#10423. Refs Homebrew/homebrew#9179.
2012-02-27 03:35:11 +00:00
Adam Vandenberg
87686d8610 audit: check sbin too
Apply the 'bin' audit to 'sbin' too, and also complain if subfolders are
installed to either.
2012-02-26 16:33:44 -08:00
Adam Vandenberg
9ca233812c List offending jar files when installed to lib 2012-02-25 20:57:21 -08:00
Second Planet
8a4cb8c0ac Add more external dep options
* Chicken Scheme
* Node.js
* Rubinius

Closes Homebrew/homebrew#8466.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2012-02-25 10:19:59 -08:00