Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 308038 - CleanupUnzip does not cleanup all directories
Summary: CleanupUnzip does not cleanup all directories
Status: CLOSED FIXED
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: p2 (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.6 M7   Edit
Assignee: Pascal Rapicault CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-03 20:29 EDT by Alin Dreghiciu CLA
Modified: 2010-04-09 20:59 EDT (History)
1 user (show)

See Also:


Attachments
Proposed patch & unit tests (6.68 KB, patch)
2010-04-03 23:15 EDT, Alin Dreghiciu CLA
pascal: iplog+
Details | Diff
Zip used in tests (546 bytes, application/zip)
2010-04-04 21:28 EDT, Alin Dreghiciu CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alin Dreghiciu CLA 2010-04-03 20:29:49 EDT
Build Identifier: 

In case of undoing an unzip action or in case of uninstalling an IU that used unzip not all the created directories are removed.
This is due to the fact that cleanupUnzip deletes the directories in the same order they were processed. The order of processing is from root to leafs (leafs dirs/files). This means that cleanup will try to remove first parent directories, fact that will fail as subdirectories are not yet removed.


Reproducible: Always
Comment 1 Alin Dreghiciu CLA 2010-04-03 23:15:52 EDT
Created attachment 163780 [details]
Proposed patch & unit tests

The patch sorts the directories by path (canonical), where the longest paths are processed first. This ensures that if a folder and subfolder of it are to be removed the subfolder is removed first.
Comment 2 Pascal Rapicault CLA 2010-04-04 20:58:47 EDT
Alin, could you please attach the nestedFolder.zip file that you use in the tests.
Comment 3 Alin Dreghiciu CLA 2010-04-04 21:28:38 EDT
Created attachment 163788 [details]
Zip used in tests

I attached the zip.
Comment 4 Pascal Rapicault CLA 2010-04-09 20:59:08 EDT
Fix released in HEAD.