872 Commits

Author SHA1 Message Date
Vlad Shablinsky
072e5df4ed
Cache outdated_versions for Formula
Closes #584.

Signed-off-by: Xu Cheng <xucheng@me.com>
2016-08-06 21:25:57 +08:00
Vlad Shablinsky
001bef0604
formula: detect outdated HEAD in outdated_versions 2016-08-06 21:25:56 +08:00
Vlad Shablinsky
a59bdc4a2a
formula: don't return outdated head in installed_prefix 2016-08-06 21:25:56 +08:00
Vlad Shablinsky
1b88c2912b
formula: add new HEAD methods
* add `latest_head_version` to return latest HEAD version installed
* add `latest_head_prefix` to return Pathname with latest HEAD version
* add `head_version_outdated?` to check if HEAD version is up-to-date
2016-08-06 21:25:56 +08:00
Xu Cheng
a8566c9848 various: eliminate the usage of any? (#638)
`any?` is not the opposite of `empty?`. Besides the case that
`[false, nil].any?` will return false, `any?`(O(n)) has much worse
performance than `empty?`(O(1)).
2016-08-05 22:01:32 +08:00
Xu Cheng
e008f6e53c
remove unnecessary build options manipulation for test and postinstall
We already loaded build options in ARGV.resolved_formulae for test and
postinstall
2016-07-18 18:11:53 +08:00
Vlad Shablinsky
4b2c4ef258
Update and test eligible_kegs_for_cleanup
Closes #478.

Signed-off-by: Xu Cheng <xucheng@me.com>
2016-07-16 20:39:14 +08:00
Vlad Shablinsky
3fb5d70a72
Unify Version.create usage
Substitue each Version.new and HeadVersion.new with Version.create
to unify Version and HeadVersion instantiation among core code.

Note that this does not relate to Mac::OS::Version class.
2016-07-16 20:39:13 +08:00
Vlad Shablinsky
2e916110e4
Use HeadVersion for install/reinstall 2016-07-16 20:39:13 +08:00
Xu Cheng
de366f71b9 respect user's curlrc file (#516)
Users may have ~/.curlrc file to include options like proxies.
However, since we overwrite HOME environment variable during the build
and test, curl won't be able to find it.

This commit solves this issue by using CURL_HOME environment variable,
which will be pointed to the original HOME path.

From `curl(1)`:
> 1) curl tries to find the "home dir": It first  checks  for  the
     CURL_HOME and then the HOME environment variables. Failing that,
     it uses getpwuid() on Unix-like systems (which returns the  home
     dir  given the current user in your system). On Windows, it then
     checks for the APPDATA variable, or as a last resort the '%USER-
     PROFILE%\Application Data'.
