SHA256
1
0
forked from pool/vagrant
vagrant/0003-VERSION-fallback-to-usr-share-vagrant-version.txt.patch

26 lines
884 B
Diff

From: Antonio Terceiro <terceiro@debian.org>
Date: Sat, 11 Oct 2014 16:54:26 -0300
Subject: VERSION: fallback to /usr/share/vagrant/version.txt
---
lib/vagrant/version.rb | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/lib/vagrant/version.rb b/lib/vagrant/version.rb
index 0640365..dfd91b5 100644
--- a/lib/vagrant/version.rb
+++ b/lib/vagrant/version.rb
@@ -2,6 +2,10 @@ module Vagrant
# This will always be up to date with the current version of Vagrant,
# since it is used to generate the gemspec and is also the source of
# the version for `vagrant -v`
- VERSION = File.read(
- File.expand_path("../../../version.txt", __FILE__)).chomp
+ begin
+ VERSION = File.read(
+ File.expand_path("../../../version.txt", __FILE__)).chomp
+ rescue Errno::ENOENT
+ VERSION = File.read('/usr/share/vagrant/version.txt').strip
+ end
end