some more work on dependency sorting...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2014-12-08 15:01:10 +03:00
parent 7883315598
commit 05450f261d

View File

@ -210,7 +210,11 @@ module.FeatureSet = {
// 2) remove the duplicate features except fot the first
// occurance
//
// NOTE: we do not do recursice dependency expansion.
// NOTE: recursice dependency expansion is not needed here as if
// a dependency is not included in the list then it is not
// needed...
// their dependencies to be sorted, and if that does not work
// we can give up...
// NOTE: stage 2 is done later when filtering the list...
// NOTE: if dependency errors/conflicts exist this will break at
// the next step.
@ -220,10 +224,8 @@ module.FeatureSet = {
// - dependency / priority conflict
// X will have higher priority than one of its
// dependencies...
//
// XXX do we add dependencies that are not included in the list???
var _sortDep = function(lst, missing){
var res = []
var missing = {}
lst.forEach(function(n){
var e = that[n]
// no dependencies...
@ -251,7 +253,14 @@ module.FeatureSet = {
}
})
lst = res
return res
}
var missing = {}
// sort twice to cover the dependencies of dependencies...
// ...if this does not work we give up ;)
lst = _sortDep(lst, missing)
lst = _sortDep(lst, missing)
// sort features via priority keeping the order as close to
// manual as possible...