From 69991c72bcf5626e903f6752c737a4a460681a15 Mon Sep 17 00:00:00 2001 From: sam boyer Date: Mon, 9 Jul 2018 01:38:02 -0400 Subject: [PATCH] dep: Fix -vendor-only path's invocation ordering --- cmd/dep/ensure.go | 10 +++++----- txn_writer.go | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cmd/dep/ensure.go b/cmd/dep/ensure.go index 1f6f6948d1..5196be9e44 100644 --- a/cmd/dep/ensure.go +++ b/cmd/dep/ensure.go @@ -180,10 +180,6 @@ func (cmd *ensureCommand) Run(ctx *dep.Ctx, args []string) error { params.TraceLogger = ctx.Err } - if cmd.vendorOnly { - return cmd.runVendorOnly(ctx, args, p, sm, params) - } - statchan := make(chan map[string]verify.VendorStatus) var lps []gps.LockedProject if p.Lock != nil { @@ -211,6 +207,10 @@ func (cmd *ensureCommand) Run(ctx *dep.Ctx, args []string) error { statchan <- status }(filepath.Join(p.AbsRoot, "vendor"), lps) + if cmd.vendorOnly { + return cmd.runVendorOnly(ctx, args, p, sm, params, statchan) + } + if fatal, err := checkErrors(params.RootPackageTree.Packages, p.Manifest.IgnoredPackages()); err != nil { if fatal { return err @@ -348,7 +348,7 @@ func (cmd *ensureCommand) runVendorOnly(ctx *dep.Ctx, args []string, p *dep.Proj // Pass the same lock as old and new so that the writer will observe no // difference, and write out only ncessary vendor/ changes. - dw, err := dep.NewDeltaWriter(p.Lock, p.Lock, <-statchan, p.Manifest.PruneOptions, filepath.Join(p.AbsRoot, "vendor"), VendorAlways) + dw, err := dep.NewDeltaWriter(p.Lock, p.Lock, <-statchan, p.Manifest.PruneOptions, filepath.Join(p.AbsRoot, "vendor"), dep.VendorAlways) if err != nil { return err } diff --git a/txn_writer.go b/txn_writer.go index 9dd1bca6a8..4e0994b729 100644 --- a/txn_writer.go +++ b/txn_writer.go @@ -693,7 +693,7 @@ func (dw *DeltaWriter) PrintPreparedActions(output *log.Logger, verbose bool) er lpd := dw.lockDiff.ProjectDeltas[pr] v, id := projs[pr].Version(), projs[pr].Ident() if reason == projectRemoved { - output.Printf("(%d/%d) Would have removed %s", i, tot, id, v, changeExplanation(reason, lpd)) + output.Printf("(%d/%d) Would have removed %s", i, tot, id) } else { output.Printf("(%d/%d) Would hae written %s@%s: %s", i, tot, id, v, changeExplanation(reason, lpd)) }