Bug 16718

Summary: Possibility for a corrupt feature on install
Product: [Eclipse Project] Platform Reporter: Vlad Klicnik <klicnik>
Component: Update (deprecated - use Eclipse>Equinox>p2)Assignee: Christophe Elek <celek>
Status: RESOLVED FIXED QA Contact:
Severity: critical    
Priority: P1    
Version: 2.0   
Target Milestone: 2.0 F2   
Hardware: PC   
OS: Windows 2000   
Whiteboard:
Attachments:
Description Flags
Dialog if an 'imposter feature' is installed [GIF] none

Description Vlad Klicnik CLA 2002-05-22 02:42:52 EDT
I have not actually observed the corruption, but an deducing this from the 
function behavior.

We currently download and install the feature files even if they already exist. 
The download part I am OK with, but the install is a potential timebomb. I have 
noticed that when we install nested features, the feature files for feature 1 
are installed before we start downloading files for feature 2. If the user 
cancels the operation, feature 1 is left in the feature9999999.xml state. If 
this was a feature that already existed prior to the install, we just blew it 
away.


Som we can download feature jar for features that are already installe (no 
harm) but we MUST NOT actually overwrite files for an existing feature (ie. we 
skip the install copy step for the feature files and only install diffed 
plugins)
Comment 1 Christophe Elek CLA 2002-05-24 08:12:21 EDT
We need to NOT install feature files if the feature already exists (what about
checking, do we check the file system for the directory or the plugin version,
b/c we can have a plugin org.plugin1 in com.company.plugin23_2.0.0 right)

Then we have to check the abort and remove doesn't remove the feature files
Comment 2 Vlad Klicnik CLA 2002-05-24 09:31:22 EDT
* if feature with same id & version is already on site, skip file copy
* if not, check if <id>_<version>/feature.xml exists
* if not .... go ahead and copy
* if yes, we have an "imposter" feature living in the target directory .... 
CoreException
Comment 3 Christophe Elek CLA 2002-05-24 12:29:57 EDT
Feature.install() checks if a feature with the same id_ver has been installed in
the site.
UpdateManagerUtils.copyToLocal throws an IO Exception if the to create already
exists on the file system.
Comment 4 Christophe Elek CLA 2002-05-24 12:47:42 EDT
Created attachment 1041 [details]
Dialog if an 'imposter feature' is installed [GIF]
Comment 5 Christophe Elek CLA 2002-05-24 13:13:46 EDT
SiteFileContentConsumer and SiteFilePluginContentConsumer now remember which
file they installed. During an abort only these files will be deleted. Issue,
the directories will stay
Comment 6 Christophe Elek CLA 2002-05-24 14:35:19 EDT
Empty directories are removed. Fixed. Version as v20020524_16718
Comment 7 Christophe Elek CLA 2002-05-29 07:41:18 EDT
Fixed, 0528