View | Details | Raw Unified | Return to bug 422776
Collapse All | Expand All

(-)a/bundles/org.eclipse.equinox.p2.publisher.eclipse/src/org/eclipse/equinox/p2/publisher/eclipse/BundlesAction.java (-3 / +9 lines)
Lines 861-877 Link Here
861
861
862
	private static boolean isDir(BundleDescription bundle, IPublisherInfo info) {
862
	private static boolean isDir(BundleDescription bundle, IPublisherInfo info) {
863
		Collection<IBundleShapeAdvice> advice = info.getAdvice(null, true, bundle.getSymbolicName(), PublisherHelper.fromOSGiVersion(bundle.getVersion()), IBundleShapeAdvice.class);
863
		Collection<IBundleShapeAdvice> advice = info.getAdvice(null, true, bundle.getSymbolicName(), PublisherHelper.fromOSGiVersion(bundle.getVersion()), IBundleShapeAdvice.class);
864
865
		@SuppressWarnings("unchecked")
866
		Map<String, String> manifest = (Map<String, String>) bundle.getUserObject();
867
		String format = manifest.get(BUNDLE_SHAPE);
868
864
		// if the advice has a shape, use it
869
		// if the advice has a shape, use it
865
		if (advice != null && !advice.isEmpty()) {
870
		if (advice != null && !advice.isEmpty()) {
866
			// we know there is some advice but if there is more than one, take the first.
871
			// we know there is some advice but if there is more than one, take the first.
867
			String shape = advice.iterator().next().getShape();
872
			String shape = advice.iterator().next().getShape();
873
			// If no format was set and advice was set to NONE then default behavior should be DIR
874
			if (IBundleShapeAdvice.NONE.equals(shape))
875
				return !JAR.equals(format);
868
			if (shape != null)
876
			if (shape != null)
869
				return shape.equals(IBundleShapeAdvice.DIR);
877
				return shape.equals(IBundleShapeAdvice.DIR);
870
		}
878
		}
879
871
		// otherwise go with whatever we figured out from the manifest or the shape on disk
880
		// otherwise go with whatever we figured out from the manifest or the shape on disk
872
		@SuppressWarnings("unchecked")
873
		Map<String, String> manifest = (Map<String, String>) bundle.getUserObject();
874
		String format = manifest.get(BUNDLE_SHAPE);
875
		return DIR.equals(format);
881
		return DIR.equals(format);
876
	}
882
	}
877
883
(-)a/bundles/org.eclipse.equinox.p2.publisher.eclipse/src/org/eclipse/equinox/p2/publisher/eclipse/FeaturesAction.java (-2 / +5 lines)
Lines 180-187 Link Here
180
		FeatureEntry entries[] = feature.getEntries();
180
		FeatureEntry entries[] = feature.getEntries();
181
		for (int i = 0; i < entries.length; i++) {
181
		for (int i = 0; i < entries.length; i++) {
182
			FeatureEntry entry = entries[i];
182
			FeatureEntry entry = entries[i];
183
			if (entry.isUnpack() && entry.isPlugin() && !entry.isRequires())
183
			if (entry.unpackSet() && entry.isPlugin() && !entry.isRequires())
184
				publisherInfo.addAdvice(new BundleShapeAdvice(entry.getId(), Version.parseVersion(entry.getVersion()), IBundleShapeAdvice.DIR));
184
				publisherInfo.addAdvice(new BundleShapeAdvice(entry.getId(), Version.parseVersion(entry.getVersion()), entry.isUnpack() ? IBundleShapeAdvice.DIR : IBundleShapeAdvice.JAR));
185
			if (!entry.unpackSet() && entry.isPlugin() && !entry.isRequires())
186
				publisherInfo.addAdvice(new BundleShapeAdvice(entry.getId(), Version.parseVersion(entry.getVersion()), IBundleShapeAdvice.NONE));
187
185
		}
188
		}
186
	}
189
	}
187
190
(-)a/bundles/org.eclipse.equinox.p2.publisher.eclipse/src/org/eclipse/equinox/p2/publisher/eclipse/IBundleShapeAdvice.java (+1 lines)
Lines 14-19 Link Here
14
public interface IBundleShapeAdvice extends IPublisherAdvice {
14
public interface IBundleShapeAdvice extends IPublisherAdvice {
15
	public static final String DIR = BundlesAction.DIR;
15
	public static final String DIR = BundlesAction.DIR;
16
	public static final String JAR = BundlesAction.JAR;
16
	public static final String JAR = BundlesAction.JAR;
17
	public static final String NONE = "none"; //$NON-NLS-1$
17
18
18
	public String getShape();
19
	public String getShape();
19
}
20
}

Return to bug 422776