1319 Commits

Author SHA1 Message Date
Charlie Sharpsteen
39b3ed3c33 formula_installer.rb: Hotfix for head installs
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.
2011-11-21 11:26:05 -08:00
Charlie Sharpsteen
31eba09830 audit.rb: Check version strings by default
Tired of telling people that version numbers are redundant. Just check it by
default since the `--strict` flag to `brew audit` is not well advertised.
2011-11-21 09:00:34 -08:00
Jonathan Grochowski
92faeb79b2 Delete temp directory created during brew doctor
Running brew doctor creates a temporary directory in $HOMEBREW_TEMP or
/tmp but does not clean it up afterwards. This patch deletes the
directory created to prevent polluting $HOMEBREW_TEMP or /tmp with empty
directories.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2011-11-20 13:22:43 -08:00
Jack Nagel
7e57847793 audit: check for ARGV.flag? in formulae
We don't want single letter options like '-v' or '-d' to unintentionally
trigger formula-specific options.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-11-18 15:27:09 -06:00
Charlie Sharpsteen
6c4d3a15d6 Don't include receipt in brew list output
Fixes Homebrew/homebrew#8615.
2011-11-16 10:43:44 -08:00
Charlie Sharpsteen
eefbf00963 Don't write receipt for empty installs
Fixes Homebrew/homebrew#8616.
2011-11-16 10:42:02 -08:00
Jack Nagel
ebfa4d5dc0 audit: don't check duplicate URLs
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-11-15 18:06:26 -06:00
Adam Vandenberg
f2b43831f5 Mercurial 1.9.3 2011-11-15 09:03:12 -08:00
Charlie Sharpsteen
33a61d1897 Add --fresh option to brew install
When invoked, this option will ensure brew doesn't re-use any options from
previous installs of a formula.
2011-11-14 10:44:18 -08:00
Charlie Sharpsteen
8ec2d8e043 Hotfix for filtered_args breaking brew upgrade
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`.

Fixes Homebrew/homebrew#8576.
2011-11-14 08:22:59 -08:00
Jack Nagel
9e5c0da85b info: display used options for installed formulae
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-11-13 23:27:53 -06:00
Charlie Sharpsteen
7248afc490 Hardwire multi_json backend
The `multi_json` gem dynamically selects a JSON implementation from a list of
candidates. Since we cannot control which gems are installed on a user's
machine, this patch hardwires `multi_json` to use the included copy of `ok_json`.

`ok_json` is a pure-Ruby JSON encoder/decoder that is bundled with
`multi_json`. `ok_json` may not be as fast as other choices, but speed is not
critical for our application.

Closes Homebrew/homebrew#8574.

Signed-off-by: Charlie Sharpsteen <source@sharpsteen.net>
2011-11-13 19:23:00 -08:00
Charlie Sharpsteen
0dc87a5100 Add copyright notice for MultiJson 2011-11-13 13:15:06 -08:00
Charlie Sharpsteen
ec1c7aaa38 metadata: Use options from previous installs
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.

Fixes Homebrew/homebrew#5250.
2011-11-13 12:14:56 -08:00
Charlie Sharpsteen
028104b861 metadata: Record installation options
Adds a new class called `Tab` that acts as a recipt for install options. A
`Tab` can be serialized to a JSON file for future reference.
2011-11-13 12:14:56 -08:00
Charlie Sharpsteen
1d1cd374b3 Vendor Library: multi-json 1.0.3
Multi-JSON is a library that provides encode/decode support for casting Ruby
objects to JSON strings and back again. This version of the library has been
tested against ruby versions 1.8.6 and later.

Having a JSON encoder/decoder in the toolbox helps now that the GitHub API only
returns results in JSON format.
2011-11-13 12:14:55 -08:00
Charlie Sharpsteen
cb681ffff6 formula_installer.rb: Pre-process ARGV before fork
`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.

