Commit Graph
112 Commits
Author SHA1 Message Date
Adam Vandenberg f7fbbe79f4 Remove adamv-alt references.
Closes #20364.
2013-06-09 07:32:06 -07:00
Adam Vandenberg ebc38db960 Sniff for non-tarred gzips
Don't try to untar non-tarred gzips.
2013-06-08 15:37:32 -07:00
Desmond Brand fc565bee26 Overwrite broken symlinks with --overwrite
Closes #19480.

Signed-off-by: Misty De Meo <mistydemeo@gmail.com>
2013-05-09 09:21:34 -05:00
Jack Nagel e51d0e4d0c Only remove DS_Store on ENOTEMPTY 2013-04-27 15:21:05 -05:00
Jack Nagel 9d1a86cda1 Avoid calling to_s on the same Pathname multiple times 2013-04-20 13:50:42 -05:00
Jack Nagel 4a0d57283e Performance fix for Pathname#prepend_prefix
See 05a456c231dc6da7cb0f7c70cb21feaf9a0d803c; same story.
2013-04-14 22:38:18 -05:00
Jack Nagel 05a456c231 Performance fix for Pathname#chop_basename
This is an internal method, but is called a bunch of times in
performance-critical codepaths, and is ultra slow because the constant
is interpoplated into the Regexp each time the method is called.

Alas, this has been fixed in Ruby 1.9+.
2013-04-14 21:56:04 -05:00
Jack Nagel bd15c06992 Recognize 7z files by magic bytes, not filename 2013-04-03 23:30:32 -05:00
Jack Nagel d52032f748 Adjust BOTTLE_EXTNAME_RX for :snow_leopard_32 2013-03-09 17:38:49 -06:00
Jack Nagel 18ff8a67fb Fix Regexp encoding under 1.9/2.0 2013-02-10 15:26:07 -06:00
Mike McQuaid 1da2d5dd92 Remove MD5 support.
Closes #17317.
2013-01-30 22:36:12 -08:00
Mike McQuaid 3318b08a2e Don't use underscores in (new) bottle filenames.
Closes #14270
2013-01-29 17:14:09 -08:00
Mike McQuaid e9eac42daa Cleanup old bottle syntax. 2013-01-29 17:14:00 -08:00
Shaun Jackman 47bde804c5 pathname.rb: Pass -s to du instead of -d0
The option `du -s` is equivalent to `du -d0`. The former is a POSIX standard
(IEEE Std 1003.1-2008), whereas the latter is a BSD extension.

From the BSD man page:
`-s Display an entry for each specified file. (Equivalent to -d 0)`

From SUSv4:
`-s Instead of the default output, report only the total sum for each of the specified files.`
http://pubs.opengroup.org/onlinepubs/9699919799/utilities/du.html

Closes #16516.

Signed-off-by: Charlie Sharpsteen <source@sharpsteen.net>
2012-12-11 09:32:16 -08:00
Jack Nagel a5a530573a Rewrite plists when installing from a bottle 2012-11-25 15:11:57 -06:00
Mike McQuaid a1cdf9f64d Overwrite plists. 2012-11-25 20:53:04 +00:00
Adam Vandenberg 1184584bc2 Try to remove a single .DS_Store when uninstalling
Closes #12976.
Closes #15975.
2012-11-14 15:10:08 -08:00
Adam Vandenberg 3cfe157b06 Don't error out if metafiles are linked
Closes #16008.
2012-11-12 20:56:05 -08:00
Adam Vandenberg e7f2e449e7 Teach Pathname how to scan for metafiles 2012-11-11 10:45:58 -08:00
Sijawusz Pur Rahnama 38f121bd68 Add support for 7zip archives
Closes #15723.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-10-29 14:57:23 -05:00
Adam Vandenberg b40e5323ca Pathname: add exec and jar helpers
Closes #13318.
2012-10-27 19:28:42 -07:00
Misty De Meo f52ebe5fc7 brew ln --force is now brew ln --overwrite
* Renames --force to --overwrite, freeing up brew ln --force for #13349
* Changes --dry-run to preview linking by default, rather than
  overwriting. An overwrite dry-run can be simulated via both
  --dry-run --overwrite
* Adds some basic Keg tests
2012-10-20 21:00:46 -05:00
Misty De Meo f899878220 Don't count mkpath in ObserverPathnameExtension
mkpathed directories aren't really "linked" or "unlinked" per se,
and link/unlink handle directories differently. It's easier just to
ignore them, which finally synchronizes link/unlink counts.
2012-10-04 21:37:37 -05:00
Jack Nagel 71dbaaae1b Improve text_executable heuristic
Previously we detected this by reading the first line of the file.
However, "first line" is meaningless when dealing with binary files, but
IO#readline will happily keep reading until it finds a newline
character, which can result in some unnecessarily large buffers.

Aside from the performance issue, this causes an additional problem
under Ruby 1.9: trying to match the binary string against a pattern will
raise ArgumentError (unless the binary string just happens to also be
valid UTF-8, heh).

