aboutsummaryrefslogtreecommitdiffstats
path: root/tool
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-09 16:37:46 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-09 16:37:46 +0000
commite72ca2e04457bfbfffb92bdfb30123852930e030 (patch)
tree72196ea58312b2f239c09f3041d705a2c5eb4a12 /tool
parent9782d219f34aded1d0b80f7bdff809132550561e (diff)
downloadruby-e72ca2e04457bfbfffb92bdfb30123852930e030.tar.gz
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
Diffstat (limited to 'tool')
-rwxr-xr-xtool/rbinstall.rb3
-rw-r--r--tool/vcs.rb4
2 files changed, 4 insertions, 3 deletions
diff --git a/tool/rbinstall.rb b/tool/rbinstall.rb
index 1f2a6aebc0..b3dad0ee89 100755
--- a/tool/rbinstall.rb
+++ b/tool/rbinstall.rb
@@ -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
diff --git a/tool/vcs.rb b/tool/vcs.rb
index 6e86cfb07e..dbde58545e 100644
--- a/tool/vcs.rb
+++ b/tool/vcs.rb
@@ -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