diff options
author | DJ Houghton | 2008-08-28 18:58:47 +0000 |
---|---|---|
committer | DJ Houghton | 2008-08-28 18:58:47 +0000 |
commit | 8983c9ec95b39962049570df1a89eee7cb6ecca2 (patch) | |
tree | d3fc10d529b14ff8cda7baa86cb6ae8d852b7aa8 /bundles/org.eclipse.equinox.p2.metadata.generator | |
parent | 48efef9dabe72c41514c0d2ead0855ba99591c58 (diff) | |
download | rt.equinox.p2-8983c9ec95b39962049570df1a89eee7cb6ecca2.tar.gz rt.equinox.p2-8983c9ec95b39962049570df1a89eee7cb6ecca2.tar.xz rt.equinox.p2-8983c9ec95b39962049570df1a89eee7cb6ecca2.zip |
Bug 244813 -Files Missing in update jars
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.metadata.generator')
-rw-r--r-- | bundles/org.eclipse.equinox.p2.metadata.generator/src/org/eclipse/equinox/internal/provisional/p2/metadata/generator/Generator.java | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/bundles/org.eclipse.equinox.p2.metadata.generator/src/org/eclipse/equinox/internal/provisional/p2/metadata/generator/Generator.java b/bundles/org.eclipse.equinox.p2.metadata.generator/src/org/eclipse/equinox/internal/provisional/p2/metadata/generator/Generator.java index 811fa50fd..280c50c26 100644 --- a/bundles/org.eclipse.equinox.p2.metadata.generator/src/org/eclipse/equinox/internal/provisional/p2/metadata/generator/Generator.java +++ b/bundles/org.eclipse.equinox.p2.metadata.generator/src/org/eclipse/equinox/internal/provisional/p2/metadata/generator/Generator.java @@ -16,6 +16,7 @@ import java.util.Map.Entry; import org.eclipse.core.runtime.*; import org.eclipse.equinox.internal.frameworkadmin.equinox.EquinoxConstants; import org.eclipse.equinox.internal.p2.core.helpers.*; +import org.eclipse.equinox.internal.p2.core.helpers.FileUtils.IPathComputer; import org.eclipse.equinox.internal.p2.metadata.generator.*; import org.eclipse.equinox.internal.p2.metadata.generator.Messages; import org.eclipse.equinox.internal.p2.metadata.generator.features.*; @@ -393,7 +394,7 @@ public class Generator { ((ArtifactDescriptor) ad).setProperty(IArtifactDescriptor.DOWNLOAD_CONTENTTYPE, IArtifactDescriptor.TYPE_ZIP); File bundleFile = new File(bd.getLocation()); if (bundleFile.isDirectory()) - publishArtifact(ad, bundleFile.listFiles(), destination, false); + publishArtifact(ad, bundleFile.listFiles(), destination, false, bundleFile); else publishArtifact(ad, new File[] {bundleFile}, destination, true); if (info.reuseExistingPack200Files() && !info.publishArtifacts()) { @@ -996,7 +997,7 @@ public class Generator { for (int arti = 0; arti < artifacts.length; arti++) { IArtifactDescriptor ad = MetadataGeneratorHelper.createArtifactDescriptor(artifacts[arti], new File(location), true, false); if (isExploded) - publishArtifact(ad, new File(location).listFiles(), destination, false); + publishArtifact(ad, new File(location).listFiles(), destination, false, new File(location)); else publishArtifact(ad, new File[] {new File(location)}, destination, true); } @@ -1294,11 +1295,15 @@ public class Generator { } } + protected void publishArtifact(IArtifactDescriptor descriptor, File[] files, IArtifactRepository destination, boolean asIs) { + publishArtifact(descriptor, files, destination, asIs, null); + } + // Put the artifact on the server /** * @deprecated moved to AbstractPublishingAction */ - protected void publishArtifact(IArtifactDescriptor descriptor, File[] files, IArtifactRepository destination, boolean asIs) { + protected void publishArtifact(IArtifactDescriptor descriptor, File[] files, IArtifactRepository destination, boolean asIs, File root) { if (descriptor == null || destination == null) return; if (!info.publishArtifacts()) { @@ -1328,7 +1333,12 @@ public class Generator { File tempFile = null; try { tempFile = File.createTempFile("p2.generator", ""); //$NON-NLS-1$ //$NON-NLS-2$ - FileUtils.zip(files, null, tempFile, FileUtils.createDynamicPathComputer(0)); + IPathComputer computer = null; + if (root != null) + computer = FileUtils.createRootPathComputer(root); + else + computer = FileUtils.createDynamicPathComputer(0); + FileUtils.zip(files, null, tempFile, computer); if (!destination.contains(descriptor)) { destination.setProperty(IArtifactDescriptor.DOWNLOAD_CONTENTTYPE, IArtifactDescriptor.TYPE_ZIP); OutputStream output = new BufferedOutputStream(destination.getOutputStream(descriptor)); |