summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKartik Null Cating-Subramanian <ksubramanian@chef.io>2016-02-04 13:39:17 -0500
committerKartik Null Cating-Subramanian <ksubramanian@chef.io>2016-02-04 17:25:30 -0500
commit64e6b492e5bb735c55f5121c1311acc00ed22016 (patch)
tree5142fdd7585116fdbbc791d9be80374e3612d4b6
parent13b00a9d99d6c60c2f24ea1ea67b17b50c80459c (diff)
downloadchef-ksubrama/fips.tar.gz
Allow __FILE__ to be read inside instance_evalksubrama/fips
-rw-r--r--omnibus/config/projects/chef-fips.rb3
-rw-r--r--omnibus/config/projects/chef.rb3
2 files changed, 4 insertions, 2 deletions
diff --git a/omnibus/config/projects/chef-fips.rb b/omnibus/config/projects/chef-fips.rb
index e9a74fc922..d8c6c79c91 100644
--- a/omnibus/config/projects/chef-fips.rb
+++ b/omnibus/config/projects/chef-fips.rb
@@ -18,7 +18,8 @@
# This is the chef client build with FIPS mode enabled.
# It's a stub for now and produces identical results
#
-chef_project_contents = IO.read(File.expand_path("../chef.rb", __FILE__))
+current_file = __FILE__
+chef_project_contents = IO.read(File.expand_path("../chef.rb", current_file))
self.instance_eval chef_project_contents
name "chef-fips"
diff --git a/omnibus/config/projects/chef.rb b/omnibus/config/projects/chef.rb
index 6a0f5eb96e..1dde5cfe85 100644
--- a/omnibus/config/projects/chef.rb
+++ b/omnibus/config/projects/chef.rb
@@ -20,7 +20,8 @@ maintainer "Chef Software, Inc. <maintainers@chef.io>"
homepage "https://www.chef.io"
build_iteration 1
-version_file = File.expand_path("../../../../VERSION", __FILE__)
+current_file ||= __FILE__
+version_file = File.expand_path("../../../../VERSION", current_file)
build_version IO.read(version_file).strip
if windows?