Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'p2/org.eclipse.cdt.p2')
-rw-r--r--p2/org.eclipse.cdt.p2/.classpath11
-rw-r--r--p2/org.eclipse.cdt.p2/.project28
-rw-r--r--p2/org.eclipse.cdt.p2/.settings/org.eclipse.jdt.core.prefs12
-rw-r--r--p2/org.eclipse.cdt.p2/META-INF/MANIFEST.MF21
-rw-r--r--p2/org.eclipse.cdt.p2/about.html24
-rw-r--r--p2/org.eclipse.cdt.p2/about.ini24
-rw-r--r--p2/org.eclipse.cdt.p2/about.mappings9
-rw-r--r--p2/org.eclipse.cdt.p2/about.properties24
-rw-r--r--p2/org.eclipse.cdt.p2/build.properties22
-rw-r--r--p2/org.eclipse.cdt.p2/cdt_logo_icon32.pngbin1885 -> 0 bytes
-rw-r--r--p2/org.eclipse.cdt.p2/plugin.properties16
-rw-r--r--p2/org.eclipse.cdt.p2/plugin.xml35
-rw-r--r--p2/org.eclipse.cdt.p2/pom.xml17
-rw-r--r--p2/org.eclipse.cdt.p2/src/org/eclipse/cdt/internal/p2/Activator.java100
-rw-r--r--p2/org.eclipse.cdt.p2/src/org/eclipse/cdt/internal/p2/touchpoint/natives/actions/CleanupUnpackAction.java12
-rw-r--r--p2/org.eclipse.cdt.p2/src/org/eclipse/cdt/internal/p2/touchpoint/natives/actions/CleanupUntarAction.java79
-rw-r--r--p2/org.eclipse.cdt.p2/src/org/eclipse/cdt/internal/p2/touchpoint/natives/actions/Messages.java23
-rw-r--r--p2/org.eclipse.cdt.p2/src/org/eclipse/cdt/internal/p2/touchpoint/natives/actions/TranslateAction.java97
-rw-r--r--p2/org.eclipse.cdt.p2/src/org/eclipse/cdt/internal/p2/touchpoint/natives/actions/UnpackAction.java135
-rw-r--r--p2/org.eclipse.cdt.p2/src/org/eclipse/cdt/internal/p2/touchpoint/natives/actions/UntarAction.java184
-rw-r--r--p2/org.eclipse.cdt.p2/src/org/eclipse/cdt/internal/p2/touchpoint/natives/actions/messages.properties2
21 files changed, 0 insertions, 875 deletions
diff --git a/p2/org.eclipse.cdt.p2/.classpath b/p2/org.eclipse.cdt.p2/.classpath
deleted file mode 100644
index 9cc8a048b7e..00000000000
--- a/p2/org.eclipse.cdt.p2/.classpath
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
- <accessrules>
- <accessrule kind="accessible" pattern="**/internal/provisional/**"/>
- </accessrules>
- </classpathentry>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/p2/org.eclipse.cdt.p2/.project b/p2/org.eclipse.cdt.p2/.project
deleted file mode 100644
index 8808e4bb736..00000000000
--- a/p2/org.eclipse.cdt.p2/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.cdt.p2</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/p2/org.eclipse.cdt.p2/.settings/org.eclipse.jdt.core.prefs b/p2/org.eclipse.cdt.p2/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index e552e141e76..00000000000
--- a/p2/org.eclipse.cdt.p2/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,12 +0,0 @@
-#Sun Nov 30 21:26:19 EST 2008
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.7
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.7
diff --git a/p2/org.eclipse.cdt.p2/META-INF/MANIFEST.MF b/p2/org.eclipse.cdt.p2/META-INF/MANIFEST.MF
deleted file mode 100644
index afbbbd84cc0..00000000000
--- a/p2/org.eclipse.cdt.p2/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,21 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %Bundle-Name
-Bundle-SymbolicName: org.eclipse.cdt.p2;singleton:=true
-Bundle-Version: 1.0.0.qualifier
-Bundle-Activator: org.eclipse.cdt.internal.p2.Activator
-Bundle-Vendor: %Bundle-Vendor
-Bundle-Localization: plugin
-Require-Bundle: org.eclipse.core.runtime,
- org.eclipse.equinox.p2.artifact.repository;bundle-version="1.0.2",
- org.eclipse.equinox.p2.core;bundle-version="1.0.0",
- org.eclipse.equinox.p2.metadata;bundle-version="1.0.0",
- org.eclipse.equinox.p2.engine;bundle-version="1.0.1",
- org.apache.ant;bundle-version="1.7.0",
- org.eclipse.equinox.p2.touchpoint.natives;bundle-version="1.0.0",
- org.eclipse.equinox.p2.repository;bundle-version="1.0.0",
- org.apache.commons.compress;bundle-version="1.6.0"
-Bundle-RequiredExecutionEnvironment: JavaSE-1.7
-Bundle-ActivationPolicy: lazy
-Export-Package: org.eclipse.cdt.internal.p2,
- org.eclipse.cdt.internal.p2.touchpoint.natives.actions
diff --git a/p2/org.eclipse.cdt.p2/about.html b/p2/org.eclipse.cdt.p2/about.html
deleted file mode 100644
index d7c511887d6..00000000000
--- a/p2/org.eclipse.cdt.p2/about.html
+++ /dev/null
@@ -1,24 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>About</title></head>
-
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 22, 2007</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise
-indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available
-at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, "Program" will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
-being redistributed by another party ("Redistributor") and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was
-provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
-
-</body></html> \ No newline at end of file
diff --git a/p2/org.eclipse.cdt.p2/about.ini b/p2/org.eclipse.cdt.p2/about.ini
deleted file mode 100644
index e07a7bb377e..00000000000
--- a/p2/org.eclipse.cdt.p2/about.ini
+++ /dev/null
@@ -1,24 +0,0 @@
-# about.ini
-# contains information about a feature
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# "%key" are externalized strings defined in about.properties
-# This file does not need to be translated.
-
-# Property "aboutText" contains blurb for "About" dialog (translated)
-aboutText=%blurb
-
-# Property "windowImage" contains path to window icon (16x16)
-# needed for primary features only
-
-# Property "featureImage" contains path to feature image (32x32)
-featureImage=cdt_logo_icon32.png
-
-# Property "aboutImage" contains path to product image (500x330 or 115x164)
-# needed for primary features only
-
-# Property "appName" contains name of the application (translated)
-# needed for primary features only
-
-# Property "welcomePerspective" contains the id of the perspective in which the
-# welcome page is to be opened.
-# optional
diff --git a/p2/org.eclipse.cdt.p2/about.mappings b/p2/org.eclipse.cdt.p2/about.mappings
deleted file mode 100644
index 0824105e69d..00000000000
--- a/p2/org.eclipse.cdt.p2/about.mappings
+++ /dev/null
@@ -1,9 +0,0 @@
-# about.mappings
-# contains fill-ins for about.properties
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file does not need to be translated.
-
-# The following should contain the build version.
-# e.g. "0=20020612"
-# This value will be added automaticaly via the build scripts
-0=@build@ \ No newline at end of file
diff --git a/p2/org.eclipse.cdt.p2/about.properties b/p2/org.eclipse.cdt.p2/about.properties
deleted file mode 100644
index a090552503d..00000000000
--- a/p2/org.eclipse.cdt.p2/about.properties
+++ /dev/null
@@ -1,24 +0,0 @@
-###############################################################################
-# Copyright (c) 2002, 2009 Wind River Systems and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Wind River Systems - initial API and implementation
-###############################################################################
-# about.properties
-# contains externalized strings for about.ini
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# fill-ins are supplied by about.mappings
-# This file should be translated.
-# NOTE TO TRANSLATOR: Please do not translate the featureVersion variable.
-
-blurb=Eclipse CDT P2 Customizations for SDK installation\n\
-\n\
-Version: {featureVersion}\n\
-Build id: {0}\n\
-\n\
-(c) Copyright Eclipse contributors and others, 2000, 2010. All rights reserved.\n\
-Visit http://www.eclipse.org/cdt
diff --git a/p2/org.eclipse.cdt.p2/build.properties b/p2/org.eclipse.cdt.p2/build.properties
deleted file mode 100644
index 88ef4bbc858..00000000000
--- a/p2/org.eclipse.cdt.p2/build.properties
+++ /dev/null
@@ -1,22 +0,0 @@
-###############################################################################
-# Copyright (c) 2008, 2009 Wind River Systems and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Wind River Systems - initial API and implementation
-###############################################################################
-source.. = src/
-output.. = bin/
-bin.includes = META-INF/,\
- .,\
- plugin.xml,\
- about.html,\
- about.ini,\
- about.mappings,\
- plugin.properties,\
- about.properties,\
- cdt_logo_icon32.png
-src.includes = about.html
diff --git a/p2/org.eclipse.cdt.p2/cdt_logo_icon32.png b/p2/org.eclipse.cdt.p2/cdt_logo_icon32.png
deleted file mode 100644
index 470ca81b327..00000000000
--- a/p2/org.eclipse.cdt.p2/cdt_logo_icon32.png
+++ /dev/null
Binary files differ
diff --git a/p2/org.eclipse.cdt.p2/plugin.properties b/p2/org.eclipse.cdt.p2/plugin.properties
deleted file mode 100644
index 28b588b61d1..00000000000
--- a/p2/org.eclipse.cdt.p2/plugin.properties
+++ /dev/null
@@ -1,16 +0,0 @@
-###############################################################################
-# Copyright (c) 2008, 2009 Wind River Systems and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Doug Schaefer (Wind River) - initial API and implementation
-# IBM Corporation
-###############################################################################
-
-installArtifactRepository=Install Artifact Repository
-
-Bundle-Vendor = Eclipse CDT
-Bundle-Name = CDT P2 customizations for SDKs \ No newline at end of file
diff --git a/p2/org.eclipse.cdt.p2/plugin.xml b/p2/org.eclipse.cdt.p2/plugin.xml
deleted file mode 100644
index c0053db9d9e..00000000000
--- a/p2/org.eclipse.cdt.p2/plugin.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.2"?>
-<plugin>
- <extension
- point="org.eclipse.equinox.p2.engine.actions">
- <action
- class="org.eclipse.cdt.internal.p2.touchpoint.natives.actions.UntarAction"
- name="org.eclipse.equinox.p2.touchpoint.natives.untar"
- touchpointType="org.eclipse.equinox.p2.native"
- touchpointVersion="1.0.0"
- version="1.0.0">
- </action>
- </extension>
- <extension
- point="org.eclipse.equinox.p2.engine.actions">
- <action
- class="org.eclipse.cdt.internal.p2.touchpoint.natives.actions.CleanupUntarAction"
- name="org.eclipse.equinox.p2.touchpoint.natives.cleanupuntar"
- touchpointType="org.eclipse.equinox.p2.native"
- touchpointVersion="1.0.0"
- version="1.0.0">
- </action>
- </extension>
- <extension
- point="org.eclipse.equinox.p2.engine.actions">
- <action
- class="org.eclipse.cdt.internal.p2.touchpoint.natives.actions.TranslateAction"
- name="org.eclipse.equinox.p2.touchpoint.natives.translate"
- touchpointType="org.eclipse.equinox.p2.native"
- touchpointVersion="1.0.0"
- version="1.0.0">
- </action>
- </extension>
-
-</plugin>
diff --git a/p2/org.eclipse.cdt.p2/pom.xml b/p2/org.eclipse.cdt.p2/pom.xml
deleted file mode 100644
index d5bb17c4bdd..00000000000
--- a/p2/org.eclipse.cdt.p2/pom.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
- xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.eclipse.cdt</groupId>
- <artifactId>cdt-parent</artifactId>
- <version>9.0.0-SNAPSHOT</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
-
- <version>1.0.0-SNAPSHOT</version>
- <artifactId>org.eclipse.cdt.p2</artifactId>
- <packaging>eclipse-plugin</packaging>
-</project>
diff --git a/p2/org.eclipse.cdt.p2/src/org/eclipse/cdt/internal/p2/Activator.java b/p2/org.eclipse.cdt.p2/src/org/eclipse/cdt/internal/p2/Activator.java
deleted file mode 100644
index ea1a76e0897..00000000000
--- a/p2/org.eclipse.cdt.p2/src/org/eclipse/cdt/internal/p2/Activator.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2015 Wind River Systems and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.cdt.internal.p2;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Plugin;
-import org.eclipse.core.runtime.Status;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceReference;
-
-/**
- * The activator class controls the plug-in life cycle
- */
-public class Activator extends Plugin {
-
- // The plug-in ID
- public static final String PLUGIN_ID = "org.eclipse.cdt.p2"; //$NON-NLS-1$
-
- // The shared instance
- private static Activator plugin;
-
- /**
- * The constructor
- */
- public Activator() {
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext)
- */
- public void start(BundleContext context) throws Exception {
- super.start(context);
- plugin = this;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
- */
- public void stop(BundleContext context) throws Exception {
- plugin = null;
- super.stop(context);
- }
-
- /**
- * Returns the shared instance
- *
- * @return the shared instance
- */
- public static Activator getDefault() {
- return plugin;
- }
-
- public static BundleContext getContext() {
- return plugin.getBundle().getBundleContext();
- }
-
- /**
- * Return a service from our context.
- *
- * @param name name of the service
- * @return the service
- */
- public static <T> T getService(Class<T> clazz) {
- BundleContext context = plugin.getBundle().getBundleContext();
- ServiceReference<T> ref = context.getServiceReference(clazz);
- return (ref != null) ? context.getService(ref) : null;
- }
-
- public static IStatus getStatus(int severity, String message) {
- return new Status(severity, PLUGIN_ID, message);
- }
-
- public static IStatus getStatus(int severity, Throwable e) {
- return new Status(severity, PLUGIN_ID, e.getLocalizedMessage(), e);
- }
-
- public static void log(IStatus status) {
- plugin.getLog().log(status);
- }
-
- public static void log(CoreException e) {
- plugin.getLog().log(e.getStatus());
- }
-
- public static void log(Throwable e) {
- plugin.getLog().log(getStatus(IStatus.ERROR, e));
- }
-
-}
diff --git a/p2/org.eclipse.cdt.p2/src/org/eclipse/cdt/internal/p2/touchpoint/natives/actions/CleanupUnpackAction.java b/p2/org.eclipse.cdt.p2/src/org/eclipse/cdt/internal/p2/touchpoint/natives/actions/CleanupUnpackAction.java
deleted file mode 100644
index d4f893902c9..00000000000
--- a/p2/org.eclipse.cdt.p2/src/org/eclipse/cdt/internal/p2/touchpoint/natives/actions/CleanupUnpackAction.java
+++ /dev/null
@@ -1,12 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2015 QNX Software Systems and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *******************************************************************************/
-package org.eclipse.cdt.internal.p2.touchpoint.natives.actions;
-
-public class CleanupUnpackAction {
-
-}
diff --git a/p2/org.eclipse.cdt.p2/src/org/eclipse/cdt/internal/p2/touchpoint/natives/actions/CleanupUntarAction.java b/p2/org.eclipse.cdt.p2/src/org/eclipse/cdt/internal/p2/touchpoint/natives/actions/CleanupUntarAction.java
deleted file mode 100644
index a6d21531b0c..00000000000
--- a/p2/org.eclipse.cdt.p2/src/org/eclipse/cdt/internal/p2/touchpoint/natives/actions/CleanupUntarAction.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Wind River Systems and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.cdt.internal.p2.touchpoint.natives.actions;
-
-import java.io.File;
-import java.util.Map;
-import java.util.StringTokenizer;
-
-import org.eclipse.cdt.internal.p2.Activator;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.equinox.internal.p2.engine.Profile;
-import org.eclipse.equinox.internal.p2.touchpoint.natives.Messages;
-import org.eclipse.equinox.internal.p2.touchpoint.natives.Util;
-import org.eclipse.equinox.internal.p2.touchpoint.natives.actions.ActionConstants;
-import org.eclipse.equinox.p2.engine.spi.ProvisioningAction;
-import org.eclipse.equinox.p2.metadata.IInstallableUnit;
-import org.eclipse.osgi.util.NLS;
-
-/**
- * Cleanup an untared artifact.
- *
- * syntax: cleanupuntar(source:@artifact, target:${installFolder}/<subdir>, compression:[gz|bz2])
- *
- * @author DSchaefe
- *
- */
-public class CleanupUntarAction extends ProvisioningAction {
-
- private static final String ACTION_NAME = "cleanupuntar";
-
- @Override
- public IStatus execute(Map parameters) {
- try {
- return cleanup(parameters);
- } catch (Exception e) {
- return new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getLocalizedMessage(), e);
- }
- }
-
- @Override
- public IStatus undo(Map parameters) {
- try {
- return UntarAction.untar(parameters);
- } catch (Exception e) {
- return new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getLocalizedMessage(), e);
- }
- }
-
- public static IStatus cleanup(Map parameters) {
- String source = (String)parameters.get(ActionConstants.PARM_SOURCE);
- if (source == null)
- return Util.createError(NLS.bind(Messages.param_not_set, ActionConstants.PARM_SOURCE, ACTION_NAME));
-
- String target = (String)parameters.get(ActionConstants.PARM_TARGET);
- if (target == null)
- return Util.createError(NLS.bind(Messages.param_not_set, ActionConstants.PARM_TARGET, ACTION_NAME));
-
- IInstallableUnit iu = (IInstallableUnit) parameters.get(ActionConstants.PARM_IU);
- Profile profile = (Profile) parameters.get(ActionConstants.PARM_PROFILE);
-
- String fileList = profile.getInstallableUnitProperty(iu, "unzipped" + ActionConstants.PIPE + source + ActionConstants.PIPE + target);
- StringTokenizer tokenizer = new StringTokenizer(fileList, ActionConstants.PIPE);
- while (tokenizer.hasMoreTokens()) {
- String filename = tokenizer.nextToken();
- for (File file = new File(filename); file.delete(); file = file.getParentFile());
- }
-
- return Status.OK_STATUS;
- }
-}
diff --git a/p2/org.eclipse.cdt.p2/src/org/eclipse/cdt/internal/p2/touchpoint/natives/actions/Messages.java b/p2/org.eclipse.cdt.p2/src/org/eclipse/cdt/internal/p2/touchpoint/natives/actions/Messages.java
deleted file mode 100644
index 9a5c42437aa..00000000000
--- a/p2/org.eclipse.cdt.p2/src/org/eclipse/cdt/internal/p2/touchpoint/natives/actions/Messages.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2015 QNX Software Systems and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *******************************************************************************/
-package org.eclipse.cdt.internal.p2.touchpoint.natives.actions;
-
-import org.eclipse.osgi.util.NLS;
-
-public class Messages extends NLS {
- private static final String BUNDLE_NAME = "org.eclipse.cdt.internal.p2.touchpoint.natives.actions.messages"; //$NON-NLS-1$
- public static String UnpackAction_ParmNotPresent;
- public static String UnpackAction_TargetDirExists;
- static {
- // initialize resource bundle
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
-
- private Messages() {
- }
-}
diff --git a/p2/org.eclipse.cdt.p2/src/org/eclipse/cdt/internal/p2/touchpoint/natives/actions/TranslateAction.java b/p2/org.eclipse.cdt.p2/src/org/eclipse/cdt/internal/p2/touchpoint/natives/actions/TranslateAction.java
deleted file mode 100644
index ef6d60dce39..00000000000
--- a/p2/org.eclipse.cdt.p2/src/org/eclipse/cdt/internal/p2/touchpoint/natives/actions/TranslateAction.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Wind River Systems and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.cdt.internal.p2.touchpoint.natives.actions;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileReader;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import org.eclipse.cdt.internal.p2.Activator;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.equinox.internal.p2.touchpoint.natives.actions.ActionConstants;
-import org.eclipse.equinox.p2.engine.spi.ProvisioningAction;
-
-/**
- * Action for post processing files to replace strings based on the install, such
- * as install location.
- *
- * @author Doug Schaefer
- */
-public class TranslateAction extends ProvisioningAction {
-
- private static final String PARM_MAP = "map";
-
- static int n;
-
- @Override
- public IStatus execute(Map<String, Object> parameters) {
- // The file to process
- String targetFileName = (String)parameters.get(ActionConstants.PARM_TARGET_FILE);
- File targetFile = new File(targetFileName);
- if (!targetFile.exists())
- return new Status(IStatus.WARNING, Activator.PLUGIN_ID, targetFileName + " not found");
-
- // The replacement map
- String mapString = (String)parameters.get(PARM_MAP);
- String[] mapStrings = mapString.split("!");
- Map<String, String> map = new HashMap<String, String>();
- for (int i = 0; i < mapStrings.length; i += 2) {
- if (i == mapStrings.length - 1)
- // Odd number of strings
- break;
- map.put(mapStrings[i], mapStrings[i + 1]);
- }
-
-
- try {
- BufferedReader reader = new BufferedReader(new FileReader(targetFile));
- File tmpFile = new File(targetFile.getParentFile(), "translate" + (n++));
- FileWriter writer = new FileWriter(tmpFile);
-
- Pattern pattern = Pattern.compile("!(.*)!");
- for (String line = reader.readLine(); line != null; line = reader.readLine()) {
- Matcher matcher = pattern.matcher(line);
- while (matcher.find()) {
- String value = map.get(matcher.group(1));
- if (value != null) {
- line = line.replace(matcher.group(), value);
- matcher.reset(line);
- }
- }
- writer.write(line);
- writer.write('\n');
- }
-
- reader.close();
- writer.close();
-
- targetFile.delete();
- tmpFile.renameTo(targetFile);
- } catch (IOException e) {
- return new Status(IStatus.WARNING, Activator.PLUGIN_ID, e.getLocalizedMessage(), e);
- }
- return Status.OK_STATUS;
- }
-
- @Override
- public IStatus undo(Map<String, Object> parameters) {
- // No real undo since the file will likely be deleted.
- return Status.OK_STATUS;
- }
-
-}
diff --git a/p2/org.eclipse.cdt.p2/src/org/eclipse/cdt/internal/p2/touchpoint/natives/actions/UnpackAction.java b/p2/org.eclipse.cdt.p2/src/org/eclipse/cdt/internal/p2/touchpoint/natives/actions/UnpackAction.java
deleted file mode 100644
index 9953449665c..00000000000
--- a/p2/org.eclipse.cdt.p2/src/org/eclipse/cdt/internal/p2/touchpoint/natives/actions/UnpackAction.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2015 QNX Software Systems and others
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * QNX Software Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.cdt.internal.p2.touchpoint.natives.actions;
-
-import java.io.BufferedInputStream;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.nio.file.Files;
-import java.nio.file.Paths;
-import java.util.Map;
-
-import org.apache.commons.compress.archivers.tar.TarArchiveEntry;
-import org.apache.commons.compress.archivers.tar.TarArchiveInputStream;
-import org.apache.commons.compress.compressors.bzip2.BZip2CompressorInputStream;
-import org.apache.commons.compress.compressors.gzip.GzipCompressorInputStream;
-import org.apache.commons.compress.compressors.xz.XZCompressorInputStream;
-import org.eclipse.cdt.internal.p2.Activator;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.equinox.p2.engine.IProfile;
-import org.eclipse.equinox.p2.engine.spi.ProvisioningAction;
-
-/**
- * Unpack the artifact with a choice of compression
- *
- * syntax: unpack(source:<url>, targetDir:${installFolder}/<subdir>, compression:[gz|bz2])
- */
-public class UnpackAction extends ProvisioningAction {
-
- private static final String ACTION_NAME = "unpack"; //$NON-NLS-1$
- private static final String PARM_SOURCE = "source"; //$NON-NLS-1$
- private static final String PARM_TARGET_DIR = "targetDir"; //$NON-NLS-1$
- private static final String PARM_FORMAT = "format"; //$NON-NLS-1$
-
- @Override
- public IStatus execute(Map<String, Object> parameters) {
- try {
- String source = (String)parameters.get(PARM_SOURCE);
- if (source == null) {
- return Activator.getStatus(IStatus.ERROR, String.format(Messages.UnpackAction_ParmNotPresent, PARM_SOURCE, ACTION_NAME));
- }
-
- String targetDir = (String)parameters.get(PARM_TARGET_DIR);
- if (targetDir == null) {
- return Activator.getStatus(IStatus.ERROR, String.format(Messages.UnpackAction_ParmNotPresent, PARM_TARGET_DIR, ACTION_NAME));
- }
-
- String format = (String)parameters.get(PARM_FORMAT);
- if (format == null) {
- return Activator.getStatus(IStatus.ERROR, String.format(Messages.UnpackAction_ParmNotPresent, PARM_FORMAT, ACTION_NAME));
- }
-
- IProfile profile = (IProfile) parameters.get("profile"); //$NON-NLS-1$
- File installFolder = new File(profile.getProperty(IProfile.PROP_INSTALL_FOLDER));
- File destDir = new File(installFolder, targetDir);
- if (destDir.exists()) {
- return Activator.getStatus(IStatus.ERROR, String.format(org.eclipse.cdt.internal.p2.touchpoint.natives.actions.Messages.UnpackAction_TargetDirExists, destDir.getAbsolutePath()));
- }
-
- URL url = new URL(source);
- InputStream fileIn = new BufferedInputStream(url.openStream());
-
- switch (format) {
- case "tar.gz": //$NON-NLS-1$
- InputStream gzIn = new GzipCompressorInputStream(fileIn);
- untar(gzIn, destDir);
- break;
- case "tar.bz2": //$NON-NLS-1$
- InputStream bzIn = new BZip2CompressorInputStream(fileIn);
- untar(bzIn, destDir);
- break;
- case "tar.xz": //$NON-NLS-1$
- InputStream xzIn = new XZCompressorInputStream(fileIn);
- untar(xzIn, destDir);
- break;
- case "zip": //$NON-NLS-1$
-
- }
-
- return Status.OK_STATUS;
- } catch (Throwable e) {
- return new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getLocalizedMessage(), e);
- }
- }
-
- private void untar(InputStream in, File destDir) throws IOException {
- byte[] buff = new byte[4096];
- try (TarArchiveInputStream tarIn = new TarArchiveInputStream(in)) {
- for (TarArchiveEntry entry = tarIn.getNextTarEntry(); entry != null; entry = tarIn.getNextTarEntry()) {
- String name = entry.getName();
- File destFile = new File(destDir, name);
- if (entry.isSymbolicLink()) {
- Files.createSymbolicLink(destFile.toPath(), Paths.get(name));
- } else {
- try (FileOutputStream out = new FileOutputStream(destFile)) {
- long size = entry.getSize();
- while (size > 0) {
- int n = tarIn.read(buff, 0, (int)Math.min(size, buff.length));
- out.write(buff, 0, n);
- size -= n;
- }
- }
- chmod(destFile, entry.getMode());
- }
- }
- }
- }
-
- private void chmod(File file, int mode) {
- file.setExecutable((mode & 0111) != 0, (mode & 0110) == 0);
- file.setWritable((mode & 0222) != 0, (mode & 0220) == 0);
- file.setReadable((mode & 0444) != 0, (mode & 0440) == 0);
- }
-
- @Override
- public IStatus undo(Map<String, Object> parameters) {
- try {
- return CleanupUntarAction.cleanup(parameters);
- } catch (Exception e) {
- return new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getLocalizedMessage(), e);
- }
- }
-
-}
diff --git a/p2/org.eclipse.cdt.p2/src/org/eclipse/cdt/internal/p2/touchpoint/natives/actions/UntarAction.java b/p2/org.eclipse.cdt.p2/src/org/eclipse/cdt/internal/p2/touchpoint/natives/actions/UntarAction.java
deleted file mode 100644
index 2ff0bb69d95..00000000000
--- a/p2/org.eclipse.cdt.p2/src/org/eclipse/cdt/internal/p2/touchpoint/natives/actions/UntarAction.java
+++ /dev/null
@@ -1,184 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Wind River Systems and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.cdt.internal.p2.touchpoint.natives.actions;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.zip.GZIPInputStream;
-
-import org.apache.tools.bzip2.CBZip2InputStream;
-import org.apache.tools.tar.TarEntry;
-import org.apache.tools.tar.TarInputStream;
-import org.eclipse.cdt.internal.p2.Activator;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.equinox.internal.p2.engine.Profile;
-import org.eclipse.equinox.internal.p2.touchpoint.natives.Messages;
-import org.eclipse.equinox.internal.p2.touchpoint.natives.Util;
-import org.eclipse.equinox.internal.p2.touchpoint.natives.actions.ActionConstants;
-import org.eclipse.equinox.internal.p2.touchpoint.natives.actions.UnzipAction;
-import org.eclipse.equinox.p2.core.IProvisioningAgent;
-import org.eclipse.equinox.p2.core.ProvisionException;
-import org.eclipse.equinox.p2.engine.spi.ProvisioningAction;
-import org.eclipse.equinox.p2.metadata.IArtifactKey;
-import org.eclipse.equinox.p2.metadata.IInstallableUnit;
-import org.eclipse.equinox.p2.repository.artifact.IFileArtifactRepository;
-import org.eclipse.osgi.util.NLS;
-
-/**
- * Untar the artifact with a choice of compression
- *
- * syntax: untar(source:@artifact, target:${installFolder}/<subdir>, compression:[gz|bz2])
- *
- * @author DSchaefe
- *
- */
-public class UntarAction extends ProvisioningAction {
-
- private static final String ACTION_NAME = "untar";
- private static final String PARM_COMPRESSION = "compression";
- private static final String VALUE_GZ = "gz";
- private static final String VALUE_BZ2 = "bz2";
-
- private enum Compression {
- none,
- gz,
- bz2
- }
-
- @Override
- public IStatus execute(Map parameters) {
- try {
- return untar(parameters);
- } catch (Exception e) {
- return new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getLocalizedMessage(), e);
- }
- }
-
- @Override
- public IStatus undo(Map parameters) {
- try {
- return CleanupUntarAction.cleanup(parameters);
- } catch (Exception e) {
- return new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getLocalizedMessage(), e);
- }
- }
-
- public static IStatus untar(Map parameters) throws Exception {
- String source = (String)parameters.get(ActionConstants.PARM_SOURCE);
- if (source == null)
- return Util.createError(NLS.bind(Messages.param_not_set, ActionConstants.PARM_SOURCE, ACTION_NAME));
-
- String originalSource = source;
- String target = (String)parameters.get(ActionConstants.PARM_TARGET);
- if (target == null)
- return Util.createError(NLS.bind(Messages.param_not_set, ActionConstants.PARM_TARGET, ACTION_NAME));
-
- String compressionStr = (String)parameters.get(PARM_COMPRESSION);
- Compression compression;
- if (compressionStr == null)
- return Util.createError(NLS.bind(Messages.param_not_set, PARM_COMPRESSION, ACTION_NAME));
- else if (compressionStr.equals(VALUE_GZ))
- compression = Compression.gz;
- else if (compressionStr.equals(VALUE_BZ2))
- compression = Compression.bz2;
- else
- // TODO Should put out a log if compression is unknown
- compression = Compression.none;
-
- IInstallableUnit iu = (IInstallableUnit) parameters.get(ActionConstants.PARM_IU);
- Profile profile = (Profile) parameters.get(ActionConstants.PARM_PROFILE);
- IProvisioningAgent agent = (IProvisioningAgent) parameters.get(ActionConstants.PARM_AGENT);
-
- if (source.equals(ActionConstants.PARM_AT_ARTIFACT)) {
- //TODO: fix wherever this occurs -- investigate as this is probably not desired
- if (iu.getArtifacts() == null || iu.getArtifacts().size() == 0)
- return Status.OK_STATUS;
-
- IArtifactKey artifactKey = iu.getArtifacts().iterator().next();
-
- IFileArtifactRepository downloadCache;
- try {
- downloadCache = Util.getDownloadCacheRepo(agent);
- } catch (ProvisionException e) {
- return e.getStatus();
- }
- File fileLocation = downloadCache.getArtifactFile(artifactKey);
- if ((fileLocation == null) || !fileLocation.exists())
- return Util.createError(NLS.bind(Messages.artifact_not_available, artifactKey));
- source = fileLocation.getAbsolutePath();
- }
-
- File[] unzippedFiles = untar(source, target, compression);
- StringBuffer unzippedFileNameBuffer = new StringBuffer();
- for (int i = 0; i < unzippedFiles.length; i++)
- unzippedFileNameBuffer.append(unzippedFiles[i].getAbsolutePath()).append(ActionConstants.PIPE);
-
- profile.setInstallableUnitProperty(iu, "unzipped" + ActionConstants.PIPE + originalSource + ActionConstants.PIPE + target, unzippedFileNameBuffer.toString()); //$NON-NLS-1$
- return Status.OK_STATUS;
- }
-
- private static File[] untar(String source, String destination, Compression compression) throws Exception {
- File zipFile = new File(source);
- if (!zipFile.exists()) {
- Util.log(UnzipAction.class.getName() + " the files to be unzipped is not here"); //$NON-NLS-1$
- }
-
- File target = new File(destination);
-
- FileInputStream fileIn = new FileInputStream(zipFile);
- InputStream compIn = fileIn;
- if (compression.equals(Compression.gz))
- compIn = new GZIPInputStream(fileIn);
- else if (compression.equals(Compression.bz2)) {
- // Skip the magic bytes first
- fileIn.read(new byte[2]);
- compIn = new CBZip2InputStream(fileIn);
- }
-
- ArrayList<File> fileList = new ArrayList<File>();
- TarInputStream tarIn = new TarInputStream(compIn);
- for (TarEntry tarEntry = tarIn.getNextEntry(); tarEntry != null; tarEntry = tarIn.getNextEntry()) {
- File outFile = new File(target, tarEntry.getName());
- if (tarEntry.isDirectory()) {
- outFile.mkdirs();
- } else {
- if (outFile.exists())
- outFile.delete();
- else
- outFile.getParentFile().mkdirs();
- FileOutputStream outStream = new FileOutputStream(outFile);
- tarIn.copyEntryContents(outStream);
- outStream.close();
-
- // Set last modified time from the tar entry
- long lastModified = tarEntry.getModTime().getTime();
- outFile.setLastModified(lastModified);
-
- // Set the executable bits from the tar entry
- // we let the umask determine the r/w
- int mode = tarEntry.getMode();
- boolean exec = (mode & 0x111) != 0;
- boolean execOwner = (mode & 0x11) == 0;
-// outFile.setExecutable(exec, execOwner);
-
- fileList.add(outFile);
- }
- }
- tarIn.close();
- return fileList.toArray(new File[fileList.size()]);
- }
-
-}
diff --git a/p2/org.eclipse.cdt.p2/src/org/eclipse/cdt/internal/p2/touchpoint/natives/actions/messages.properties b/p2/org.eclipse.cdt.p2/src/org/eclipse/cdt/internal/p2/touchpoint/natives/actions/messages.properties
deleted file mode 100644
index ec202bf7636..00000000000
--- a/p2/org.eclipse.cdt.p2/src/org/eclipse/cdt/internal/p2/touchpoint/natives/actions/messages.properties
+++ /dev/null
@@ -1,2 +0,0 @@
-UnpackAction_ParmNotPresent=The "{0}" parameter was not set in the "{1}" action.
-UnpackAction_TargetDirExists=The target directory exists: {0}

Back to the top