{
if (iu == null){
throw new BuildException("Attribute 'iu' must be set.");
}
EclipseInfo info = (EclipseInfo)
Installer.getContext().getValue("eclipse.info");
// remove temp formic repositories (update sites)
// FIXME: not working correctly. See org.eclim.installer.eclipse.Application
/*if (iu.equals("org.eclim.installer")){
runCommand(
new Command(this, new String[]{"-removeRepos"}),
"removing temp repositories");
}*/
// uninstall the feature
runCommand(new UninstallCommand(
this, repository, iu, "org.eclipse.equinox.p2.director"),
"uninstalling " + iu);
// http://wiki.eclipse.org/Equinox/p2/FAQ
// run p2 gc to fully remove feature artifacts
runCommand(new Command(
this,
new String[]{"-profile", info.getProfileName()},
"org.eclipse.equinox.p2.garbagecollector.application"),
"invoking p2 gc");
// FIXME: hack since the -removeRepos method isn't working.
if (iu.equals("org.eclim.installer")){
String prefs =
info.getLocalPath() +
"/p2/org.eclipse.equinox.p2.engine/profileRegistry/" +
info.getProfileName() +
".profile/.data/.settings/org.eclipse.equinox.p2.metadata.repository.prefs";
logger.info("Removing temp repositories from p2 prefs: " + prefs);
File prefFile = new File(prefs);
File prefFileNew = new File(prefs + ".tmp");
if (!prefFile.exists()){