Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 159028 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/update/internal/jarprocessor/PackUnpackStep.java (-1 / +1 lines)
Lines 44-50 Link Here
44
	 */
44
	 */
45
	public File postProcess(File input, File workingDirectory) {
45
	public File postProcess(File input, File workingDirectory) {
46
		if (canPack() && packCommand != null) {
46
		if (canPack() && packCommand != null) {
47
			Properties inf = Utils.getEclipseInf(input);
47
			Properties inf = Utils.getEclipseInf(input, verbose);
48
			if (inf != null && inf.containsKey(Utils.MARK_EXCLUDE_PACK) && Boolean.valueOf(inf.getProperty(Utils.MARK_EXCLUDE_PACK)).booleanValue()) {
48
			if (inf != null && inf.containsKey(Utils.MARK_EXCLUDE_PACK) && Boolean.valueOf(inf.getProperty(Utils.MARK_EXCLUDE_PACK)).booleanValue()) {
49
				if (verbose)
49
				if (verbose)
50
					System.out.println("Excluding " + input.getName() + " from " + getStepName()); //$NON-NLS-1$ //$NON-NLS-2$
50
					System.out.println("Excluding " + input.getName() + " from " + getStepName()); //$NON-NLS-1$ //$NON-NLS-2$
(-)src/org/eclipse/update/internal/jarprocessor/SignCommandStep.java (-1 / +1 lines)
Lines 52-58 Link Here
52
	 */
52
	 */
53
	public File postProcess(File input, File workingDirectory) {
53
	public File postProcess(File input, File workingDirectory) {
54
		if (command != null) {
54
		if (command != null) {
55
			Properties inf = Utils.getEclipseInf(input);
55
			Properties inf = Utils.getEclipseInf(input, verbose);
56
			if (inf != null && inf.containsKey(Utils.MARK_EXCLUDE_SIGN) && Boolean.valueOf(inf.getProperty(Utils.MARK_EXCLUDE_SIGN)).booleanValue()) {
56
			if (inf != null && inf.containsKey(Utils.MARK_EXCLUDE_SIGN) && Boolean.valueOf(inf.getProperty(Utils.MARK_EXCLUDE_SIGN)).booleanValue()) {
57
				if(verbose)
57
				if(verbose)
58
					System.out.println("Excluding " + input.getName() + " from signing."); //$NON-NLS-1$ //$NON-NLS-2$
58
					System.out.println("Excluding " + input.getName() + " from signing."); //$NON-NLS-1$ //$NON-NLS-2$
(-)src/org/eclipse/update/internal/jarprocessor/Utils.java (-6 / +12 lines)
Lines 210-221 Link Here
210
	 * Get the properties from the eclipse.inf file from the given jar.  If the file is not a jar, null is returned.
210
	 * Get the properties from the eclipse.inf file from the given jar.  If the file is not a jar, null is returned.
211
	 * If the file is a jar, but does not contain an eclipse.inf file, an empty Properties object is returned.
211
	 * If the file is a jar, but does not contain an eclipse.inf file, an empty Properties object is returned.
212
	 * @param jarFile
212
	 * @param jarFile
213
	 * @return
213
	 * @return The eclipse.inf properties for the given jar file
214
	 */
214
	 */
215
	public static Properties getEclipseInf(File jarFile) {
215
	public static Properties getEclipseInf(File jarFile, boolean verbose) {
216
		if (jarFile == null || !jarFile.exists())
216
		if (jarFile == null || !jarFile.exists()) {
217
			if (verbose)
218
				System.out.println("Failed to obtain eclipse.inf due to missing jar file: " + jarFile);
217
			return null;
219
			return null;
218
220
		}
219
		JarFile jar = null;
221
		JarFile jar = null;
220
		try {
222
		try {
221
			jar = new JarFile(jarFile, false);
223
			jar = new JarFile(jarFile, false);
Lines 229-243 Link Here
229
			}
231
			}
230
			return new Properties();
232
			return new Properties();
231
		} catch (IOException e) {
233
		} catch (IOException e) {
234
			if (verbose) {
235
				System.out.println("Failed to obtain eclipse.inf due to IOException: " + jarFile);
236
				e.printStackTrace();
237
			}
232
			//not a jar
238
			//not a jar
239
			return null;
233
		} finally {
240
		} finally {
234
			close(jar);
241
			close(jar);
235
		}
242
		}
236
		return null;
237
	}
243
	}
238
244
239
	public static boolean shouldSkipJar(File input, boolean processAll, boolean verbose) {
245
	public static boolean shouldSkipJar(File input, boolean processAll, boolean verbose) {
240
		Properties inf = getEclipseInf(input);
246
		Properties inf = getEclipseInf(input, verbose);
241
		if (inf == null) {
247
		if (inf == null) {
242
			//not a jar, could be a pack.gz
248
			//not a jar, could be a pack.gz
243
			return false;
249
			return false;
(-)src/org/eclipse/update/internal/jarprocessor/JarProcessor.java (-1 / +1 lines)
Lines 286-292 Link Here
286
		Map replacements = new HashMap();
286
		Map replacements = new HashMap();
287
		extractEntries(jar, tempDir, replacements);
287
		extractEntries(jar, tempDir, replacements);
288
288
289
		Properties inf = Utils.getEclipseInf(workingFile);
289
		Properties inf = Utils.getEclipseInf(workingFile, verbose);
290
		if (inf != null)
290
		if (inf != null)
291
			adjustInf(workingFile, inf);
291
			adjustInf(workingFile, inf);
292
292
(-)src/org/eclipse/update/internal/jarprocessor/PackStep.java (-1 / +1 lines)
Lines 71-77 Link Here
71
71
72
	public File postProcess(File input, File workingDirectory) {
72
	public File postProcess(File input, File workingDirectory) {
73
		if (canPack() && packCommand != null) {
73
		if (canPack() && packCommand != null) {
74
			Properties inf = Utils.getEclipseInf(input);
74
			Properties inf = Utils.getEclipseInf(input, verbose);
75
			if (inf != null && inf.containsKey(Utils.MARK_EXCLUDE_PACK) && Boolean.valueOf(inf.getProperty(Utils.MARK_EXCLUDE_PACK)).booleanValue()) {
75
			if (inf != null && inf.containsKey(Utils.MARK_EXCLUDE_PACK) && Boolean.valueOf(inf.getProperty(Utils.MARK_EXCLUDE_PACK)).booleanValue()) {
76
				if(verbose)
76
				if(verbose)
77
					System.out.println("Excluding " + input.getName() + " from " + getStepName()); //$NON-NLS-1$ //$NON-NLS-2$
77
					System.out.println("Excluding " + input.getName() + " from " + getStepName()); //$NON-NLS-1$ //$NON-NLS-2$

Return to bug 159028