mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
rbinstall.rb: fix for non-working directory
* tool/rbinstall.rb (Gem::Specification.last_date): skip if failed to get info from VCS, for example, in the case circumstance sharing working directory with another machine and run vcs tools cannot work. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43624 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
9782d219f3
commit
e72ca2e044
2 changed files with 4 additions and 3 deletions
|
@ -579,7 +579,8 @@ module Gem
|
|||
|
||||
def self.last_date(path)
|
||||
return unless $vcs
|
||||
return unless time = $vcs.get_revisions(path)[2]
|
||||
time = $vcs.get_revisions(path)[2] rescue return
|
||||
return unless time
|
||||
time.strftime("%Y-%m-%d")
|
||||
end
|
||||
|
||||
|
|
|
@ -43,8 +43,8 @@ class VCS
|
|||
def get_revisions(path)
|
||||
path = relative_to(path)
|
||||
last, changed, modified, *rest = Dir.chdir(@srcdir) {self.class.get_revisions(path)}
|
||||
last or raise "last revision not found"
|
||||
changed or raise "changed revision not found"
|
||||
last or raise VCS::NotFoundError, "last revision not found"
|
||||
changed or raise VCS::NotFoundError, "changed revision not found"
|
||||
modified &&= Time.parse(modified)
|
||||
return last, changed, modified, *rest
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue