| Summary: | [ui] Install from Update Site does not distinguish between target OSes | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Equinox | Reporter: | Robert Weisz <weisz> | ||||||||||||||
| Component: | p2 | Assignee: | DJ Houghton <dj.houghton> | ||||||||||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||||||||||
| Severity: | normal | ||||||||||||||||
| Priority: | P3 | CC: | john.arthorne, susan, thomas | ||||||||||||||
| Version: | 3.6 | Flags: | john.arthorne:
review+
|
||||||||||||||
| Target Milestone: | 3.7 M5 | ||||||||||||||||
| Hardware: | PC | ||||||||||||||||
| OS: | Windows XP | ||||||||||||||||
| Whiteboard: | |||||||||||||||||
| Attachments: |
|
||||||||||||||||
|
Description
Robert Weisz
Created attachment 178102 [details]
Screenshots of Update Site
Created attachment 178103 [details]
picked the wrong OS
This behavior is reproducible in 3.5 as well as 3.6. Example Update Site file CC.zip is 3MB, so too large to attach directly it seems. Looking for alternatives. Created attachment 178115 [details]
Testcase Update site
The content of attachment 178115 [details] has been deleted by Denis Roy <denis.roy@eclipse.org> who provided the following reason: Deleted as requested by the team The token used to delete this attachment was generated at 2010-09-03 17:30:56 EDT. Thomas, I believe this should be done in the UI but I am having problems writing the proper query. Basically it should be a query which is "all IUs whose filter matches the given os/ws/nl combo". I've tried writing some compound queries but keep getting an IllegalArgumentException when I get to the filter matching part. I've looked at the doc on the wiki but am stumped. Do you have any suggestions? Thanks. The IU filter will match against a special IU (the 'context' IU). You can create this IU like this:
Map env = new Hashtable();
env.put("osgi.os", "linux");
env.put("osgi.ws", "gtk");
env.put("osgi.arch", "x86");
IInstallableUnit envIU = InstallableUnit.contextIU(env);
Now, if you only want to match IU's on filters, you just do this.
IQuery<IInstallableUnit> query = QueryUtil.createMatchQuery("$0 ~= filter", envIU);
Cool, thanks Thomas. I've modified it slightly to suit my needs and it works.
For reference, this is what I've done:
IQuery<IInstallableUnit> groupQuery = QueryUtil.createIUGroupQuery();
IQuery<IInstallableUnit> filterQuery = QueryUtil.createMatchQuery("filter == null || $0 ~= filter", envIU);
IQuery<IInstallableUnit> query = QueryUtil.createCompoundQuery(groupQuery, filterQuery, true);
Created attachment 178520 [details]
patch
Here is a patch which adds a new checkbox to the Available IUs page and filters out the results based on the profile's environment settings, if applicable.
Comment on attachment 178520 [details]
patch
Patch isn't quite right, doesn't handle the case where we are viewing via categories.
Created attachment 178525 [details]
updated patch
Here is an updated patch which works whether we are viewing by category, or not.
Susan, do you mind reviewing this one for me? I think it is pretty straight forward but I'm not a UI guy. No hurry to get it in for the milestone next week. I'll mark it M3 so we don't lose track of it. Bumping to M4 since I'm going to be on holidays. Susan, if you have time to review feel free to release for M3. Created attachment 184467 [details]
update site for testing
Looks good. I also tested on the helios repository, where it filtered out the Linux-specific contributions from Linux tools project. Patch released to HEAD. |