44 Commits

Author SHA1 Message Date
Tsukasa OMOTO
54004a4759 Make the on-disk representation of taps unambiguous
This commit supports "-" and "_" in names of user and repository.

Closes Homebrew/homebrew#28203.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2014-04-24 17:10:41 -05:00
Jack Nagel
cfee535786 Remove now unnecessary realpath calls 2014-04-06 00:31:07 -05:00
Jack Nagel
0129542ede Update bottle command for generalized bottle implementation 2014-03-10 14:56:02 -05:00
Mike McQuaid
1fecd418e4 versions: ignore validation errors.
References Homebrew/homebrew#26748.
2014-02-16 18:35:33 +00:00
Jack Nagel
c95b90a022 Don't send, just call the method directly 2013-12-27 16:19:43 -06:00
Jack Nagel
4e11656e01 versions: improve performance of rev_list 2013-12-17 20:43:45 -06:00
Jack Nagel
1b7718f6a7 bottle: determine revision more reliably
Closes Homebrew/homebrew#25100.
2013-12-10 16:39:13 -06:00
Jack Nagel
a933b58507 versions: restore original constant
Before:

  f1 = Formula.factory('tree')
  f1.versions
  f2 = Formula.factory('tree')
  f1.class == f2.class # => false

After:

  f1 = Formula.factory('tree')
  f1.versions
  f2 = Formula.factory('tree')
  f1.class == f2.class # => true
2013-12-09 21:13:45 -06:00
Jack Nagel
c3ac88d8c7 versions: delete unused method 2013-12-09 17:34:04 -06:00
Jack Nagel
cc4776cc23 versions: fix bottle filename usage 2013-12-08 16:41:35 -06:00
Mike McQuaid
1aba456888 versions: announce deprecation.
They break often so we should think, longer-term, about removing it
altogether but may as well give users fair warning before that point.

Closes Homebrew/homebrew#24220.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2013-11-14 16:39:00 +00:00
Mike McQuaid
202c6ef826 global: add more tap regexes. 2013-10-30 11:19:46 -07:00
Mike McQuaid
fdc08424af versions: fix bottle_filenames.
Previously if a bottle had no checksum for a particular platform (i.e.
currently there are no Mavericks bottles) then it would generate a
different revision (and thus filename) to the rest of the bottles being
generated which meant bottles needed to be manually renamed.

Instead check the actual bottle object's checksums to make sure that
we've looked at the previous bottles for all platforms rather than just
the current one.
2013-10-28 10:26:04 +00:00
Mike McQuaid
c883286840 versions: use bottle_filename only if f.bottle. 2013-09-22 16:01:02 +01:00
Mike McQuaid
82eee276e3 versions: add bottle filenames method.
Closes Homebrew/homebrew#22727.
2013-09-22 09:52:05 +01:00
Mike McQuaid
22e47ffa43 versions: add branch support in rev_list. 2013-09-22 09:52:05 +01:00
Mike McQuaid
4702774616 versions: split version_for_sha and use yield. 2013-09-22 09:52:05 +01:00
Adam Vandenberg
1e6e1dde4c Don't always show an error at the end of brew versions 2013-07-03 10:06:11 -07:00
Adam Vandenberg
472b6e4fe1 versions: pass string to factory
Closes Homebrew/homebrew#20951.
2013-07-01 16:46:05 -07:00
Adam Vandenberg
8e944d5728 Add 'unload' 2013-06-29 16:44:45 -07:00
Jack Nagel
9b5cb6cfb6 Allow brew versions to work with underspecified formulae 2013-04-27 14:44:48 -05:00
Jiang Xin
f30200890e versions: work for tapped formulae
brew versions is hardcoded to cd to HOMEBREW_REPOSITORY before running
git, and as such fails to report previous versions for any formulae
from a tapped repository.

Add two new private methods repository and entry_name to replace the
hardcoded HOMEBREW_REPOSITORY and formula path, and brew versions
work for both builtin and tapped formulae.

Closes Homebrew/homebrew#12356.
Closes Homebrew/homebrew#19069.

