From 9eed3d8914c7a0fa294110eb0761776a01adf034 Mon Sep 17 00:00:00 2001 From: Richard Kuhnt Date: Mon, 22 Apr 2019 12:44:07 +0200 Subject: [PATCH] refactor(install): rename locate() to Find-Manifest() See https://github.com/lukesampson/scoop/issues/3339#issuecomment-485242390 --- lib/buckets.ps1 | 2 +- lib/depends.ps1 | 2 +- lib/install.ps1 | 7 ++++++- lib/manifest.ps1 | 2 +- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/lib/buckets.ps1 b/lib/buckets.ps1 index b88d747faf..54462e6e79 100644 --- a/lib/buckets.ps1 +++ b/lib/buckets.ps1 @@ -114,7 +114,7 @@ function rm_bucket($name) { } function new_issue_msg($app, $bucket, $title, $body) { - $app, $manifest, $bucket, $url = locate $app $bucket + $app, $manifest, $bucket, $url = Find-Manifest $app $bucket $url = known_bucket_repo $bucket $bucket_path = "$bucketsdir\$bucket" diff --git a/lib/depends.ps1 b/lib/depends.ps1 index f8cd2bdcbd..3105de928f 100644 --- a/lib/depends.ps1 +++ b/lib/depends.ps1 @@ -22,7 +22,7 @@ function deps($app, $arch) { function dep_resolve($app, $arch, $resolved, $unresolved) { $app, $bucket, $null = parse_app $app $unresolved += $app - $null, $manifest, $null, $null = locate $app $bucket + $null, $manifest, $null, $null = Find-Manifest $app $bucket if(!$manifest) { if(((Get-LocalBucket) -notcontains $bucket) -and $bucket) { diff --git a/lib/install.ps1 b/lib/install.ps1 index dbab39b7b4..bae9abb096 100644 --- a/lib/install.ps1 +++ b/lib/install.ps1 @@ -11,7 +11,7 @@ function nightly_version($date, $quiet = $false) { function install_app($app, $architecture, $global, $suggested, $use_cache = $true, $check_hash = $true) { $app, $bucket, $null = parse_app $app - $app, $manifest, $bucket, $url = locate $app $bucket + $app, $manifest, $bucket, $url = Find-Manifest $app $bucket if(!$manifest) { abort "Couldn't find manifest for '$app'$(if($url) { " at the URL $url" })." @@ -73,6 +73,11 @@ function install_app($app, $architecture, $global, $suggested, $use_cache = $tru } function locate($app, $bucket) { + Show-DeprecatedWarning $MyInvocation 'Find-Manifest' + return Find-Manifest $app $bucket +} + +function Find-Manifest($app, $bucket) { $manifest, $url = $null, $null # check if app is a URL or UNC path diff --git a/lib/manifest.ps1 b/lib/manifest.ps1 index 1bd7ef841a..da3b5c9b80 100644 --- a/lib/manifest.ps1 +++ b/lib/manifest.ps1 @@ -77,7 +77,7 @@ function supports_architecture($manifest, $architecture) { } function generate_user_manifest($app, $bucket, $version) { - $null, $manifest, $bucket, $null = locate $app $bucket + $null, $manifest, $bucket, $null = Find-Manifest $app $bucket if ("$($manifest.version)" -eq "$version") { return manifest_path $app $bucket }