378 Commits

Author SHA1 Message Date
Jack Nagel
30e273c2d1 Group methods that operate on the linked keg record 2014-06-30 20:30:02 -05:00
Jack Nagel
58e5ac6835 Implement directory? on keg
Fixes Homebrew/homebrew#30484.
2014-06-28 19:43:52 -05:00
Jack Nagel
982a165e52 Use the keg object to manipulate the linked keg record 2014-06-27 16:20:17 -05:00
Jack Nagel
c5fcdb1f21 Convert to pathname before calling relative_path_from
Fixes Homebrew/homebrew#30494.
2014-06-27 14:45:20 -05:00
Jack Nagel
de81350b42 Keg no longer inherits from Pathname 2014-06-26 20:07:11 -05:00
Jack Nagel
62b29e7686 Give Keg#link_dir parameter a more descriptive name 2014-06-26 18:49:08 -05:00
Jack Nagel
64d5aef0bc Fix keg method visibility
Only link_dir needs to be protected
2014-06-26 18:45:34 -05:00
Jack Nagel
2f2f9f185f Deprecate Keg#fname 2014-06-26 16:10:15 -05:00
Jack Nagel
3d69e5ab7b Rename Keg#fname to Keg#name 2014-06-24 19:09:09 -05:00
Jack Nagel
b98f7277a4 Keg#unlink only removes a linked keg entry *for that keg* 2014-06-23 22:55:23 -05:00
Jack Nagel
cf19ccb436 The linked keg entry is foremost a symlink 2014-06-23 22:55:23 -05:00
Jack Nagel
892e763b0b Initialize linked_keg_record in the Keg constructor 2014-06-23 22:55:23 -05:00
Jack Nagel
76e86891e4 Remove opt link in Keg#uninstall 2014-06-23 22:34:41 -05:00
Jack Nagel
bcfc9d8cf7 Remove linked kegs directory when empty 2014-06-23 22:34:41 -05:00
Jack Nagel
e3f082c294 Stop joining symbols to pathnames
Ruby 2.2's native Pathname#/ accepts only string-like objects.
2014-06-09 14:57:21 -05:00
Jack Nagel
c6c7623591 Prefer Dir[] to Dir.glob when not passing a block 2014-05-30 12:41:12 -05:00
Jack Nagel
6b5e92ac47 Raise AlreadyLinkedError when a keg is already linked 2014-04-21 12:43:06 -05:00
Jack Nagel
b2e8c4e79a Only unlink after a LinkError 2014-04-21 12:43:06 -05:00
Jack Nagel
727f204760 Raise useful errors from make_relative_symlink 2014-04-21 12:43:06 -05:00
Jack Nagel
d3ab439b7c Rework make_relative_symlink error handling and move it into keg 2014-04-21 12:43:06 -05:00
Jack Nagel
90574a6a4b Drop conditional that is always false 2014-04-06 14:01:06 -05:00
Jack Nagel
8c88d48af7 More correct "symlink already exists" check 2014-04-05 12:17:19 -05:00
Jack Nagel
ce1f598e98 Avoid realpath where it is not necessary
Symlinks in opt and LinkedKegs point directly at a keg in the cellar, so
only resolving one symlink should suffice, and make it clear what path
we are actually interested in.
2014-04-05 12:17:19 -05:00
Jack Nagel
d88c79f3cf Use resolved_path instead of dirname and readlink directly 2014-03-31 22:39:41 -05:00
Jack Nagel
b29be4c9a5 Remove default value from Keg#link_dir mode parameter
Now that this is always called with an explicit mode argument, let's
make sure it stays that way.
2014-03-31 21:33:37 -05:00
Jack Nagel
75af625c17 Pass the link mode to resolve_any_conflicts 2014-03-31 21:33:37 -05:00
Jack Nagel
e21a1fab51 Move initializer after constants and class methods 2014-03-27 22:35:08 -05:00
Jack Nagel
685bf070d1 Fix class definition so we can require files first 2014-03-27 22:34:22 -05:00
Jack Nagel
02a1d71871 Don't mix boolean operator types 2014-03-27 17:37:38 -05:00
Jack Nagel
7c5e0eb507 Put constant strings in a constant 2014-03-27 17:14:55 -05:00
Jack Nagel
cb9ee747e0 Fix Keg#find so we don't have to deal with it everywhere
lol inheritance
2014-03-27 17:06:05 -05:00
Mike McQuaid
916e751596 keg: add delete_pyc_files! method. 2014-03-13 10:05:20 +00:00
Jack Nagel
9030c19418 Don't chdir just to do a glob 2014-03-11 18:45:55 -05:00
Jack Nagel
6008187d5f Encode formula revision in installation prefix
In order to allow kegs built with the same version but differing formula
revisions to coexist, we must encode the revision as part of the keg's
name. This is necessary to actually perform an upgrade, as we cannot
upgrade a keg in-place, and temporarily moving it pending the result of
the upgrade is error-prone and potentially slow.

