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 159062 Details for
Bug 302582
[planner] P2 does not pick up higher version of already installed plug-in from dropins
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.
Objective function taking into account already installed plugins
patchObjectiveFunctionDJ.txt (text/plain), 3.29 KB, created by
Daniel Le Berre
on 2010-02-13 16:25:24 EST
(
hide
)
Description:
Objective function taking into account already installed plugins
Filename:
MIME Type:
Creator:
Daniel Le Berre
Created:
2010-02-13 16:25:24 EST
Size:
3.29 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.equinox.p2.director >Index: src/org/eclipse/equinox/internal/p2/director/Projector.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/Projector.java,v >retrieving revision 1.47 >diff -u -r1.47 Projector.java >--- src/org/eclipse/equinox/internal/p2/director/Projector.java 11 Feb 2010 15:44:21 -0000 1.47 >+++ src/org/eclipse/equinox/internal/p2/director/Projector.java 13 Feb 2010 21:22:16 -0000 >@@ -63,6 +63,8 @@ > private IInstallableUnit entryPoint; > private Map<IInstallableUnitFragment, Set<IInstallableUnit>> fragments = new HashMap<IInstallableUnitFragment, Set<IInstallableUnit>>(); > >+ private int numberOfInstalledIUs; >+ > static class AbstractVariable { > public String toString() { > return "AbstractVariable: " + hashCode(); //$NON-NLS-1$ >@@ -143,6 +145,7 @@ > > public void encode(IInstallableUnit entryPointIU, IInstallableUnit[] alreadyExistingRoots, IQueryable<IInstallableUnit> installedIUs, Collection<IInstallableUnit> newRoots, IProgressMonitor monitor) { > alreadyInstalledIUs = Arrays.asList(alreadyExistingRoots); >+ numberOfInstalledIUs = 0; > lastState = installedIUs; > this.entryPoint = entryPointIU; > try { >@@ -160,7 +163,6 @@ > solver.setTimeoutOnConflicts(1000); > IQueryResult<IInstallableUnit> queryResult = picker.query(InstallableUnitQuery.ANY, null); > dependencyHelper = new DependencyHelper<Object, Explanation>(solver); >- > Iterator<IInstallableUnit> iusToEncode = queryResult.iterator(); > if (DEBUG) { > List<IInstallableUnit> iusToOrder = new ArrayList<IInstallableUnit>(); >@@ -205,7 +207,7 @@ > List<WeightedObject<? extends Object>> weightedObjects = new ArrayList<WeightedObject<? extends Object>>(); > > Set<Entry<String, Map<Version, IInstallableUnit>>> s = slice.entrySet(); >- final BigInteger POWER = BigInteger.valueOf(2); >+ final BigInteger POWER = BigInteger.valueOf(numberOfInstalledIUs > 0 ? numberOfInstalledIUs + 1 : 2); > > BigInteger maxWeight = POWER; > for (Entry<String, Map<Version, IInstallableUnit>> entry : s) { >@@ -236,13 +238,13 @@ > maxWeight = weight; > } > >- maxWeight = maxWeight.multiply(POWER); >+ maxWeight = maxWeight.multiply(POWER).add(BigInteger.ONE); > > // Weight the no-op variables beneath the abstract variables > for (AbstractVariable var : noopVariables.values()) > weightedObjects.add(WeightedObject.newWO(var, maxWeight)); > >- maxWeight = maxWeight.multiply(POWER); >+ maxWeight = maxWeight.multiply(POWER).add(BigInteger.ONE); > > // Add the abstract variables > BigInteger abstractWeight = maxWeight.negate(); >@@ -250,7 +252,7 @@ > weightedObjects.add(WeightedObject.newWO(var, abstractWeight)); > } > >- maxWeight = maxWeight.multiply(POWER); >+ maxWeight = maxWeight.multiply(POWER).add(BigInteger.ONE); > > BigInteger optionalWeight = maxWeight.negate(); > long countOptional = 1; >@@ -398,7 +400,9 @@ > > public void processIU(IInstallableUnit iu, boolean isRootIU) throws ContradictionException { > iu = iu.unresolved(); >- >+ if (isInstalled(iu)) { >+ numberOfInstalledIUs++; >+ } > Map<Version, IInstallableUnit> iuSlice = slice.get(iu.getId()); > if (iuSlice == null) { > iuSlice = new HashMap<Version, IInstallableUnit>();
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 Raw
Actions:
View
Attachments on
bug 302582
:
158853
|
158873
|
158883
|
158894
|
159062
|
159083
|
159219
|
159259
|
159494
|
159495