816 Commits

Author SHA1 Message Date
Xu Cheng
09c810c7f4 add link_overwrite DSL
Sometimes we accidentally install files outside prefix. After we fix that,
users will get nasty link conflict error. So we create a whitelist here to
allow overwriting certain files. e.g.
  link_overwrite "bin/foo", "lib/bar"
  link_overwrite "share/man/man1/baz-*"

During FormulaInstaller#link, the whitelist conflict files will be
backup into HOMEBREW_CACHE/Backup
2015-08-23 21:43:03 +08:00
Xu Cheng
9f20679366 formula_installer: fix when bottle pouring when creating new bottle
Formula#bottle_specification always exists, while Formula#bottle only
exists if the bottle is available and compatible.
2015-08-22 14:19:22 +08:00
Xu Cheng
a88c40b8c8 core file style update 2015-08-22 13:15:33 +08:00
Misty De Meo
727239e12f Merge bottle install without Xcode branch
Merge branch 'bottle_hooks'
2015-08-21 11:04:22 -07:00
William Woodruff
12b25f59cc Only print dep installation notice when deps will be installed 2015-08-21 11:02:33 -07:00
William Woodruff
8793a68ee4 Add no-Xcode documentation for all classes, methods 2015-08-21 11:02:33 -07:00
William Woodruff
1face808f5 Add guards to calls that would trigger Xcode install requests
add guard in Formula#file_modified? to prevent git popup

add guard in Superenv.bin before calling MacOS::Xcode.version

add guard against missing Xcode/CLT in Xcode.uncached_version

return nil instread of 0 in uncached_version when Xcode/CLT are not present, to distinguish from linuxbrew behavior

checks against pour_bottle? and needs_relocation?, add guard around keg.relocate_install_names to check pour_bottle?/needs_relocation? as well

needs_relocation? becomes skip_relocation?, use cellar attr to indicate relocation instead of does_not_need_relocation

MacOS.can_build? becomes MacOS.has_apple_developer_tools?
2015-08-21 11:02:33 -07:00
William Woodruff
f58506ea6f FormulaInstaller: add prevent_build_flags to eliminate code repetition
remove unneeded definition

change variable in FormulaInstaller.check_build_flags from bf to build_flags
2015-08-21 10:59:35 -07:00
William Woodruff
91e598cf3f Install: add BuildToolsError and BuildFlagsError
Add these new errors, and guards in formula installation and
cmd/{,un,re}install to match, move can_build? to the MacOS module,
flatten conditions, remove redundant can_build? check

reinstate removed (doctor) check
2015-08-21 10:59:09 -07:00
William Woodruff
76dcad7c82 Split compute_and_install_dependencies
This is so so that check_dependencies_bottled can be called when bottles
are being poured; implement check_dependencies_bottled
2015-08-21 10:58:45 -07:00
William Woodruff
8aad523063 Formula_installer: only attempt relocation install once
Check @@attempted for cctools so that we only attempt the relocation
install once, skip cxxstdlib check in cctools to prevent otool
execution prior to installation, skip fixing install names if
relocation is not required
2015-08-21 10:57:48 -07:00
William Woodruff
b46d5de492 Requirements: add CctoolsRequirement
Install it as a dependency unless already satisfied by Xcode.

require cctools_requirement

cctools_requirement should be satisfied by cctools present in opt

add build_env => false to the satify block options in CctoolsRequirement
2015-08-21 10:57:20 -07:00
William Woodruff
dcfac4f571 add install_relocation_tools stub 2015-08-21 10:56:46 -07:00
Rafael Kitover
74b18bfe12 put caveats in finish after post_install Homebrew/homebrew#42565
When running brew -v install, long post_install output from the formula,
presumably from upstream, may hide the important instructions in the
caveats and confuse the user. For example, postgresql runs initdb which
prints its own instructions for running the database, making the caveats
scroll off screen.

Per xu-cheng's instructions in Homebrew/homebrew#42565 :

Remove the explicit call to caveats from the install, reinstall, and
upgrade commands, as well as the dependency installer code in
FormulaInstaller#install_dependency , and call caveats right before the
summary code in FormulaInstaller#finish .

Closes Homebrew/homebrew#42565.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-08-09 20:08:42 +08:00
Xu Cheng
e60dc64828 only run post_install if it's defined
Closes Homebrew/homebrew#42593.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-08-08 17:50:49 +08:00
BrewTestBot
13d544e11e Core files style updates.
Closes Homebrew/homebrew#42354.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-08-03 13:22:35 +01:00
Xu Cheng
2ebd1c974b print sandbox message
Closes Homebrew/homebrew#42293.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-07-31 19:52:36 +08:00
Xu Cheng
8c7b629149 formula_installer: relocate bottle immediately after it's poured
Closes Homebrew/homebrew#42268.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-07-30 20:11:19 +08:00
Xu Cheng
1845706187 formula_installer: better priority for pour_bottle? 2015-07-24 16:08:44 +08:00
Dominyk Tiller
2751449abb formula_installer: tweak priority of true
Closes Homebrew/homebrew#41913.

