Bug 536326 - Report ARTIFACT_PROCESSING_ERROR from pack200 processing step

When Pack200ProcessorStep fails to unpack artifact, it reports
MirrorRequest.ARTIFACT_PROCESSING_ERROR.

Since b26ae58972e96118b4f9e4496438fc218e5ab2d0, processing step must
return MirrorRequest.ARTIFACT_PROCESSING_ERROR to report non-transport
artifact errors and instruct SimpleArtifactRepository's
downloadArtifact(IArtifactDescriptor, OutputStream, IProgressMonitor)
via artifactError(IStatus) method to stop retrying.

This fixes failing MirrorRequestTest's
testFailToCanonicalWithMirrors() from the previous commit.

Bug: 377976
Change-Id: Ib0c3316915044d115408a91a45a590266a63e8b6
Signed-off-by: Mykola Nikishov <mn@mn.com.ua>
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/processors/pack200/Pack200ProcessorStep.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/processors/pack200/Pack200ProcessorStep.java
index 3fb2586..7eb0717 100644
--- a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/processors/pack200/Pack200ProcessorStep.java
+++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/processors/pack200/Pack200ProcessorStep.java
@@ -19,6 +19,7 @@
 import org.eclipse.core.runtime.Status;
 import org.eclipse.equinox.internal.p2.artifact.processing.AbstractBufferingStep;
 import org.eclipse.equinox.internal.p2.artifact.repository.Activator;
+import org.eclipse.equinox.internal.p2.artifact.repository.MirrorRequest;
 import org.eclipse.equinox.internal.p2.core.helpers.FileUtils;
 import org.eclipse.equinox.internal.p2.jarprocessor.UnpackStep;
 import org.eclipse.equinox.internal.p2.jarprocessor.Utils;
@@ -49,7 +50,7 @@
 		if (!UnpackStep.canUnpack()) {
 			IStatus status = null;
 			if (detailedResult) {
-				status = new Status(IStatus.ERROR, Activator.ID, "Unpack facility not configured."); //$NON-NLS-1$
+				status = new Status(IStatus.ERROR, Activator.ID, MirrorRequest.ARTIFACT_PROCESSING_ERROR, "Unpack facility not configured.", null); //$NON-NLS-1$
 				detailedResult = true;
 			} else {
 				String[] locations = Utils.getPack200Commands("unpack200"); //$NON-NLS-1$
@@ -57,7 +58,7 @@
 				for (int i = 0; i < locations.length; i++) {
 					locationTried.append(locations[i]).append(", "); //$NON-NLS-1$
 				}
-				status = new Status(IStatus.ERROR, Activator.ID, "Unpack facility not configured. The locations searched for unpack200 are: " + locationTried); //$NON-NLS-1$
+				status = new Status(IStatus.ERROR, Activator.ID, MirrorRequest.ARTIFACT_PROCESSING_ERROR, "Unpack facility not configured. The locations searched for unpack200 are: " + locationTried, null); //$NON-NLS-1$
 			}
 			setStatus(status);
 		}
@@ -80,8 +81,11 @@
 				InputStream resultStream = new BufferedInputStream(new FileInputStream(resultFile));
 				FileUtils.copyStream(resultStream, true, getDestination(), false);
 			} else {
-				setStatus(new Status(IStatus.ERROR, Activator.ID, "Unpacking fails because intermediate file is empty: " + resultFile)); //$NON-NLS-1$
+				setStatus(new Status(IStatus.ERROR, Activator.ID, MirrorRequest.ARTIFACT_PROCESSING_ERROR, "Unpacking fails because intermediate file is empty: " + resultFile, null)); //$NON-NLS-1$
 			}
+		} catch (IOException e) {
+			setStatus(new Status(IStatus.ERROR, Activator.ID, MirrorRequest.ARTIFACT_PROCESSING_ERROR, "Unpacking fails", e)); //$NON-NLS-1$
+			throw e;
 		} finally {
 			if (resultFile != null)
 				resultFile.delete();