Make sure directories for intermediate directories in zips are created

Project: http://git-wip-us.apache.org/repos/asf/buildr/repo
Commit: http://git-wip-us.apache.org/repos/asf/buildr/commit/ae6f0560
Tree: http://git-wip-us.apache.org/repos/asf/buildr/tree/ae6f0560
Diff: http://git-wip-us.apache.org/repos/asf/buildr/diff/ae6f0560

Branch: refs/heads/master
Commit: ae6f056046126d2ae79b0ef2e4f02176b78923d1
Parents: 9212459
Author: Peter Donald <[email protected]>
Authored: Mon Dec 4 10:20:25 2017 +1100
Committer: Peter Donald <[email protected]>
Committed: Mon Dec 4 10:20:25 2017 +1100

----------------------------------------------------------------------
 CHANGELOG                       | 4 ++++
 lib/buildr/packaging/ziptask.rb | 4 ++++
 2 files changed, 8 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/buildr/blob/ae6f0560/CHANGELOG
----------------------------------------------------------------------
diff --git a/CHANGELOG b/CHANGELOG
index 59e30ff..36a5d64 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,4 +1,8 @@
 1.5.5 (Pending)
+* Fixed:  The concatenation extension released as part of 1.5.4 changed the 
way zip archives were
+          constructed so that entries for some intermediate directories were 
elided. For most consumers
+          of zip files this had no impact but some tools require the entries 
during scanning. (i.e. Older
+          versions of Jruby that loaded ruby scripts from within a jar).
 * Added:  IDEA Extension: Added support for passing `:iml_name` parameter to 
`ipr.add_gwt_configuration`
 
 1.5.4 (2017-11-29)

http://git-wip-us.apache.org/repos/asf/buildr/blob/ae6f0560/lib/buildr/packaging/ziptask.rb
----------------------------------------------------------------------
diff --git a/lib/buildr/packaging/ziptask.rb b/lib/buildr/packaging/ziptask.rb
index 5c98dff..12b810a 100644
--- a/lib/buildr/packaging/ziptask.rb
+++ b/lib/buildr/packaging/ziptask.rb
@@ -68,6 +68,10 @@ module Buildr #:nodoc:
           contents = file_map[path]
           warn "Warning:  Path in zipfile #{name} contains backslash: #{path}" 
if path =~ /\\/
 
+          # Must ensure that the directory entry is created for intermediate 
paths, otherwise
+          # zips can be created without entries for directories which can 
break some tools
+          mkpath.call File.dirname(path)
+
           entry_created = false
           to_transform = []
           transform = transform_map.key?(path)

Reply via email to