Signed-off-by: Dominyk Tiller <dominyktiller@gmail.com>
2015-07-23 22:29:31 +01:00
Dominyk Tiller
b06af00d76 formula_installer: don't flag fs builds 2015-07-23 22:28:07 +01:00
Xu Cheng
8cebb64eec auto disable sandbox for interactive shell
Closes Homebrew/homebrew#38792.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-07-22 15:12:15 +08:00
Alex Dunn
da2e4d417d fetch/build formula from source when modified
closes Homebrew/homebrew#36068

Closes Homebrew/homebrew#41397.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-07-18 19:30:30 -07:00
Xu Cheng
05c0fcb5ee formula_installer: remove duplicated hold_locks check
It'll be checked inside `FormulaInstaller#unlock` method.

Closes Homebrew/homebrew#41820.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-07-18 13:59:52 +08:00
Jack Nagel
7690a00d04 Stdlib check should use the compiler used to build the bottle 2015-06-27 20:04:45 -04:00
Jack Nagel
f13ac9b0c8 Decouple the local bottle strategy from the formula 2015-06-15 21:32:15 -04:00
Misty De Meo
6d5632cd8f Formula: always print keg_only_text
Fixes Homebrew/homebrew#40724.

Closes Homebrew/homebrew#40725.

Signed-off-by: Misty De Meo <mistydemeo@gmail.com>
2015-06-15 08:21:08 -07:00
Mike McQuaid
a631ae1983 formula_installer: don't install runtime dependencies from bottles.
They haven't been linked against so we don't care.

Closes Homebrew/homebrew#40410.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-06-10 15:25:28 +01:00
Xu Cheng
12f0472a7d formula_installer: use Formula#full_name 2015-05-29 17:02:23 +08:00
Mike McQuaid
fc5070c252 formula_installer: set tap source for bottles.
This defaults to the value that's in the bottle but that isn't
necessarily correct. For example, some Boxen modules will reuse our
old bottles and so if they are installed from there we should be sure
to set the tab's tap to the tap we've installed from rather than the one
set inside the bottle's tarball.

Closes Homebrew/homebrew#40096.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-05-27 10:21:46 +01:00
Jack Nagel
e04e898d5c Avoid explicit control flow 2015-05-12 20:33:34 -04:00
Jack Nagel
71f4e90cdb Handle deprecated options in dependency specifications
Fixes Homebrew/homebrew#38069.
2015-05-11 22:07:14 -04:00
Xu Cheng
272d68740f Use TapFormulaUnavailableError instead of HOMEBREW_TAP_FORMULA_REGEX
Closes Homebrew/homebrew#39307.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-05-03 22:53:22 +08:00
Jack Nagel
2ca8172fe9 Let the test environment inject its own load path 2015-04-29 19:15:11 -04:00
Jack Nagel
16dfe3dd40 Add Formula#logs 2015-04-25 23:14:05 -04:00
Xu Cheng
adedbb86f1 sandbox: record log
Closes Homebrew/homebrew#38711.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-04-17 14:09:24 +08:00
Jack Nagel
c2dcd91bd1 Eliminate a place where ARGV is mutated 2015-04-16 22:20:59 -04:00
Xu Cheng
d1617e86d0 sandbox postinstall
Closes Homebrew/homebrew#38479.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-04-15 19:51:54 +08:00
Xu Cheng
a6be0b5bb8 sandbox: redesign API 2015-04-15 19:51:54 +08:00
Xu Cheng
06f72ab38f move safe_fork into a standalone method 2015-04-15 19:51:54 +08:00
Xu Cheng
2f529220e7 preliminary write control only sandbox
Closes Homebrew/homebrew#38361.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-04-09 17:42:54 +08:00
Xu Cheng
f5c8e3fdbd Use UNIXSocket to pass file descriptor
This is a more standard way to pass fd in UNIX world.
At the same time, it helps to remove a few hacks and
simplifies the code in the sandbox.

Closes Homebrew/homebrew#38434.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-04-09 15:31:47 +08:00
Xu Cheng
1539fda3e8 Silently ignore FormulaUnavailableError in check_conflicts
If the formula name is in full-qualified name. Let's silently
ignore it as we don't care about things used in taps that aren't
currently tapped.

Closes Homebrew/homebrew#38089.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-03-28 13:08:08 +08:00
Xu Cheng
4fccab615f install_plist: create var/log path
Let homebrew create var/log path to avoid permission problem.

Closes Homebrew/homebrew#37966

Closes Homebrew/homebrew#37967.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-03-23 18:35:58 +08:00
Jack Nagel
cd522b1719 Always respect build options when invoking post_install
Fixes Homebrew/homebrew#36335.
2015-02-07 11:02:35 -05:00
Jack Nagel
909a5af075 Omit post-install warning unless formula defines it
Closes Homebrew/homebrew#34744.
2015-01-12 21:57:47 -05:00
Jack Nagel
318c103802 Remove unnecessary encoding comments
These files do not contain any non-ASCII characters.
2015-01-03 23:44:26 -05:00
Jack Nagel
a52143c63c Remove readline and zlib hacks 2015-01-03 22:39:07 -05:00
Jack Nagel
77a1c6f166 One less external call to #active_spec 2014-12-27 14:26:56 -05:00
Jack Nagel
dd90030213 Fix "possible reference to past scope" warnings on 2.2 2014-12-26 11:58:09 -05:00