commit 900ff88c46bbb3d62cdf81458efa0486fd6883dd
Author: Michael Simacek <msimacek(a)redhat.com>
Date: Mon Sep 30 14:35:22 2013 +0200
maven_depmap.py now creates directory entries in jars when injecting
java-utils/maven_depmap.py | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/java-utils/maven_depmap.py b/java-utils/maven_depmap.py
index 2746b8f..71f8739 100644
--- a/java-utils/maven_depmap.py
+++ b/java-utils/maven_depmap.py
@@ -300,6 +300,12 @@ def output_fragment(fragment_path, fragment, mappings,
add_versions):
def append_if_missing(archive_name, file_name, file_contents):
with ZipFile(archive_name, 'a') as archive:
if file_name not in archive.namelist():
+ path = file_name[0:file_name.rfind('/')]
+ subdir = ''
+ for part in path.split('/'):
+ subdir += part + '/'
+ if subdir not in archive.namelist():
+ archive.writestr(subdir, '')
archive.writestr(file_name, file_contents)
# Inject pom.properties if JAR doesn't have one. This is necessary to
@@ -311,7 +317,8 @@ def inject_pom_properties(jar_path, fragment):
#{timestamp}
version={f.upstream_artifact.version}
groupId={f.upstream_artifact.groupId}
-artifactId={f.upstream_artifact.artifactId}""".format(timestamp=timestamp,
+artifactId={f.upstream_artifact.artifactId}
+""".format(timestamp=timestamp,
f=fragment)
append_if_missing(jar_path, props_path, properties)
Show replies by date