Skip to content

Commit

Permalink
scoop status: report missing runtime dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
lukesampson committed Dec 31, 2013
1 parent 7909e69 commit 79b04bb
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion libexec/scoop-status.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
. "$psscriptroot\..\lib\manifest.ps1"
. "$psscriptroot\..\lib\buckets.ps1"
. "$psscriptroot\..\lib\versions.ps1"
. "$psscriptroot\..\lib\depends.ps1"

function timeago($when) {
$diff = [datetime]::now - $last_update
Expand All @@ -25,6 +26,7 @@ if(test-path $timestamp) {
$failed = @()
$old = @()
$removed = @()
$missing_deps = @()

$true, $false | % { # local and global apps
$global = $_
Expand All @@ -48,6 +50,11 @@ $true, $false | % { # local and global apps
if((compare_versions $manifest.version $version) -gt 0) {
$old += @{ $app = @($version, $manifest.version) }
}

$deps = @(runtime_deps $manifest) | ? { !(installed $_) }
if($deps) {
$missing_deps += ,(@($app) + @($deps))
}
}
}

Expand Down Expand Up @@ -75,7 +82,15 @@ if($failed) {
}
}

if(!$old -and !$removed -and !$failed) {
if($missing_deps) {
"missing runtime dependencies:"
$missing_deps | % {
$app, $deps = $_
" $app requires $([string]::join(',', $deps))"
}
}

if(!$old -and !$removed -and !$failed -and !$missing_deps) {
success "everything is ok!"
}

Expand Down

0 comments on commit 79b04bb

Please sign in to comment.