To accomplish this, we introduce a new Formula#pkg_version method that
concatenates the active_spec version with the formula revision. An
exception is made for a formula that has no revision: the tag is
omitted. This preserves compatibility with existing installations.
2014-03-05 20:12:51 -06:00
Adam Vandenberg
bb5a2b587e Always keep info files
Closes Homebrew/homebrew#26659.
2014-02-23 08:30:50 -08:00
Mike McQuaid
d8d76da55f keg: add function to detect if .app(s) installed. 2014-01-19 14:19:07 -08:00
Mike McQuaid
744a8944b0 caveats: show python caveats if modules installed. 2014-01-04 13:19:20 +00:00
Jack Nagel
935091cd8e Pathname#extname returns a string 2013-12-14 09:35:57 -06:00
Adam Vandenberg
040d655d8d add lib/dtrace to non-owned directories 2013-11-17 10:34:19 -08:00
Mike McQuaid
a6e2245732 git_etc: update based on bottle etc/var changes. 2013-10-10 16:46:47 +01:00
Mike McQuaid
ab20ed0bc2 Optionally use git to keep brew etc versioned.
Still in alpha state.
Handles defaults and merging changes with new versions.
Enable by setting the HOMEBREW_GIT_ETC environment variable.

Closes Homebrew/homebrew#15751.
Closes Homebrew/homebrew#17713.
2013-09-07 13:39:43 +01:00
Samuel John
ad80b10de4 Keg should link symlinks directly.
If the `src` in the Cellar of a formula is a symlink to another dir
in the same Cellar (for example `Frameworks/QtGui.framework` is a
symlink to `lib/QtGui.framework`), then we should make a symlink
directly instead of possibly creating an empty dir.

This is needed because Ruby's `find` does not follow symlinks (newer
versions can, but we have to support 10.8 for a long time).

Currently this probably only occurs for Qt, where we put symlinks
into the Cellar/Frameworks and the frameworks linking code is a bit
special to create a directory to "merge" together different versions
of the same framework from different formulae. See `python` and
`python3`; both install `Python.framework` and only one can be the
`Current` but the other should still be put into
`Python.framework/Versions`. Therefore `Python.framework` has to
be a dir and no symlink.
2013-08-14 21:46:42 +02:00
Jack Nagel
966e82663f Make usage of ObserverPathnameExtension more obvious
Remove use of globals.

Closes Homebrew/homebrew#21795.
2013-08-10 19:02:00 -05:00
Jack Nagel
d5325eb4e4 Always prune empty toplevel directories when unlinking
Closes Homebrew/homebrew#21750.
2013-08-09 20:55:54 -05:00
Jack Nagel
e4b951520a Keep track of pruned parent directories 2013-08-09 20:50:43 -05:00
Jack Nagel
36f5452ae3 Handle mkpath of node_modules directory in keg 2013-07-31 13:51:05 -05:00
Adam Vandenberg
7964aa6648 keg: more gnome folders 2013-07-13 10:15:54 -07:00
Adam Vandenberg
e805b8636c Show symlink target if linking fails
Closes Homebrew/homebrew#21060.
2013-07-10 08:54:18 -07:00
Adam Vandenberg
6a83404fd5 add mime-info to Gnome folders 2013-07-08 09:59:45 -07:00
Adam Vandenberg
9fdfdc5680 Better handling of Gnome desktop files
Gnome desktop support has a lot of folders in share that should be created
directly in share, rather than shared.

Add these folders to keg, and don't link any icon cache files into share.

Closes Homebrew/homebrew#20340.
2013-07-02 08:59:33 -07:00