Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 215559 - [prov] spoof a profile
Summary: [prov] spoof a profile
Status: RESOLVED FIXED
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: p2 (show other bugs)
Version: 3.4   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 3.4 RC1   Edit
Assignee: Simon Kaegi CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 228030
Blocks: 215557 226349
  Show dependency tree
 
Reported: 2008-01-16 15:37 EST by Andrew Overholt CLA
Modified: 2013-11-13 08:48 EST (History)
5 users (show)

See Also:
john.arthorne: review+


Attachments
work in progress patch (15.08 KB, text/plain)
2008-02-21 18:11 EST, Andrew Overholt CLA
no flags Details
updated patch (22.62 KB, text/plain)
2008-02-21 18:12 EST, Andrew Overholt CLA
no flags Details
my take (15.97 KB, patch)
2008-02-21 23:33 EST, Simon Kaegi CLA
no flags Details | Diff
Latest (2008-02-27) patch including Simon's fixes (17.62 KB, patch)
2008-02-27 10:49 EST, Andrew Overholt CLA
no flags Details | Diff
patch (1.49 KB, patch)
2008-05-02 09:42 EDT, Simon Kaegi CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Overholt CLA 2008-01-16 15:37:20 EST
As part of the shared install work, we're currently thinking about spoofing a profile from the running bundles.txt and maybe metadata denoting root IUs.
Comment 1 Andrew Overholt CLA 2008-02-21 18:09:43 EST
I'm having some issues with the change from IProfile to Profile in SimpleProfileRegistry; specifically saveProfile.  I'm probably just having a braindead moment or two here, but any suggestions would be greatly appreciated.  I'll submit a WIP patch (with one compile error).
Comment 2 Andrew Overholt CLA 2008-02-21 18:11:01 EST
Created attachment 90425 [details]
work in progress patch

Note that there's also the sharedprofile project in CVS.
Comment 3 Andrew Overholt CLA 2008-02-21 18:12:27 EST
Created attachment 90426 [details]
updated patch
Comment 4 Simon Kaegi CLA 2008-02-21 23:33:07 EST
Created attachment 90440 [details]
my take
Comment 5 Andrew Overholt CLA 2008-02-25 10:47:07 EST
Thanks, Simon.

I'm now at the point that I have a single IU with RequiredCapabilities on all IUs in the shared repo (passed via a property) with IInstallableUnit.NAMESPACE_IU_KIND="group".  Is there a better flag or something I should be using?

I run into a problem when attempting to install this IU.  Since the profile doesn't really exist, its install folder is null and therefore when the engine attempts to install, Util.getInstallFolder returns null and the transaction fails.  I would greatly appreciate any suggestions on how to fix.
Comment 6 Andrew Overholt CLA 2008-02-27 10:49:06 EST
Created attachment 90871 [details]
Latest (2008-02-27) patch including Simon's fixes
Comment 7 Susan McCourt CLA 2008-04-17 19:04:37 EDT
Andrew, see bug #215560.
To mark IU's as locked in your spoofed profile, you'll want to use something like:

mySpoofedProfile.setInstallableUnitProfileProperty(iu, IInstallableUnit.PROP_PROFILE_LOCKED_IU, Integer.toString(IInstallableUnit.LOCK_UNINSTALL | IInstallableUnit.LOCK_UPDATE));

The engine and planner don't look at these properties, but the automatic updater and UI do.
Comment 8 Andrew Overholt CLA 2008-04-18 11:44:08 EDT
(In reply to comment #7)
> Andrew, see bug #215560.
> To mark IU's as locked in your spoofed profile, you'll want to use something
> like:
> 
> mySpoofedProfile.setInstallableUnitProfileProperty(iu,
> IInstallableUnit.PROP_PROFILE_LOCKED_IU,
> Integer.toString(IInstallableUnit.LOCK_UNINSTALL |
> IInstallableUnit.LOCK_UPDATE));
> 
> The engine and planner don't look at these properties, but the automatic
> updater and UI do.

Thanks, Susan!
Comment 9 Simon Kaegi CLA 2008-04-29 11:15:38 EDT
Marking for RC1. We have profile surrogate creation code now in the current build but need to at least conside locking the root IUs from the base.
Comment 10 Simon Kaegi CLA 2008-05-01 14:50:52 EDT
For the locks we would use LOCK_UNINSTALL and LOCK_UPDATE from bug 215560. This would just be a lock at the UI level and is ignored for direct changes so would still allow us to update the base directly using the planner.
Comment 11 Simon Kaegi CLA 2008-05-02 09:42:33 EDT
Created attachment 98414 [details]
patch
Comment 12 John Arthorne CLA 2008-05-02 16:34:11 EDT
Looks good.
Comment 13 Simon Kaegi CLA 2008-05-02 17:27:29 EDT
Fixed in HEAD