diff -Nru govendor-1.0.8+git20170720.29.84cdf58+ds/cliprompt/cliPrompt.go govendor-1.0.9+ds1/cliprompt/cliPrompt.go --- govendor-1.0.8+git20170720.29.84cdf58+ds/cliprompt/cliPrompt.go 2017-07-28 14:44:19.000000000 +0000 +++ govendor-1.0.9+ds1/cliprompt/cliPrompt.go 2017-10-27 18:41:16.000000000 +0000 @@ -42,20 +42,20 @@ func getSingle(term *cp.Terminal, q *prompt.Question) (prompt.Response, error) { if len(q.Options) == 1 && q.Options[0].Other() { opt := &q.Options[0] - opt.Choosen = true + opt.Chosen = true return setOther(term, q, opt) } - choosen := q.AnswerSingle(false) - if choosen == nil { + chosen := q.AnswerSingle(false) + if chosen == nil { return setOption(term, q) } - resp, err := setOther(term, q, choosen) + resp, err := setOther(term, q, chosen) if err != nil { return prompt.RespCancel, err } if resp == prompt.RespCancel { - choosen.Choosen = false + chosen.Chosen = false return setOption(term, q) } return resp, nil @@ -138,14 +138,14 @@ continue } opt := &q.Options[index] - opt.Choosen = true + opt.Chosen = true if opt.Other() { res, err := setOther(term, q, opt) if err != nil { return prompt.RespCancel, err } if res == prompt.RespCancel { - opt.Choosen = false + opt.Chosen = false continue } } diff -Nru govendor-1.0.8+git20170720.29.84cdf58+ds/context/context.go govendor-1.0.9+ds1/context/context.go --- govendor-1.0.8+git20170720.29.84cdf58+ds/context/context.go 2017-07-28 14:44:19.000000000 +0000 +++ govendor-1.0.9+ds1/context/context.go 2017-10-27 18:41:16.000000000 +0000 @@ -56,11 +56,13 @@ // Package is a map where the import path is the key. // Populated with LoadPackage. Package map[string]*Package - // Change to unkown structure (rename). Maybe... + // Change to unknown structure (rename). Maybe... - // MoveRule provides the translation from origional import path to new import path. + // MoveRule provides the translation from original import path to new import path. RewriteRule map[string]string // map[from]to + TreeImport []*pkgspec.Pkg + Operation []*Operation loaded, dirty bool @@ -84,7 +86,7 @@ Gopath string // Includes trailing "src". Files []*File - inVendor bool // Different then Status.Location, this is in *any* vendor tree. + inVendor bool // Different than Status.Location, this is in *any* vendor tree. inTree bool ignoreFile []string diff -Nru govendor-1.0.8+git20170720.29.84cdf58+ds/context/copy.go govendor-1.0.9+ds1/context/copy.go --- govendor-1.0.8+git20170720.29.84cdf58+ds/context/copy.go 2017-07-28 14:44:19.000000000 +0000 +++ govendor-1.0.9+ds1/context/copy.go 2017-10-27 18:41:16.000000000 +0000 @@ -120,7 +120,7 @@ nextSrcPath := filepath.Join(srcPath, name) var nextIgnoreFiles, deps []string if !isTestdata && !strings.Contains(pkgPath, "/testdata/") { - nextIgnoreFiles, deps, err = ctx.getIngoreFiles(nextSrcPath) + nextIgnoreFiles, deps, err = ctx.getIgnoreFiles(nextSrcPath) if err != nil { return err } diff -Nru govendor-1.0.8+git20170720.29.84cdf58+ds/context/fetch.go govendor-1.0.9+ds1/context/fetch.go --- govendor-1.0.8+git20170720.29.84cdf58+ds/context/fetch.go 2017-07-28 14:44:19.000000000 +0000 +++ govendor-1.0.9+ds1/context/fetch.go 2017-10-27 18:41:16.000000000 +0000 @@ -7,6 +7,7 @@ import ( "fmt" "os" + "path" "path/filepath" "strings" "time" @@ -162,7 +163,7 @@ // /tmp/cache/1/[[github.com/kardianos/govendor]]context op.Src = pkgDir var deps []string - op.IgnoreFile, deps, err = f.Ctx.getIngoreFiles(op.Src) + op.IgnoreFile, deps, err = f.Ctx.getIgnoreFiles(op.Src) if err != nil { if os.IsNotExist(err) { return nextOps, nil @@ -229,11 +230,17 @@ version := "" hasVersion := false revision := "" + hasOrigin := false + origin := "" for _, vv := range f.Ctx.VendorFile.Package { if vv.Remove { continue } if strings.HasPrefix(dep, vv.Path+"/") { + if len(vv.Origin) > 0 { + origin = path.Join(vv.PathOrigin(), strings.TrimPrefix(dep, vv.Path)) + hasOrigin = true + } if len(vv.Version) > 0 { version = vv.Version hasVersion = true @@ -246,6 +253,23 @@ } } + // Look for tree match in explicit imports + for _, item := range f.Ctx.TreeImport { + if item.Path != dep && !strings.HasPrefix(dep, item.Path+"/") { + continue + } + if len(item.Origin) > 0 { + origin = path.Join(item.PathOrigin(), strings.TrimPrefix(dep, item.Path)) + hasOrigin = true + } + if len(item.Version) > 0 { + version = item.Version + hasVersion = true + revision = "" + } + break + } + f.HavePkg[dep] = true dest := filepath.Join(f.Ctx.RootDir, f.Ctx.VendorFolder, dep) @@ -257,16 +281,26 @@ Path: dep, Revision: revision, Version: version, + Origin: origin, } f.Ctx.VendorFile.Package = append(f.Ctx.VendorFile.Package, vp) } if hasVersion { vp.Version = version } + if hasOrigin { + vp.Origin = origin + } if len(vp.Revision) == 0 { vp.Revision = revision } - spec := &pkgspec.Pkg{Path: dep, Version: version, HasVersion: hasVersion} + spec := &pkgspec.Pkg{ + Path: dep, + Version: version, + HasVersion: hasVersion, + Origin: origin, + HasOrigin: hasOrigin, + } nextOps = append(nextOps, &Operation{ Type: OpFetch, Pkg: &Package{Pkg: spec}, diff -Nru govendor-1.0.8+git20170720.29.84cdf58+ds/context/get.go govendor-1.0.9+ds1/context/get.go --- govendor-1.0.8+git20170720.29.84cdf58+ds/context/get.go 2017-07-28 14:44:19.000000000 +0000 +++ govendor-1.0.9+ds1/context/get.go 2017-10-27 18:41:16.000000000 +0000 @@ -6,6 +6,7 @@ import ( "fmt" + "go/build" "io" "os" "path/filepath" @@ -16,11 +17,7 @@ func Get(logger io.Writer, pkgspecName string, insecure bool) (*pkgspec.Pkg, error) { // Get the GOPATHs. - all := os.Getenv("GOPATH") - if len(all) == 0 { - return nil, ErrMissingGOPATH - } - gopathList := filepath.SplitList(all) + gopathList := filepath.SplitList(build.Default.GOPATH) gopath := gopathList[0] cwd, err := os.Getwd() diff -Nru govendor-1.0.8+git20170720.29.84cdf58+ds/context/label.go govendor-1.0.9+ds1/context/label.go --- govendor-1.0.8+git20170720.29.84cdf58+ds/context/label.go 2017-07-28 14:44:19.000000000 +0000 +++ govendor-1.0.9+ds1/context/label.go 2017-10-27 18:41:16.000000000 +0000 @@ -184,7 +184,7 @@ return true } } - // We ran out of things to check. Assume one is not "less" then the other. + // We ran out of things to check. Assume one is not "less" than the other. df("PT D\n") return false } diff -Nru govendor-1.0.8+git20170720.29.84cdf58+ds/context/modify.go govendor-1.0.9+ds1/context/modify.go --- govendor-1.0.8+git20170720.29.84cdf58+ds/context/modify.go 2017-07-28 14:44:19.000000000 +0000 +++ govendor-1.0.9+ds1/context/modify.go 2017-10-27 18:41:16.000000000 +0000 @@ -204,12 +204,15 @@ item.Pkg.HasVersion = true item.Pkg.Version = imp.Version } + item.Pkg.HasOrigin = imp.HasOrigin item.Pkg.Origin = path.Join(imp.PathOrigin(), strings.TrimPrefix(item.Pkg.Path, imp.Path)) err = ctx.modify(item.Pkg, mod, mops) if err != nil { return err } } + // cache for later use + ctx.TreeImport = append(ctx.TreeImport, imp) return nil } @@ -324,7 +327,7 @@ } } -func (ctx *Context) getIngoreFiles(src string) (ignoreFile, imports []string, err error) { +func (ctx *Context) getIgnoreFiles(src string) (ignoreFile, imports []string, err error) { srcDir, err := os.Open(src) if err != nil { return nil, nil, err @@ -376,7 +379,7 @@ ignoreFile = cpkg.ignoreFile } else { var err error - ignoreFile, _, err = ctx.getIngoreFiles(src) + ignoreFile, _, err = ctx.getIgnoreFiles(src) if err != nil { return err } @@ -535,7 +538,7 @@ return nil } -// Check returns any conflicts when more then one package can be moved into +// Check returns any conflicts when more than one package can be moved into // the same path. func (ctx *Context) Check() []*Conflict { // Find duplicate packages that have been marked for moving. diff -Nru govendor-1.0.8+git20170720.29.84cdf58+ds/context/resolve.go govendor-1.0.9+ds1/context/resolve.go --- govendor-1.0.8+git20170720.29.84cdf58+ds/context/resolve.go 2017-07-28 14:44:19.000000000 +0000 +++ govendor-1.0.9+ds1/context/resolve.go 2017-10-27 18:41:16.000000000 +0000 @@ -154,7 +154,7 @@ if strings.HasSuffix(pathname, ".go") == false { return nil, nil } - // No need to add the same file more then once. + // No need to add the same file more than once. for _, pkg := range ctx.Package { if pathos.FileStringEquals(pkg.Dir, dir) == false { continue diff -Nru govendor-1.0.8+git20170720.29.84cdf58+ds/context/status.go govendor-1.0.9+ds1/context/status.go --- govendor-1.0.8+git20170720.29.84cdf58+ds/context/status.go 2017-07-28 14:44:19.000000000 +0000 +++ govendor-1.0.9+ds1/context/status.go 2017-10-27 18:41:16.000000000 +0000 @@ -55,7 +55,7 @@ } switch s.Location { default: - panic("Unkown Location type") + panic("Unknown Location type") case LocationUnknown: l = '_' case LocationNotFound: diff -Nru govendor-1.0.8+git20170720.29.84cdf58+ds/context/sync.go govendor-1.0.9+ds1/context/sync.go --- govendor-1.0.8+git20170720.29.84cdf58+ds/context/sync.go 2017-07-28 14:44:19.000000000 +0000 +++ govendor-1.0.9+ds1/context/sync.go 2017-10-27 18:41:16.000000000 +0000 @@ -379,7 +379,7 @@ src := pkgDir // Scan go files for files that should be ignored based on tags and filenames. - ignoreFiles, _, err := ctx.getIngoreFiles(src) + ignoreFiles, _, err := ctx.getIgnoreFiles(src) if err != nil { rem = append(rem, remoteFailure{Msg: "failed to get ignore files", Path: vp.Path, Err: err}) continue diff -Nru govendor-1.0.8+git20170720.29.84cdf58+ds/context/tags.go govendor-1.0.9+ds1/context/tags.go --- govendor-1.0.8+git20170720.29.84cdf58+ds/context/tags.go 2017-07-28 14:44:19.000000000 +0000 +++ govendor-1.0.9+ds1/context/tags.go 2017-10-27 18:41:16.000000000 +0000 @@ -11,8 +11,8 @@ // Build tags come in the format "tagA tagB,tagC" -> "taga OR (tagB AND tagC)" // File tags compose with this as "ftag1 AND ftag2 AND ()". -// However in govendor all questions are reversed. Rather then asking -// "What should be built?" we ask "What should be ingored?". +// However in govendor all questions are reversed. Rather than asking +// "What should be built?" we ask "What should be ignored?". type logical struct { and bool @@ -31,7 +31,7 @@ if lt.not || lt2.not { return false } - if lt.tag == lt2.tag{ + if lt.tag == lt2.tag { return true } @@ -72,7 +72,7 @@ } func (l logical) ignored(ignoreTags []logicalTag) bool { - // A logical is ingored if ANY AND conditions match or ALL OR conditions match. + // A logical is ignored if ANY AND conditions match or ALL OR conditions match. if len(ignoreTags) == 0 { return false } diff -Nru govendor-1.0.8+git20170720.29.84cdf58+ds/debian/changelog govendor-1.0.9+ds1/debian/changelog --- govendor-1.0.8+git20170720.29.84cdf58+ds/debian/changelog 2017-07-28 15:01:32.000000000 +0000 +++ govendor-1.0.9+ds1/debian/changelog 2018-04-30 15:59:14.000000000 +0000 @@ -1,3 +1,17 @@ +govendor (1.0.9+ds1-1) unstable; urgency=medium + + [ Alexandre Viau ] + * Point Vcs-* urls to salsa.debian.org. + + [ Anthony Fok ] + * New upstream release 1.0.9 + * Apply "cme fix dpkg" fixes to debian/control, + bumping Standards-Version to 4.1.4 (no change) + * Use debhelper (>= 11) + * Exclude talk_2015-09-08.slide from being compressed + + -- Anthony Fok Mon, 30 Apr 2018 09:59:14 -0600 + govendor (1.0.8+git20170720.29.84cdf58+ds-1) unstable; urgency=medium * New upstream snapshot diff -Nru govendor-1.0.8+git20170720.29.84cdf58+ds/debian/compat govendor-1.0.9+ds1/debian/compat --- govendor-1.0.8+git20170720.29.84cdf58+ds/debian/compat 2017-07-28 14:43:03.000000000 +0000 +++ govendor-1.0.9+ds1/debian/compat 2018-04-30 15:21:00.000000000 +0000 @@ -1 +1 @@ -10 +11 diff -Nru govendor-1.0.8+git20170720.29.84cdf58+ds/debian/control govendor-1.0.9+ds1/debian/control --- govendor-1.0.8+git20170720.29.84cdf58+ds/debian/control 2017-07-28 15:01:09.000000000 +0000 +++ govendor-1.0.9+ds1/debian/control 2018-04-30 15:21:00.000000000 +0000 @@ -1,9 +1,10 @@ Source: govendor -Section: devel -Priority: optional Maintainer: Debian Go Packaging Team Uploaders: Anthony Fok -Build-Depends: debhelper (>= 10), +Section: devel +Testsuite: autopkgtest-pkg-go +Priority: optional +Build-Depends: debhelper (>= 11), dh-golang, golang-any, golang-github-bowery-prompt-dev, @@ -13,18 +14,17 @@ golang-golang-x-crypto-dev, golang-golang-x-tools-dev, golang-gopkg-yaml.v2-dev -Standards-Version: 4.0.0 +Standards-Version: 4.1.4 +Vcs-Browser: https://salsa.debian.org/go-team/packages/govendor +Vcs-Git: https://salsa.debian.org/go-team/packages/govendor.git Homepage: https://github.com/kardianos/govendor -Vcs-Browser: https://anonscm.debian.org/cgit/pkg-go/packages/govendor.git -Vcs-Git: https://anonscm.debian.org/git/pkg-go/packages/govendor.git XS-Go-Import-Path: github.com/kardianos/govendor -Testsuite: autopkgtest-pkg-go Package: govendor Architecture: any -Built-Using: ${misc:Built-Using} Depends: ${shlibs:Depends}, ${misc:Depends} +Built-Using: ${misc:Built-Using} Description: Go vendor tool that works with the standard vendor file govendor is a vendoring tool that fetches, annotates, and synchronizes dependencies for the Go programming language. It can be useful as a diff -Nru govendor-1.0.8+git20170720.29.84cdf58+ds/debian/gitlab-ci.yml govendor-1.0.9+ds1/debian/gitlab-ci.yml --- govendor-1.0.8+git20170720.29.84cdf58+ds/debian/gitlab-ci.yml 1970-01-01 00:00:00.000000000 +0000 +++ govendor-1.0.9+ds1/debian/gitlab-ci.yml 2018-04-30 15:11:26.000000000 +0000 @@ -0,0 +1,28 @@ + +# auto-generated, DO NOT MODIFY. +# The authoritative copy of this file lives at: +# https://salsa.debian.org/go-team/ci/blob/master/cmd/ci/gitlabciyml.go + +# TODO: publish under debian-go-team/ci +image: stapelberg/ci2 + +test_the_archive: + artifacts: + paths: + - before-applying-commit.json + - after-applying-commit.json + script: + # Create an overlay to discard writes to /srv/gopath/src after the build: + - "rm -rf /cache/overlay/{upper,work}" + - "mkdir -p /cache/overlay/{upper,work}" + - "mount -t overlay overlay -o lowerdir=/srv/gopath/src,upperdir=/cache/overlay/upper,workdir=/cache/overlay/work /srv/gopath/src" + - "export GOPATH=/srv/gopath" + - "export GOCACHE=/cache/go" + # Build the world as-is: + - "ci-build -exemptions=/var/lib/ci-build/exemptions.json > before-applying-commit.json" + # Copy this package into the overlay: + - "GBP_CONF_FILES=:debian/gbp.conf gbp buildpackage --git-no-pristine-tar --git-ignore-branch --git-ignore-new --git-export-dir=/tmp/export --git-no-overlay --git-tarball-dir=/nonexistant --git-cleaner=/bin/true --git-builder='dpkg-buildpackage -S -d --no-sign'" + - "pgt-gopath -dsc /tmp/export/*.dsc" + # Rebuild the world: + - "ci-build -exemptions=/var/lib/ci-build/exemptions.json > after-applying-commit.json" + - "ci-diff before-applying-commit.json after-applying-commit.json" diff -Nru govendor-1.0.8+git20170720.29.84cdf58+ds/debian/rules govendor-1.0.9+ds1/debian/rules --- govendor-1.0.8+git20170720.29.84cdf58+ds/debian/rules 2016-10-16 09:53:49.000000000 +0000 +++ govendor-1.0.9+ds1/debian/rules 2018-04-30 15:59:14.000000000 +0000 @@ -1,9 +1,9 @@ #!/usr/bin/make -f - -export DH_VERBOSE=1 - %: - dh $@ -v --buildsystem=golang --with=golang + dh $@ --buildsystem=golang --with=golang + +override_dh_compress: + dh_compress -X.slide override_dh_auto_install: dh_auto_install -O--buildsystem=golang diff -Nru govendor-1.0.8+git20170720.29.84cdf58+ds/doc/design.md govendor-1.0.9+ds1/doc/design.md --- govendor-1.0.8+git20170720.29.84cdf58+ds/doc/design.md 2017-07-28 14:44:19.000000000 +0000 +++ govendor-1.0.9+ds1/doc/design.md 2017-10-27 18:41:16.000000000 +0000 @@ -61,7 +61,7 @@ After matching acceptable labels, they must be sorted and a single label returned. Of the following: "v1.4, v1.8, v1.12, v1.12-beta --> v1.12 would -be choosen. +be chosen. There is no precedence between branches and tags, they are both searched for labels and sorted all together to find the correct match. In case of two diff -Nru govendor-1.0.8+git20170720.29.84cdf58+ds/doc/implementation.md govendor-1.0.9+ds1/doc/implementation.md --- govendor-1.0.8+git20170720.29.84cdf58+ds/doc/implementation.md 2017-07-28 14:44:19.000000000 +0000 +++ govendor-1.0.9+ds1/doc/implementation.md 2017-10-27 18:41:16.000000000 +0000 @@ -24,7 +24,7 @@ Do not integrate yet. - [x] Add a function to decide if a version is a label or revision. A revision will either be a valid base64 string or a number without - any letters and greater then 100. A version will be anything else. + any letters and greater than 100. A version will be anything else. A revision might be a short hash or long hash. - [x] Move existing commands to use the pkg-spec parser. - [x] Add common code to verify package's checksum, report package or folder trees that are not valid. @@ -42,7 +42,7 @@ on standard git command, but also might look into "github.com/src-d/go-git" for inspecting versions remotely. - [x] Change fetch and sync to download into ORIGIN, not PATH. - - [x] Record choosen version in vendor file. + - [x] Record chosen version in vendor file. - [x] When fetching dependencies, if it is a new package, see if there exists another package in the same repo and use that revision and version. - [x] Add version info to list output. diff -Nru govendor-1.0.8+git20170720.29.84cdf58+ds/help/version.go govendor-1.0.9+ds1/help/version.go --- govendor-1.0.8+git20170720.29.84cdf58+ds/help/version.go 2017-07-28 14:44:19.000000000 +0000 +++ govendor-1.0.9+ds1/help/version.go 2017-10-27 18:41:16.000000000 +0000 @@ -4,4 +4,4 @@ package help -var version = "v1.0.8" +var version = "v1.0.9" diff -Nru govendor-1.0.8+git20170720.29.84cdf58+ds/prompt/prompt.go govendor-1.0.9+ds1/prompt/prompt.go --- govendor-1.0.8+git20170720.29.84cdf58+ds/prompt/prompt.go 2017-07-28 14:44:19.000000000 +0000 +++ govendor-1.0.9+ds1/prompt/prompt.go 2017-10-27 18:41:16.000000000 +0000 @@ -15,8 +15,8 @@ validation string other bool - Choosen bool // Set to true if choosen. - Value string // Value used if choosen and option is "other". + Chosen bool // Set to true if chosen. + Value string // Value used if chosen and option is "other". } type OptionType byte @@ -64,8 +64,8 @@ validation: validation, - Choosen: opt.Choosen, - Value: opt.Value, + Chosen: opt.Chosen, + Value: opt.Value, } } @@ -80,12 +80,12 @@ ans := []*Option{} for i := range q.Options { o := &q.Options[i] - if o.Choosen { + if o.Chosen { ans = append(ans, o) } } if must && len(ans) == 0 { - panic("If no option is choosen, response must be cancelled") + panic("If no option is chosen, response must be cancelled") } return ans } @@ -98,16 +98,16 @@ found := false for i := range q.Options { o := &q.Options[i] - if found && o.Choosen { + if found && o.Chosen { panic("Must only respond with single option") } - if o.Choosen { + if o.Chosen { found = true ans = o } } if must && !found { - panic("If no option is choosen, response must be cancelled") + panic("If no option is chosen, response must be cancelled") } return ans } diff -Nru govendor-1.0.8+git20170720.29.84cdf58+ds/run/modify.go govendor-1.0.9+ds1/run/modify.go --- govendor-1.0.8+git20170720.29.84cdf58+ds/run/modify.go 2017-07-28 14:44:19.000000000 +0000 +++ govendor-1.0.9+ds1/run/modify.go 2017-10-27 18:41:16.000000000 +0000 @@ -40,7 +40,7 @@ prompt.NewOption("", "What?", true), }, } - q.Options[2].Choosen = true + q.Options[2].Chosen = true q.Options[2] = prompt.ValidateOption(q.Options[2], "Choose again!") resp, err := ask.Ask(q) if err != nil { @@ -50,9 +50,9 @@ fmt.Printf("Cancelled\n") return help.MsgNone, nil } - choosen := q.AnswerSingle(true) + chosen := q.AnswerSingle(true) - fmt.Printf("Choosen: %s\n", choosen.String()) + fmt.Printf("Chosen: %s\n", chosen.String()) */ listFlags := flag.NewFlagSet("mod", flag.ContinueOnError) diff -Nru govendor-1.0.8+git20170720.29.84cdf58+ds/run/run_test.go govendor-1.0.9+ds1/run/run_test.go --- govendor-1.0.8+git20170720.29.84cdf58+ds/run/run_test.go 2017-07-28 14:44:19.000000000 +0000 +++ govendor-1.0.9+ds1/run/run_test.go 2017-10-27 18:41:16.000000000 +0000 @@ -34,7 +34,7 @@ } } if opt != nil { - opt.Choosen = true + opt.Chosen = true } return prompt.RespAnswer, nil } diff -Nru govendor-1.0.8+git20170720.29.84cdf58+ds/.travis.yml govendor-1.0.9+ds1/.travis.yml --- govendor-1.0.8+git20170720.29.84cdf58+ds/.travis.yml 2017-07-28 14:44:19.000000000 +0000 +++ govendor-1.0.9+ds1/.travis.yml 2017-10-27 18:41:16.000000000 +0000 @@ -1,5 +1,7 @@ language: go -go: 1.7 +go: + - 1.8.x + - 1.9.x install: before_deploy: - GOOS=linux GOARCH=amd64 go build -o govendor_linux_amd64