Skip to content

Commit

Permalink
Use the File.fnmatch? which is close to shell globbing to better immi…
Browse files Browse the repository at this point in the history
…tate tar when specifying an extract_list
  • Loading branch information
bbbco committed Dec 16, 2015
1 parent f83bed6 commit cd2ec24
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion providers/x.rb
Expand Up @@ -123,7 +123,7 @@ def t_file(tarball, entry, pax, longname)

def on_list?(name, tarball)
Array(tarball.extract_list).each do |r|
return true if ::File.basename(name).match(Regexp.quote(r))
return true if ::File.fnmatch?(r, name)
end
false
end
Expand Down
2 changes: 1 addition & 1 deletion recipes/test.rb
Expand Up @@ -42,7 +42,7 @@
destination '/tmp/testing2'
owner 'root'
group 'sys'
extract_list ['1', '/.*_to_.*/']
extract_list ['**/1', '**/*_to_*']
action :extract
end

Expand Down

0 comments on commit cd2ec24

Please sign in to comment.