Fixes Homebrew/homebrew#7724.
2011-11-13 12:14:55 -08:00
Jack Nagel
6b9fa0b818 doctor: check_git_status in correct location
This would silently fail if HOMEBREW_REPOSITORY != HOMEBREW_PREFIX,
which is obviously a valid Homebrew setup.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-11-10 22:53:10 -06:00
Jack Nagel
784e3b2dfd doctor: document curl/terminal width issue
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-11-10 22:52:18 -06:00
Jack Nagel
c0eb8a3bc8 doctor: warn about wide terminals
A terminal width of 262 or greater can trigger a buffer overflow in
curl's progress bar code, resulting in a segfault and aborted downloads.
Warn about this.

cf Homebrew/homebrew#8521.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-11-10 20:47:17 -06:00
Jack Nagel
e7947f4f92 doctor: minor grammatical fix
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-11-10 19:49:26 -06:00
Jack Nagel
0cc3eb296d cleanup: add an option to perform a 'dry run'
Sometimes you want to know what `brew cleanup` will do before it
actually removes anything. Introduce a '-n' option (chosen to match
other UNIX tools) to do this.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-11-07 22:46:36 -06:00
Oleg Oshmyan
323c30978f audit: check for build_universal? calls if --universal unused
Closes Homebrew/homebrew#8123.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-11-02 19:02:53 -05:00
Jack Nagel
2c3b107d93 audit: check for empty sha256 checksums
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-11-02 18:55:27 -05:00
Adam Vandenberg
cbdb603838 Remove debian mirror check; it is just noise 2011-10-22 09:37:10 -07:00
Misty De Meo
1e17a8fb0b Add UnsafeSubversionDownloadStrategy
There was an UnsafeSubversionDownloadStrategy in a single formula
before, but a) it broke against later changes to
SubversionDownloadStrategy, and b) wasn't available to other formula.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2011-10-22 08:04:26 -07:00
Jack Nagel
9a9846814f doctor: correctly detect CLICOLOR_FORCE
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-10-18 20:10:57 -05:00
Adam Vandenberg
0dbf06bbc8 audit: complain more about tabs 2011-10-18 10:00:45 -07:00
Jack Nagel
8848857cea audit: check mirror URLs
This will actually throw some possibly unwanted warnings, e.g. whining
about using mirrors.kernel.org for Debian software; we might only want
that warning for the default URL.

Perhaps mirrors deserve their own audit_formula_mirrors, but rather than
duplicate code, let's just check them against the standard criteria for
now.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-10-15 00:39:05 -05:00
Misty De Meo
6ab97f75be add Xcode to the blacklist
Closes Homebrew/homebrew#8106.

Signed-off-by: Charlie Sharpsteen <source@sharpsteen.net>
2011-10-14 19:07:28 -07:00
Jack Nagel
d73df34bc6 doctor: check git version
Checking out over HTTP/HTTPS from GitHub requires git 1.6.6, as GitHub
only allows Smart HTTP transport.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-10-10 18:20:50 -05:00
Jack Nagel
0a49981a30 Add an attr_reader for 'head'
This allows `brew audit` to inspect the head URLs, for example; until
now, that check was failing silently.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-10-10 15:34:28 -05:00
Jack Nagel
f29c44d1fd fetch: use correct sha256 instance variable
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-10-09 15:56:15 -05:00
Jack Nagel
74207f71e6 cleaner: correctly obey HOMEBREW_KEEP_INFO
The advertised default is that anything in share/info is removed unless
the user sets HOMEBREW_KEEP_INFO, but we've actually been installing the
files *unless* the variable is set. To illustrate:

  $ unset HOMEBREW_KEEP_INFO
  $ brew install -v wdiff
  [...]
  ln /usr/local/share/locale/af/LC_MESSAGES/wdiff-gnulib.mo
  ln /usr/local/share/info/wdiff.info
  ln /usr/local/share/info/dir
  ==> Summary
  [...]
  $ HOMEBREW_KEEP_INFO=1 brew install -v wdiff
  ln /usr/local/share/locale/af/LC_MESSAGES/wdiff-gnulib.mo
  ==> Summary
  [...]

Obviously not what we wanted.

Closes Homebrew/homebrew#7989.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-10-06 00:11:34 -05:00
Charlie Sharpsteen
e7aaeda953 formula.rb: Don't attempt to mirror unstable URLs
If a build is being influenced by an option such as `--HEAD`. Don't attempt
mirrors if a download fails.

Fixes Homebrew/homebrew#7971.
2011-10-04 18:36:31 -07:00
Dustin Koupal
bcea01ca0a pathname.rb: Fix spelling for permssions
Closes Homebrew/homebrew#7970.

Signed-off-by: Charlie Sharpsteen <source@sharpsteen.net>
2011-10-04 15:19:06 -07:00
Daniel Bingham
fbd0d7ec7b Fix :sha spec so that it actually checks out the SHA
:sha was used to prevent the "--depth" option to git clone, but was
never actually used to checkout the SHA.

Closes Homebrew/homebrew#7859.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-10-03 18:45:25 -05:00
Jack Nagel
2f85acfeb2 doctor: warn about expired SSL certs on Leopard
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-10-03 13:57:33 -05:00
Jack Nagel
e0c53c56e4 audit: improve SF 'use_mirror' detection
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-10-02 15:46:09 -05:00
Jack Nagel
be9d91b2b8 audit: match #{prefix}/libexec and prefix+'libexec'
These were being picked up as just "#{prefix}/lib" and prefix+'lib' due
to the eagerness of the regex. Reordering "lib" and "libexec" will take
care of it; I couldn't think of a more clever solution.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-09-28 14:42:04 -05:00
Jack Nagel
9bce115e9a doctor: remove redundant sentence
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-09-27 23:35:30 -05:00
Jack Nagel
dec66e951a update: correct failing tests
Commit dec4b73aa0 ("Allow `brew update --rebase`") changed the format of
the `git pull` command slightly, introducing an extra space (to allow
for the --rebase option), so let's update the test expectations for this.

We still need to write tests for '--rebase', but in the meantime they
once again pass for the normal case.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-09-21 17:37:36 -05:00
Jack Nagel
27d2a95e8f Correctly parse ImageMagick bottle version
Commit 2695821e98 ("Only use the bottle if its version is up-to-date")
essentially broke the ImageMagick bottle, because the version parsing
logic returns "1" as the bottle version.

Fixing this requires only a slight modification to the bottle URL regex;
includes a test.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-09-21 17:29:14 -05:00
Jack Nagel
51f010ac39 audit: recognize options used with 'ARGV.flag?'
A few formula use ARGV.flag? instead of ARGV.include?. This made `audit`
recognize a few undocumented instances of a '--devel' option, but we can
just ignore that like '--HEAD' for now, and change the behavior if we
decide they need to be documented explicitly in each formula.

cf. Homebrew/homebrew#7456.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-09-21 15:25:28 -05:00
Jack Nagel
d817e5e51e doctor: only check git status if repository exists
Closes Homebrew/homebrew#7722.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-09-19 21:49:29 -05:00
Max Howell
28aef26a47 More docs for brew create generated formula tests
To assist those new to stuff.
2011-09-20 03:39:07 +01:00
Charlie Sharpsteen
d05478e85b formula.rb: Move cache dir creation to fetch
So that the cache directory will get created if the user runs `brew fetch`
instead of `brew install` as the first command.
2011-09-19 19:05:44 -07:00
Max Howell
e26797f471 Allow brew update --rebase 2011-09-20 02:30:31 +01:00
Max Howell
6bd47cf0f9 Only try mirrors for CurlDownloadStrategies
Also adjust output text slightly for prettiness.

A possibly useful side effect here is safe_system has a defined Exception (subclassing RuntimeError) now.
2011-09-19 23:30:10 +01:00
Jack Nagel
1dc0775a15 Revert "Pretty-print the "Trying a mirror" message"
This reverts commit af8e3b5aeacdb10a412560e131d631ba733a8346.

Sorry for the noise.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-09-19 12:19:50 -05:00