Reported-by: Misty De Meo <mistydemeo@gmail.com>
Suggested-by: Jack Nagel <jacknagel@gmail.com>
Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2013-04-11 23:45:15 -05:00
Jack Nagel
47a8a312e3 versions: add debug output 2013-03-21 17:05:02 -05:00
Jack Nagel
d274f7a8a0 versions: remove unnecessary variable 2013-03-21 17:04:54 -05:00
Russell Teabeault
ad622a9e87 versions: unload constant before calling Formula.factory
Closes Homebrew/homebrew#18634.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2013-03-21 13:26:56 -05:00
Jack Nagel
6486c94932 versions: remove FIXME
I understand how this works now, and it is definitely necessary.
2013-03-18 15:10:37 -05:00
Jack Nagel
329f0a8490 Replace version strings with Version objects 2012-08-18 11:12:08 -05:00
Jack Nagel
68124d481f Unify 'which' and which_s' utility methods
'which' only returns a Pathname or nil, and doesn't care about anything
sent to stderr, so just silence it by default and combine the two
methods.

Closes Homebrew/homebrew#12115.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-05-07 21:05:47 -05:00
Mike McQuaid
23b84ef732 Set MACOS_VERSION as 0 on non-OSX platforms. 2012-03-18 15:43:39 +13:00
Max Howell
c28943de7b Tell user to `brew update' if no .git 2012-03-16 00:35:49 +00:00
Jack Nagel
1a3a1249bf Warn the user of required arguments
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-02-04 00:27:05 -06:00
Jack Nagel
8809c85cc3 versions: ignore NameError and ArgumentError
Fixes Homebrew/homebrew#9856.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-01-29 16:00:27 -06:00
Jack Nagel
8944cc6b66 versions: fix up error handling
Now we handle some things more explicitly and in the process get rid of
the blanket rescue on the mktemp block, which is something of an
antipattern.

By unloading the class *after* determining the version, we avoid the
case where the class had previously been unloaded but Formula.factory
failed, and trying to unload the nonexistent class results in a
NameError. Doing it this way, we avoid having to rescue NameError and
thereby avoid hiding other cases where it may occur.

We also rescue TypeError which gets us past a few more bad formula in
the history in some instances.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-01-27 03:40:24 -06:00
Jack Nagel
d10f2afbac versions: silence 'aka' warning and syntax errors
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-01-26 23:02:18 -06:00
Dylan Smith
66fbb607fd versions: don't print 'nil' when stdout is not a tty
Closes Homebrew/homebrew#8960.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-01-24 12:21:08 -06:00
Jack Nagel
e9a0f24ccb versions: use the actual class name when unloading
And document a bit more why this hack is present.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-01-12 01:16:02 -06:00
Jack Nagel
5bfd8faf90 versions: unload old class before obtaining version
This is silly, but I am no Rubyist and I don't have time to
figure out why Formula.factory(foo).url works as expected but
Formula.factory(foo).version does not.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-01-06 22:07:45 -06:00
Jack Nagel
f3f04e595d versions: enable '--compact' output
This will be useful for shell tab completion when something like `brew
install <formula> --version <version>` is implemented.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-01-06 14:51:15 -06:00
Jack Nagel
016a508c7a versions: determine version from a Formula instance
Rather than regex the output of `git show <rev>:<path>`, we write the
output of `git cat-file blog <rev>:<path>` to a temporary file, and then
operate on it just as we would a normal formula.

I haven't observed any speed difference. `git cat-file blob` is faster
than `git show`, but the "slow part" is still the git-rev-list
invocation. But really it's pretty fast overall.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-01-06 14:51:15 -06:00
Max Howell
9cdfd2797f Fix nil handling in brew versions
Fixes Homebrew/homebrew#7392.
2011-09-05 09:44:53 +01:00
Max Howell
48501e8e1f Prettier brew versions output 2011-08-02 14:45:37 +01:00
Max Howell
616b52e627 Oops, show proper git checkout command 2011-08-02 12:58:16 +01:00
Max Howell
18a54259e9 Improvements to brew versions
The output happens as it is determined, rather than all at once, which is preferable for CLI commands. This meant I had to hard-code the left-justification.

The pre-amble warning is removed. Instead the command outputs the git checkout command for each she that you can type to get that old formula.

I decided that reseting the one file will work 99% of the time and that it is too risky to reset the whole repo, this will roll-back bug fixes. Instead we should add functionality to compat/ in order to support old formula as required. Sometimes deps may have to be rolled-back too, but the user will have to figure this out on an ad-hoc basis. We are assuming a failure sophisticated user anyway, one who would like to get old versions of stuff.

I moved most of the functions into Formula since IMO this makes more conceptual sense.

I made the she get abbreviated by git (using --abbrev-commit) itself so it as short as can be.
2011-08-02 12:34:33 +01:00
Sebastian Staudt
6726fe090f Added new command "versions" 2011-08-02 10:35:30 +01:00