Fix both issues: only read the first 1024 bytes, as no sane shebang will
ever be that long, and use a plain read(), which returns an ASCII
encoded string even on 1.9.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-09-27 17:26:26 -05:00
Max Howell 0ed5daf86d Produce good error messages for bad tarballs 2012-08-29 12:41:33 -04:00
Jack Nagel 4affbabfb7 Replace version strings with Version objects 2012-08-18 11:12:08 -05:00
Jack Nagel acd2866bbc Move version detection to Version class
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-18 11:12:07 -05:00
Max Howell b96bd9ac3b Don't fail if ENOENT 2012-08-13 10:14:59 -04:00
Brandon Black 8aa4f9dd3b Fix issues with writable? detection in brew doctor
Closes #13689.

Signed-off-by: Max Howell <mxcl@me.com>

There are subtle distinctions between writable? and writable_real? we don't
understand precisely why we need this, but it fixes the bugs :/
2012-08-06 22:02:38 -04:00
Misty De Meo 305495f70a Synchronize Keg#link and #unlink counts
Keg#link would sometimes count a linked file when doing mkpath, even if
the target directory already exists; #unlink would never count it. This
meant that "brew ln" and "brew unlink" counts for the same keg could be
out of sync with each other.
2012-07-29 10:28:41 -03:00
Misty De Meo bf051054b6 link: add --force and --dry-run options
`brew link` can now be made to delete any conflicting files using
the --force argument. It also has a --dry-run option, similar to
git clean -n, which will list any files which would be deleted
without touching the filesystem.

Closes #11811.

Signed-off-by: Misty De Meo <mistydemeo@gmail.com>
2012-07-09 12:01:09 -05:00
Jack Nagel a76bce6898 Decouple pathname from bottles
Pathname is one of the basic building block classes in Homebrew, and as
such it is preferrable that `require`ing it does not drag in other
Homebrew code; thus avoiding circular dependency situations. Its
dependency on bottles.rb gave it an implicit dependency on formula.rb,
among other things.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-07-05 20:32:55 -05:00
Jack Nagel 0c18ffd7fa Refactor checksumming
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-07-04 22:47:33 -05:00
Jack Nagel dc7b620754 Improve Pathname#text_executable? regexp
file(1) does not allow leading whitespace on shebang lines, and there
appears to be no restrictions on what characters follow '#!', either.

While at it, fix an erroneous shebang test.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-06-15 20:06:36 -05:00
Jack Nagel 71fd9b26d7 Handle EOF in Pathname#text_executable?
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-06-03 22:34:28 -05:00
Jack Nagel 96fb03750e Pathname: add Mach-O module
The MachO module contains methods for learning about Mach-O binaries,
and can be used where one might normally shell out to file(1).

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-05-30 22:32:48 -05:00
Adam Vandenberg 0cc9a8fedc Don't unzip war files 2012-05-03 20:40:04 -07:00
Adam Vandenberg 19ed253b2d Detect uncompressed tars
From a patch by @RuiPereira

Closes #12011.
2012-05-03 20:31:00 -07:00
Adam Vandenberg 52732da91b Extract detection of compression types
Separate out detecting compression types from uncompressing and staging.
2012-05-02 19:57:33 -07:00
Mike McQuaid 548d6a54ad Fix Ruby warnings.
Fixes #11966.
2012-05-01 20:45:17 +08:00
Mike McQuaid 45476c7cf1 Change versioned bottle syntax and fix issues.
Fixed #11562.
2012-04-24 18:53:45 +10:00
Mike McQuaid 3300395471 Add and correctly find erlang bottle.
Fixes #11780.
2012-04-24 18:53:33 +10:00
Mike McQuaid 2919ffb8e2 Revert "Add and correctly find erlang bottle."
This reverts commit 146e253856.
2012-04-24 18:10:09 +10:00
Mike McQuaid d60023c466 Revert "Change versioned bottle syntax and fix issues."
This reverts commit f80908bead.
2012-04-24 18:10:08 +10:00
Mike McQuaid 146e253856 Add and correctly find erlang bottle. 2012-04-24 18:08:14 +10:00
Mike McQuaid f80908bead Change versioned bottle syntax and fix issues.
Fixed #11562.
2012-04-24 18:08:14 +10:00
Misty De Meo 31394247e4 make_relative_symlink: give more specific advice 2012-04-09 10:09:19 -05:00
Adam Vandenberg ef416878d5 Show target path when empty 2012-03-30 23:02:43 -07:00
Adam Vandenberg 423a8c34fe install: warn when passed no files
Rationale: we warn when inreplace makes no changes; this is a similar
sort of warning. We expected some list (probably via Dir) to include
some files, but none were found.

Either the list was wrong, or the install can now be omitted.
2012-03-30 22:36:45 -07:00
Max Howell 45d9bb28ec Don't double print ln message in verbose mode
Refs #11091.
2012-03-22 09:33:41 +00:00