Skip to content

Commit

Permalink
fix dependency matching, correcting ordering for concurrent installat…
Browse files Browse the repository at this point in the history
…ions
  • Loading branch information
rivy committed May 30, 2016
1 parent 2321afd commit b168f34
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
9 changes: 9 additions & 0 deletions lib/core.ps1
Expand Up @@ -689,3 +689,12 @@ function app($name, $bucket, $variant) {
if ($null -ne $variant) { $result = "$result@$variant" }
$result
}

function matching_apps($apps, $app) {
$matches = @()
$app_name = app_name( $app )
if ($null -ne $apps) { foreach ($app in $apps) {
if ( app_name($app) -ieq $app_name ) { $matches += $app }
}}
$matches
}
8 changes: 6 additions & 2 deletions lib/depends.ps1
Expand Up @@ -7,9 +7,13 @@ function install_order($apps, $arch) {
$deps = @( deps $app $arch )
# trace "install_order(): deps = [$deps]"
if ($null -ne $deps) { foreach ($dep in $deps) {
if($res -notcontains $dep) { $res += $dep }
$app_variant = @( matching_apps( $apps, $dep ) )[0];
if ($null -ne $app_variant) { $dep = $app_variant }
if (-not matching_apps( $res, $dep )) { $res += $dep }
# if($res -notcontains $dep) { $res += $dep }
}}
if($res -notcontains $app) { $res += $app }
if (-not (matching_apps( $res, $app ))) { $res += $app }
# if($res -notcontains $app) { $res += $app }
}}
$res
# trace "install_order():DONE: res = [$res]"
Expand Down

0 comments on commit b168f34

Please sign in to comment.