Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDJ Houghton2008-10-08 16:15:26 -0400
committerDJ Houghton2008-10-08 16:15:26 -0400
commita4f6c2bdd8c19fd79dd3685ee758e2358e0c1abf (patch)
treec534d1fdb6ba8e2a136633108b8896a7caad9c4a /bundles/org.eclipse.equinox.p2.directorywatcher
parent4b6b58721c910afd1416703aaebb77002af9f718 (diff)
downloadrt.equinox.p2-a4f6c2bdd8c19fd79dd3685ee758e2358e0c1abf.tar.gz
rt.equinox.p2-a4f6c2bdd8c19fd79dd3685ee758e2358e0c1abf.tar.xz
rt.equinox.p2-a4f6c2bdd8c19fd79dd3685ee758e2358e0c1abf.zip
Bug 232094 - Removing file from link folder doesn't uninstall bundles
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.directorywatcher')
-rw-r--r--bundles/org.eclipse.equinox.p2.directorywatcher/META-INF/MANIFEST.MF1
-rw-r--r--bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/EntryAdvice.java7
-rw-r--r--bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/RepositoryListener.java6
3 files changed, 12 insertions, 2 deletions
diff --git a/bundles/org.eclipse.equinox.p2.directorywatcher/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.directorywatcher/META-INF/MANIFEST.MF
index 88746d492..d0686ad0a 100644
--- a/bundles/org.eclipse.equinox.p2.directorywatcher/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.equinox.p2.directorywatcher/META-INF/MANIFEST.MF
@@ -7,6 +7,7 @@ Bundle-Localization: plugin
Bundle-Version: 1.0.100.qualifier
Import-Package: org.eclipse.equinox.internal.p2.core.helpers,
org.eclipse.equinox.internal.p2.metadata,
+ org.eclipse.equinox.internal.p2.update,
org.eclipse.equinox.internal.provisional.p2.artifact.repository,
org.eclipse.equinox.internal.provisional.p2.core,
org.eclipse.equinox.internal.provisional.p2.core.eventbus,
diff --git a/bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/EntryAdvice.java b/bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/EntryAdvice.java
index 5bc1ab6d2..e455fb345 100644
--- a/bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/EntryAdvice.java
+++ b/bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/EntryAdvice.java
@@ -14,6 +14,7 @@ import java.io.File;
import java.net.URL;
import java.util.Map;
import java.util.Properties;
+import org.eclipse.equinox.internal.p2.update.Site;
import org.eclipse.equinox.p2.publisher.eclipse.*;
import org.osgi.framework.Version;
@@ -47,6 +48,10 @@ public class EntryAdvice implements IFeatureAdvice, IBundleAdvice {
}
void setProperties(File location, long timestamp, URL reference) {
+ setProperties(location, timestamp, reference, null);
+ }
+
+ void setProperties(File location, long timestamp, URL reference, String linkFile) {
if (reference == null)
artifactProps.remove(RepositoryListener.ARTIFACT_REFERENCE);
else
@@ -58,6 +63,8 @@ public class EntryAdvice implements IFeatureAdvice, IBundleAdvice {
artifactProps.setProperty(RepositoryListener.FILE_NAME, location.getAbsolutePath());
metadataProps.setProperty(RepositoryListener.FILE_NAME, location.getAbsolutePath());
metadataProps.setProperty(RepositoryListener.FILE_LAST_MODIFIED, Long.toString(timestamp));
+ if (linkFile != null)
+ metadataProps.setProperty(Site.PROP_LINK_FILE, linkFile);
}
public Map getInstructions(File location) {
diff --git a/bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/RepositoryListener.java b/bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/RepositoryListener.java
index cc9d31f62..807c8527d 100644
--- a/bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/RepositoryListener.java
+++ b/bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/RepositoryListener.java
@@ -16,6 +16,7 @@ import java.net.URL;
import java.util.*;
import org.eclipse.core.runtime.*;
import org.eclipse.equinox.internal.p2.core.helpers.LogHelper;
+import org.eclipse.equinox.internal.p2.update.Site;
import org.eclipse.equinox.internal.provisional.p2.artifact.repository.*;
import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException;
import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepository;
@@ -155,7 +156,7 @@ public class RepositoryListener extends DirectoryChangeListener {
if (bundleDescription == null)
return false;
try {
- advice.setProperties(file, file.lastModified(), file.toURL());
+ advice.setProperties(file, file.lastModified(), file.toURL(), null);
} catch (MalformedURLException e) {
// should never happen
}
@@ -167,7 +168,8 @@ public class RepositoryListener extends DirectoryChangeListener {
private boolean processFeature(File file, boolean isAddition) {
try {
- advice.setProperties(file, file.lastModified(), file.toURL());
+ String link = (String) metadataRepository.getProperties().get(Site.PROP_LINK_FILE);
+ advice.setProperties(file, file.lastModified(), file.toURL(), link);
} catch (MalformedURLException e) {
// should never happen
}

Back to the top