Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 99745 Details for
Bug 231200
[ui] Updated locked iu by using install
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
patch for checking update lock
bug231200.patch (text/plain), 5.07 KB, created by
Susan McCourt
on 2008-05-12 12:33:10 EDT
(
hide
)
Description:
patch for checking update lock
Filename:
MIME Type:
Creator:
Susan McCourt
Created:
2008-05-12 12:33:10 EDT
Size:
5.07 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.equinox.p2.ui >Index: src/org/eclipse/equinox/internal/provisional/p2/ui/actions/InstallAction.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/provisional/p2/ui/actions/InstallAction.java,v >retrieving revision 1.11 >diff -u -r1.11 InstallAction.java >--- src/org/eclipse/equinox/internal/provisional/p2/ui/actions/InstallAction.java 7 May 2008 15:18:20 -0000 1.11 >+++ src/org/eclipse/equinox/internal/provisional/p2/ui/actions/InstallAction.java 12 May 2008 16:31:09 -0000 >@@ -51,13 +51,24 @@ > // If the iu is a newer version of something already installed, consider this an > // update request > if (compareTo > 0) { >- request.addInstallableUnits(new IInstallableUnit[] {ius[i]}); >- request.removeInstallableUnits(new IInstallableUnit[] {installedIU}); >- // Mark it as a root if it hasn't been already >- if (!Boolean.toString(true).equals(profile.getInstallableUnitProperty(installedIU, IInstallableUnit.PROP_PROFILE_ROOT_IU))) >- request.setInstallableUnitProfileProperty(ius[i], IInstallableUnit.PROP_PROFILE_ROOT_IU, Boolean.toString(true)); >- // Add a status informing the user that the update has been inferred >- additionalStatus.merge(PlanStatusHelper.getStatus(IStatusCodes.IMPLIED_UPDATE, ius[i])); >+ int lock = getLock(profile, installedIU); >+ // If it is locked for update, we don't allow it. >+ if ((lock & IInstallableUnit.LOCK_UPDATE) == IInstallableUnit.LOCK_UPDATE) { >+ // Tell the user it's already installed. >+ // TODO this would seem odd if the user didn't know they had it installed. If it's not marked >+ // as a root, they can't see it. But silently marking it as a root as we do when the versions are the >+ // same would make it look like we installed the wrong version. And a message saying, "you didn't know >+ // this, but you already have an older version of this installed" is not so great either. >+ additionalStatus.merge(PlanStatusHelper.getStatus(IStatusCodes.IGNORED_ALREADY_INSTALLED, ius[i])); >+ } else { >+ request.addInstallableUnits(new IInstallableUnit[] {ius[i]}); >+ request.removeInstallableUnits(new IInstallableUnit[] {installedIU}); >+ // Mark it as a root if it hasn't been already >+ if (!Boolean.toString(true).equals(profile.getInstallableUnitProperty(installedIU, IInstallableUnit.PROP_PROFILE_ROOT_IU))) >+ request.setInstallableUnitProfileProperty(ius[i], IInstallableUnit.PROP_PROFILE_ROOT_IU, Boolean.toString(true)); >+ // Add a status informing the user that the update has been inferred >+ additionalStatus.merge(PlanStatusHelper.getStatus(IStatusCodes.IMPLIED_UPDATE, ius[i])); >+ } > } else if (compareTo < 0) { > // An implied downgrade. We will not put this in the plan, add a status informing the user > additionalStatus.merge(PlanStatusHelper.getStatus(IStatusCodes.IGNORED_IMPLIED_DOWNGRADE, ius[i])); >Index: src/org/eclipse/equinox/internal/provisional/p2/ui/actions/ProfileModificationAction.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/provisional/p2/ui/actions/ProfileModificationAction.java,v >retrieving revision 1.11 >diff -u -r1.11 ProfileModificationAction.java >--- src/org/eclipse/equinox/internal/provisional/p2/ui/actions/ProfileModificationAction.java 30 Apr 2008 22:46:53 -0000 1.11 >+++ src/org/eclipse/equinox/internal/provisional/p2/ui/actions/ProfileModificationAction.java 12 May 2008 16:31:09 -0000 >@@ -36,6 +36,19 @@ > IProfileChooser profileChooser; > Policies policies; > >+ protected static int getLock(IProfile profile, IInstallableUnit iu) { >+ if (profile == null) >+ return IInstallableUnit.LOCK_NONE; >+ try { >+ String value = profile.getInstallableUnitProperty(iu, IInstallableUnit.PROP_PROFILE_LOCKED_IU); >+ if (value != null) >+ return Integer.parseInt(value); >+ } catch (NumberFormatException e) { >+ // ignore and assume no lock >+ } >+ return IInstallableUnit.LOCK_NONE; >+ } >+ > protected ProfileModificationAction(String text, ISelectionProvider selectionProvider, String profileId, IProfileChooser profileChooser, Policies policies, Shell shell) { > super(text, selectionProvider, shell); > this.profileId = profileId; >@@ -154,19 +167,6 @@ > > protected abstract boolean isEnabledFor(Object[] selections); > >- protected int getLock(IProfile profile, IInstallableUnit iu) { >- if (profile == null) >- return IInstallableUnit.LOCK_NONE; >- try { >- String value = profile.getInstallableUnitProperty(iu, IInstallableUnit.PROP_PROFILE_LOCKED_IU); >- if (value != null) >- return Integer.parseInt(value); >- } catch (NumberFormatException e) { >- // ignore and assume no lock >- } >- return IInstallableUnit.LOCK_NONE; >- } >- > protected IProfile getProfile(boolean chooseProfile) { > try { > String id = getProfileId(chooseProfile);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 231200
:
99745
|
129006
|
129264
|
129276