summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2018-09-10 10:27:09 -0700
committerGitHub <noreply@github.com>2018-09-10 10:27:09 -0700
commit2c9c9a0bc9bc088b7441acf22fcea4318373bdc8 (patch)
treed3c8ae068a791e278df8ce85039ee2a25d6a7e9d /lib
parentcdb214840fb60fa91977e54531b8f642895b7bfd (diff)
parent7ccfb96bacbfe7c5aa3bc19eb79653701fbf04ab (diff)
downloadchef-2c9c9a0bc9bc088b7441acf22fcea4318373bdc8.tar.gz
Merge pull request #7551 from thechile/fix-cookbook-version-regex
Fix remote_directory does not obey removal of file specificity
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 343b037c8b..07ee501ff7 100644
--- a/lib/chef/cookbook_version.rb
+++ b/lib/chef/cookbook_version.rb
@@ -296,9 +296,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]