forked from pool/vagrant
ae43736fe3
OBS-URL: https://build.opensuse.org/request/show/381084 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/vagrant?expand=0&rev=1
32 lines
973 B
Diff
32 lines
973 B
Diff
From: Antonio Terceiro <terceiro@debian.org>
|
|
Date: Sat, 11 Oct 2014 16:55:21 -0300
|
|
Subject: Read data from /usr/share/vagrant
|
|
|
|
---
|
|
lib/vagrant/shared_helpers.rb | 12 +++++++++++-
|
|
1 file changed, 11 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/lib/vagrant/shared_helpers.rb b/lib/vagrant/shared_helpers.rb
|
|
index fe11401..edf21ea 100644
|
|
--- a/lib/vagrant/shared_helpers.rb
|
|
+++ b/lib/vagrant/shared_helpers.rb
|
|
@@ -72,7 +72,17 @@ module Vagrant
|
|
#
|
|
# @return [Pathname]
|
|
def self.source_root
|
|
- @source_root ||= Pathname.new(File.expand_path('../../../', __FILE__))
|
|
+ @source_root ||=
|
|
+ begin
|
|
+ source = Pathname.new(File.expand_path('../../../', __FILE__))
|
|
+ if source.join('debian/control').exist?
|
|
+ # working inside source package
|
|
+ source
|
|
+ else
|
|
+ # installed
|
|
+ Pathname.new('/usr/share/vagrant')
|
|
+ end
|
|
+ end
|
|
end
|
|
|
|
# This returns the path to the ~/.vagrant.d folder where Vagrant's
|