Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Kaegi2008-03-11 23:33:58 -0400
committerSimon Kaegi2008-03-11 23:33:58 -0400
commitd076abe0626d73a85d6e45d13808df790fadafd6 (patch)
tree992bb484395cea24b8eefc12a797040e438a7c32 /bundles/org.eclipse.equinox.p2.directorywatcher
parenta3baf5e2d89229b2a71c8a80aac168b7cf929450 (diff)
downloadrt.equinox.p2-d076abe0626d73a85d6e45d13808df790fadafd6.tar.gz
rt.equinox.p2-d076abe0626d73a85d6e45d13808df790fadafd6.tar.xz
rt.equinox.p2-d076abe0626d73a85d6e45d13808df790fadafd6.zip
Bug 221031 Directory watcher to support repositories
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.directorywatcher')
-rw-r--r--bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/RepositoryListener.java13
1 files changed, 11 insertions, 2 deletions
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 7087ac0c3..36b6bf9c1 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
@@ -197,7 +197,7 @@ public class RepositoryListener extends DirectoryChangeListener {
return false;
}
- private boolean isFeature(File file) {
+ boolean isFeature(File file) {
return file.isDirectory() && new File(file, "feature.xml").exists();
}
@@ -235,19 +235,28 @@ public class RepositoryListener extends DirectoryChangeListener {
private void synchronizeMetadataRepository() {
final Map snapshot = new HashMap(currentFiles);
+ final List featureFiles = new ArrayList();
Query removeQuery = new Query() {
public boolean isMatch(Object candidate) {
if (!(candidate instanceof IInstallableUnit))
return false;
IInstallableUnit iu = (IInstallableUnit) candidate;
File iuFile = new File(iu.getProperty(FILE_NAME));
+ // feature files generate two ius (group, jar)
+ // check if feature file already matched
+ if (featureFiles.contains(iuFile))
+ return false;
Long iuLastModified = new Long(iu.getProperty(FILE_LAST_MODIFIED));
Long snapshotLastModified = (Long) snapshot.get(iuFile);
if (snapshotLastModified == null || !snapshotLastModified.equals(iuLastModified))
return true;
- // match found. Remove from snapshot to prevent it from being added.
+ // file found. Remove from snapshot to prevent it from being re-added.
snapshot.remove(iuFile);
+
+ if (isFeature(iuFile))
+ featureFiles.add(iuFile);
+
return false;
}
};

Back to the top