summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorScott McGillivray <scott.mcgillivray@gmail.com>2018-08-22 23:47:19 -0400
committerTim Smith <tsmith@chef.io>2018-09-25 11:49:02 -0700
commita60a1d9524e5ca5e878985dba940a9e2bbd5df72 (patch)
treef3a5cd735f3f67ffc81d4f519cf7ec4f8c7ae91e /lib
parent9f9ecd1b31193b617326d9d2bb2115b7af91bd96 (diff)
downloadchef-dir_fix.tar.gz
Add fix for filespecificity regexdir_fix
Signed-off-by: Scott McGillivray <scott.mcgillivray@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/chef/cookbook_version.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/chef/cookbook_version.rb b/lib/chef/cookbook_version.rb
index dcb8c97548..6fcbc2912d 100644
--- a/lib/chef/cookbook_version.rb
+++ b/lib/chef/cookbook_version.rb
@@ -301,9 +301,9 @@ class Chef
# we're just going to make cookbook_files out of these and make the
# cookbook find them by filespecificity again. but it's the shortest
# path to "success" for now.
- if manifest_record_path =~ /(#{Regexp.escape(segment.to_s)}\/[^\/]+\/#{Regexp.escape(dirname)})\/.+$/
+ if manifest_record_path =~ /(#{Regexp.escape(segment.to_s)}\/[^\/]*\/?#{Regexp.escape(dirname)})\/.+$/
specificity_dirname = $1
- non_specific_path = manifest_record_path[/#{Regexp.escape(segment.to_s)}\/[^\/]+\/#{Regexp.escape(dirname)}\/(.+)$/, 1]
+ non_specific_path = manifest_record_path[/#{Regexp.escape(segment.to_s)}\/[^\/]*\/?#{Regexp.escape(dirname)}\/(.+)$/, 1]
# Record the specificity_dirname only if it's in the list of
# valid preferences
if filenames_by_pref[specificity_dirname]