View | Details | Raw Unified | Return to bug 226850 | Differences between
and this patch

Collapse All | Expand All

(-)jarprocessor/org/eclipse/update/internal/jarprocessor/PackStep.java (-24 / +17 lines)
Lines 23-29 Link Here
23
	protected static String packCommand = null;
23
	protected static String packCommand = null;
24
	private static Boolean canPack = null;
24
	private static Boolean canPack = null;
25
25
26
	private String arguments = null;
27
	private Set exclusions = Collections.EMPTY_SET;
26
	private Set exclusions = Collections.EMPTY_SET;
28
27
29
	public static boolean canPack() {
28
	public static boolean canPack() {
Lines 136-156 Link Here
136
		return cmd;
135
		return cmd;
137
	}
136
	}
138
137
139
	protected String getArguments(File input, Properties inf, List containers) {
138
	protected String getArguments(File input, Properties inf, List containers) {	
140
		if (arguments != null)
141
			return arguments;
142
		//1: Explicitly marked in our .inf file
139
		//1: Explicitly marked in our .inf file
143
		if (inf != null && inf.containsKey(Utils.PACK_ARGS)) {
140
		if (inf != null && inf.containsKey(Utils.PACK_ARGS)) {
144
			arguments = inf.getProperty(Utils.PACK_ARGS);
141
			return  inf.getProperty(Utils.PACK_ARGS);
145
			return arguments;
146
		}
142
		}
147
143
148
		//2: Defaults set in one of our containing jars
144
		//2: Defaults set in one of our containing jars
149
		for (Iterator iterator = containers.iterator(); iterator.hasNext();) {
145
		for (Iterator iterator = containers.iterator(); iterator.hasNext();) {
150
			Properties container = (Properties) iterator.next();
146
			Properties container = (Properties) iterator.next();
151
			if (container.containsKey(Utils.DEFAULT_PACK_ARGS)) {
147
			if (container.containsKey(Utils.DEFAULT_PACK_ARGS)) {
152
				arguments = container.getProperty(Utils.DEFAULT_PACK_ARGS);
148
				return container.getProperty(Utils.DEFAULT_PACK_ARGS);
153
				return arguments;
154
			}
149
			}
155
		}
150
		}
156
151
Lines 158-176 Link Here
158
		Properties options = getOptions();
153
		Properties options = getOptions();
159
		String argsKey = input.getName() + Utils.PACK_ARGS_SUFFIX;
154
		String argsKey = input.getName() + Utils.PACK_ARGS_SUFFIX;
160
		if (options.containsKey(argsKey)) {
155
		if (options.containsKey(argsKey)) {
161
			arguments = options.getProperty(argsKey);
156
			return options.getProperty(argsKey);
162
			return arguments;
163
		}
157
		}
164
158
165
		//4: Set by default in outside pack.properties file
159
		//4: Set by default in outside pack.properties file
166
		if (options.containsKey(Utils.DEFAULT_PACK_ARGS)) {
160
		if (options.containsKey(Utils.DEFAULT_PACK_ARGS)) {
167
			arguments = options.getProperty(Utils.DEFAULT_PACK_ARGS);
161
			return options.getProperty(Utils.DEFAULT_PACK_ARGS);
168
			return arguments;
169
		}
162
		}
170
163
171
		if (arguments == null)
164
		return ""; //$NON-NLS-1$
172
			arguments = "";
173
		return arguments;
174
	}
165
	}
175
166
176
	public String getStepName() {
167
	public String getStepName() {
Lines 190-204 Link Here
190
		}
181
		}
191
		verbose = v;
182
		verbose = v;
192
183
193
		//mark as conditioned
184
		//mark as conditioned if not previously marked.  A signed jar is assumed to be previously conditioned.
194
		inf.put(Utils.MARK_PROPERTY, "true"); //$NON-NLS-1$
185
		if (inf.getProperty(Utils.MARK_PROPERTY) == null) {
195
186
			inf.put(Utils.MARK_PROPERTY, "true"); //$NON-NLS-1$
196
		//record arguments used
187
	
197
		String arguments = inf.getProperty(Utils.PACK_ARGS);
188
			//record arguments used
198
		if (arguments == null) {
189
			String arguments = inf.getProperty(Utils.PACK_ARGS);
199
			arguments = getArguments(input, inf, containers);
190
			if (arguments == null) {
200
			if (arguments != null && arguments.length() > 0)
191
				arguments = getArguments(input, inf, containers);
201
				inf.put(Utils.PACK_ARGS, arguments);
192
				if (arguments != null && arguments.length() > 0)
193
					inf.put(Utils.PACK_ARGS, arguments);
194
			}
202
		}
195
		}
203
	}
196
	}
204
}
197
}

Return to bug 226850