Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(187)

Unified Diff: cipd/client/cmd/cipd/friendly.go

Issue 2654123005: [cipd] update internal function signatures in preparation for subdir. (Closed)
Patch Set: root->subdir Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cipd/client/cipd/local/json_descs.go ('k') | cipd/client/cmd/cipd/main.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cipd/client/cmd/cipd/friendly.go
diff --git a/cipd/client/cmd/cipd/friendly.go b/cipd/client/cmd/cipd/friendly.go
index 670ba639ace296a662a7300a0e8323c64877964b..fb7c8a944910bc3523f0bd63ef863bbf9995e910 100644
--- a/cipd/client/cmd/cipd/friendly.go
+++ b/cipd/client/cmd/cipd/friendly.go
@@ -237,10 +237,14 @@ func (site *installationSite) installedPackages(ctx context.Context, pkgs []stri
// List all?
if len(pkgs) == 0 {
- pins, err := d.FindDeployed(ctx)
+ allPins, err := d.FindDeployed(ctx)
if err != nil {
return nil, err
}
+ if err := allPins.AssertOnlyDefaultSubdir(); err != nil {
+ return nil, err
+ }
+ pins := allPins[""]
output := make([]pinInfo, len(pins))
for i, pin := range pins {
cpy := pin
@@ -256,7 +260,7 @@ func (site *installationSite) installedPackages(ctx context.Context, pkgs []stri
// List specific packages only.
output := make([]pinInfo, len(pkgs))
for i, pkgName := range pkgs {
- pin, err := d.CheckDeployed(ctx, pkgName)
+ pin, err := d.CheckDeployed(ctx, "", pkgName)
if err == nil {
output[i] = pinInfo{
Pkg: pkgName,
@@ -299,7 +303,7 @@ func (site *installationSite) installPackage(ctx context.Context, pkgName, versi
doInstall := true
if !force {
d := local.NewDeployer(site.siteRoot)
- existing, err := d.CheckDeployed(ctx, pkgName)
+ existing, err := d.CheckDeployed(ctx, "", pkgName)
if err == nil && existing == resolved {
fmt.Printf("Package %s is up-to-date.\n", pkgName)
doInstall = false
@@ -309,7 +313,7 @@ func (site *installationSite) installPackage(ctx context.Context, pkgName, versi
// Go for it.
if doInstall {
fmt.Printf("Installing %s (version %q)...\n", pkgName, version)
- if err := site.client.FetchAndDeployInstance(ctx, resolved); err != nil {
+ if err := site.client.FetchAndDeployInstance(ctx, "", resolved); err != nil {
return nil, err
}
}
« no previous file with comments | « cipd/client/cipd/local/json_descs.go ('k') | cipd/client/cmd/cipd/main.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698