2016-07-15 20:55:34 +08:00
Vlad Shablinsky
4aedeea96d formula: simplify migration_needed? 2016-07-02 00:29:45 +02:00
Vlad Shablinsky
9c15174e3c
formula: simplify outdated_versions logic 2016-06-29 21:04:27 +08:00
Elliot Saba
e9cc2a5d88 Add "build_dependencies" key to JSON output (#340)
This gives the JSON output the same type of information as
`recommended_dependencies` or `optional_dependencies`, but for those
marked `:build` in the formula.
2016-06-12 02:03:08 +02:00
Mike McQuaid
375efe0945 Remove LLVM-GCC support. (#252)
At this point it's never a good compiler to use so let's just remove it.
2016-05-22 09:40:08 +01:00
Mike McQuaid
95c3a31b33 Revert "Switch to bbatsov's Style Guide since GitHub's is 404" (#250) 2016-05-18 09:44:36 +01:00
Mike McQuaid
aae447996c formula: deprecate startup_plist.
Closes #228.
2016-05-13 08:45:37 +01:00
Martin Afanasjew
4ea2f9dc91 Fix more bad dump_verbose_config references
Follow-up to c7edf9a063dce63afb9ab54b6d71fe864d578365 and related to
changes from #168.
2016-05-08 21:43:57 +02:00
Mike McQuaid
931e292bf1 Make bottle code cross-platform. 2016-05-08 16:51:22 +01:00
Andrew Janke
d887dd39ec brew install: make -s apply only to given formula, not deps (#205) 2016-05-06 12:02:13 -07:00
Andrew Janke
066489a2b3 Switch to bbatsov's Style Guide since GitHub's is 404 (#189)
Fixes #106
2016-05-03 08:13:22 -04:00
Martin Afanasjew
8600b9edf1 Update Homebrew/homebrew references in comments
Replace `homebrew` with `brew`, `homebrew-core`, or `legacy-homebrew`
depending on context.
2016-05-02 21:19:09 +02:00
Andrew Janke
258a764f67 stage: fix block signature back-compatibility under Ruby 1.8.7
The new stage() signature introduced by #66 breaks back-compatibility
under Ruby 1.8.7. This fixes it by switching back to a one-argument
block signature and using a new class to wrap both the Resource and
Mktemp info for the staging context, in a signature-back-compatible
way.

Addresses homebrew/homebrew-core#529.

Closes #135.

Signed-off-by: Andrew Janke <andrew@apjanke.net>
2016-04-22 21:49:00 -04:00
Andrew Janke
acc9a7ca85 brew test, install, update-test: add --keep-tmp option
Also enables sandbox for --interactive and --debug use of install
and test, using automatic retention.

Closes #66.

Signed-off-by: Andrew Janke <andrew@apjanke.net>
2016-04-18 12:23:08 -04:00
Xu Cheng
e806003cc7 Formula#path: update doc
Formulae are all in taps now.
2016-04-05 13:19:16 +08:00
Mike McQuaid
276a797d37 Update documentation after repository split. 2016-04-03 14:03:33 +01:00
Xu Cheng
a5cfc011e0 various: Homebrew/core is the core tap
Also make `Homebrew/homebrew` as an alias of this tap to keep
backward compatibility.
2016-04-02 21:51:36 +08:00
Xu Cheng
28f3dae8cd rename CoreFormulaRepository to CoreTap
Core tap will be separated from core code in the near future.
It makes sense to rename it to CoreTap.
2016-03-07 19:43:46 +08:00
Usman Akeju
bbe4191c61 formula: sort outdated versions naturally.
Because the versions are read from directory listings, we get
alphabetical sorts of version numbers in `brew outdated` output:

   some-keg (10.1.10, 10.1.11, 10.1.9 < 10.1.12)

This is nicer:

   some-keg (10.1.9, 10.1.10, 10.1.11 < 10.1.12)

Closes Homebrew/homebrew#49534.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2016-02-26 09:04:05 +00:00
Xu Cheng
b52af53e71 various: use Tap abstraction
formula_rename and tap_migrations are now handled inside Tap.

Closes Homebrew/homebrew#49549.

Signed-off-by: Xu Cheng <xucheng@me.com>
2016-02-26 17:00:17 +08:00
Mike McQuaid
26ec9f9ea0 formula: add new pour_bottle DSL with reason.
This allows there to be a user-visible description of why a bottle is
not being installed.
2016-02-18 10:21:20 +00:00
Xu Cheng
12a452557d make HOMEBREW_BREW_FILE a Pathname object
Currently HOMEBREW_BREW_FILE is a String, while other of HOMEBREW_*
variables are all Pathname. This commit unifies them all as Pathname,
so it will not cause any confusion.

Closes Homebrew/homebrew#48872.

Signed-off-by: Xu Cheng <xucheng@me.com>
2016-02-06 02:52:48 +08:00
Tim D. Smith
2e2d2ab6ab allow PYTHONPATH to override Homebrew site-packages 2016-01-27 09:52:24 -08:00
Misty De Meo
09ba000be1 Permit cleanup to remove outdated keg-only formulae
This check is not really relevant anymore; old-style, pre-opt installs
date from 2012 at the very latest, so it is very unlikely that any
packages remain which still link against these.

Refs Homebrew/homebrew#48139.
2016-01-18 10:10:09 -08:00
John Zeringue
a600262f68 formula: output recommended/optional deps in JSON.
Fixes Homebrew/homebrew#47914 by distinguishing between required, optional, and
recommended dependencies when using `brew info --json=v1`. This is done
by adding the `optional_dependencies` and `recommended_dependencies`
fields to the JSON output.

A good example of this fix is `brew info --json=v1 dtrx`.

Closes Homebrew/homebrew#48196.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2016-01-18 08:45:58 +00:00
Xu Cheng
6c8c56a689 build: store source modified time in tabfile 2016-01-15 16:26:04 +08:00
ilovezfs
07e849e7f4 Fix built_as_bottle in Formula's to_hash
This was caused by a "race" between two commits.
bash-3.2$ git log -n1 --format=%ai 3344229
2012-08-15 22:08:40 -0500
bash-3.2$ git log -n1 --format=%ci 3344229
2012-09-17 20:01:37 -0500
bash-3.2$ git log -n1 --format=%ai 8837423
2012-08-25 11:31:57 -0700
bash-3.2$ git log -n1 --format=%ci 8837423
2012-08-25 11:52:37 -0700

"built_bottle" was renamed "built_as_bottle" in 8837423 after the date
3344229 was authored but before the date it was committed to master, and
unfortunately in the interim 3344229 hadn't been updated to reflect the
name change.

This commit changes the Formula class's to_hash method to use
tab.built_as_bottle not tab.built_bottle, which doesn't exist. At this
time, there is no way that to_hash could have known that
tab.built_bottle is bogus. Perhaps this could be made safer in the
future, so that non-existent methods cause an error here rather than
just silently returning null.

Closes Homebrew/homebrew#47912

Closes Homebrew/homebrew#47916.

Signed-off-by: Xu Cheng <xucheng@me.com>
2016-01-12 17:41:31 +08:00
Dominyk Tiller
a508f9f94b Revert "formula: pass sdk_path in std_cmake_args"
This reverts commit 5896555e5352b5e4f16f583ea444942cd1fc56bd.

It caused header-location issue on dual-developer-tool systems for certain
formulae. Will need looking at again, but we'll probably have to try and
do this a different way.

Closes Homebrew/homebrew#47668.
2016-01-05 17:29:48 +00:00
Mateusz Lenik
47afde940a formula: fix undefined method error
Fixes: Homebrew/homebrew#47673.
Closes Homebrew/homebrew#47672.

Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
2016-01-04 16:16:53 +01:00
Baptiste Fontaine
9bdd6619e2 cleanup: move code away from cmd/
Closes Homebrew/homebrew#47484.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2016-01-04 13:17:21 +01:00
Dominyk Tiller
2af64920fa formula: pass sdk_path in std_cmake_args 2015-12-29 13:27:23 +00:00
Baptiste Fontaine
169b8fc039 Revert "minor perf improvements"
This reverts commit 16a2a8274a7808e63a6c78475e12a7c0ef5812ef.
2015-12-26 23:00:38 +01:00
Baptiste Fontaine
48681c3f3a minor perf improvements
Closes Homebrew/homebrew#47224.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2015-12-26 22:58:26 +01:00
Alex Wang
d09698f19f Add -DNDEBUG to std_cmake_args
CMake has -DNDEBUG and -O3 as its default flags for Release builds.
Homebrew clears out the default CMake flags, which is fine for
optimization because Homebrew passes its own optimization flag(s).
-DNDEBUG wasn't added back in, though.

This ensures -DNDEBUG is passed to CMake release builds by default,
instead of individual formulas having to add it explicitly.

This also removes explicit additions of -DNDEBUG from the formulae that
had them -- gflags, llvm, and taglib.

Closes Homebrew/homebrew#47378.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-12-26 21:50:51 +00:00
Xu Cheng
0f84b976ba move CoreFormulaRepository into separate file
For users whose local brew is at around 2015-06-11 to 2015-08-06,
running `brew update` will emit following error:

  Error: uninitialized constant Formulary::CoreFormulaRepository

This is caused by the same bug described in Homebrew/homebrew#42553.

This commit workarounds this issue and restores `brew update` compatibility
for users mentioned above.

Also cleanup legacy `require "cmd/tap"`.
2015-12-19 22:05:30 +08:00
Xu Cheng
5debd5b132 Formula#tap: returns tap object 2015-12-09 16:56:59 +08:00
Xu Cheng
871ec75524 Formula: use CoreFormulaRepository, avoid duplicated logic 2015-12-09 16:56:59 +08:00
Mike McQuaid
b745546943 Overhaul, simplify and cleanup documentation.
Remove duplication, link to the API documentation more often,
tweak wording, add `@UniqMartin` as a maintainer, note `@jacknagel`'s
and `@adamv`'s significant past contributions to Homebrew, delete some
outdated or unneeded documentation, add some missing `Formula` API.
entries and simplify/improve `CONTRIBUTING.md`.

Closes Homebrew/homebrew#46179.

Closes Homebrew/homebrew#46618.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-12-07 13:37:49 +00:00
Xu Cheng
48950f2cc0 centralize the logic of handling homebrew- in Tap.fetch
Closes Homebrew/homebrew#46537.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-12-03 13:46:59 +08:00
Xu Cheng
0686ebfcc0 formula: use installed_prefixes/installed_kegs
Closes Homebrew/homebrew#46463.
2015-11-29 20:24:30 +08:00
Xu Cheng
6273d464ee add Formula#installed_prefixes and Formula#installed_kegs 2015-11-29 20:24:30 +08:00