From 098ebb3c7ad9fa5ebbfdb7288241baccb9dae039 Mon Sep 17 00:00:00 2001 From: Thom May Date: Wed, 16 May 2018 15:29:08 +0100 Subject: Fix manifest entries for root files We weren't consistently naming root files; in some places in the spec the names contained the `root_files` segment and in other places they didn't. This now always uses `root_files`. Signed-off-by: Thom May --- lib/chef/cookbook_manifest.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib/chef/cookbook_manifest.rb') diff --git a/lib/chef/cookbook_manifest.rb b/lib/chef/cookbook_manifest.rb index 526c183339..9adcee6b78 100644 --- a/lib/chef/cookbook_manifest.rb +++ b/lib/chef/cookbook_manifest.rb @@ -204,7 +204,8 @@ class Chef def root_files manifest[:all_files].select do |file| - file[:name].split("/").length == 1 + segment, name = file[:name].split("/") + name.nil? || segment == "root_files" end end @@ -271,7 +272,7 @@ class Chef next if parts[0] == ".." # if we have a root_file, such as metadata.rb, the first part will be "." - return [ pathname.to_s, pathname.to_s, "default" ] if parts.length == 1 + return [ "root_files/#{pathname}", pathname.to_s, "default" ] if parts.length == 1 segment = parts[0] -- cgit v1.2.1