New upstream release.
Debian Janitor
2 years ago
0 | 0 | language: go |
1 | 1 | |
2 | 2 | go: |
3 | - 1.5.x | |
4 | - 1.6.x | |
5 | 3 | - 1.7.x |
6 | 4 | - 1.8.x |
7 | 5 | - 1.9.x |
6 | - 1.10.x | |
7 | - 1.11.x | |
8 | - 1.12.x | |
8 | 9 | - tip |
9 | 10 | |
10 | 11 | # Setting sudo access to false will let Travis CI use containers rather than |
17 | 18 | # in the vendor directory. We don't need to test all dependent packages. |
18 | 19 | # Only testing this project. |
19 | 20 | script: |
20 | - GO15VENDOREXPERIMENT=1 make test integration-test verify-version | |
21 | - make test integration-test verify-version | |
21 | 22 | |
22 | 23 | notifications: |
23 | 24 | webhooks: |
0 | # Release 0.13.3 (2019-07-12) | |
1 | ||
2 | ## Fixed | |
3 | ||
4 | - #1056: Fixed issue where Glide is not detecting crypto/ed25519, now in the stdlib (thanks @martinkunc) | |
5 | - #1033: Fixed segfault with Glide 0.13.2 when stripping Godep workspace (thanks @databus23) | |
6 | ||
7 | # Release 0.13.2 (2018-09-26) | |
8 | ||
9 | ## Fixed | |
10 | ||
11 | - #956: Fixed Error handling nested vendor folders (thanks @apynes2) | |
12 | - #953: Fixed issue where error was not propagating | |
13 | ||
0 | 14 | # Release 0.13.1 (2017-11-07) |
1 | 15 | |
2 | 16 | ## Fixed |
13 | 13 | |
14 | 14 | [![Build Status](https://travis-ci.org/Masterminds/glide.svg)](https://travis-ci.org/Masterminds/glide) |
15 | 15 | [![Build status](https://ci.appveyor.com/api/projects/status/3pl4ytgdlfj852li?svg=true&passingText=windows%20build%20passing&failingText=windows%20build%20failing)](https://ci.appveyor.com/project/mattfarina/glide-a8xtg) |
16 | [![Go Report Card](https://goreportcard.com/badge/github.com/Masterminds/glide)](https://goreportcard.com/report/github.com/Masterminds/glide) [![GoDoc](https://godoc.org/github.com/Masterminds/glide?status.svg)](https://godoc.org/github.com/Masterminds/glide) [![Documentation Status](https://readthedocs.org/projects/glide/badge/?version=stable)](http://glide.readthedocs.org/en/stable/?badge=stable) [![Documentation Status](https://readthedocs.org/projects/glide/badge/?version=latest)](http://glide.readthedocs.org/en/latest/?badge=latest) [![Join the chat at https://gitter.im/Masterminds/glide](https://badges.gitter.im/Masterminds/glide.svg)](https://gitter.im/Masterminds/glide?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) | |
17 | ||
18 | ### Golang Dep | |
19 | ||
20 | The Go community now has the [dep](https://github.com/golang/dep) project to | |
21 | manage dependencies. Please consider trying to migrate from Glide to dep. If there | |
22 | is an issue preventing you from migrating please file an issue with dep so the | |
23 | problem can be corrected. Glide will continue to be supported for some time but | |
24 | is considered to be in a state of support rather than active feature development. | |
16 | [![Go Report Card](https://goreportcard.com/badge/github.com/Masterminds/glide)](https://goreportcard.com/report/github.com/Masterminds/glide) [![GoDoc](https://godoc.org/github.com/Masterminds/glide?status.svg)](https://godoc.org/github.com/Masterminds/glide) [![Documentation Status](https://readthedocs.org/projects/glide/badge/?version=stable)](http://glide.readthedocs.org/en/stable/?badge=stable) [![Documentation Status](https://readthedocs.org/projects/glide/badge/?version=latest)](http://glide.readthedocs.org/en/latest/?badge=latest) | |
17 | ||
18 | ### Go Modules | |
19 | ||
20 | The Go community is now using Go Modules to handle dependencies. Please consider | |
21 | using that instead of Glide. Glide is now mostly unmaintained. | |
25 | 22 | |
26 | 23 | ### Features |
27 | 24 |
0 | golang-glide (0.13.3-1) UNRELEASED; urgency=low | |
1 | ||
2 | * New upstream release. | |
3 | ||
4 | -- Debian Janitor <janitor@jelmer.uk> Thu, 19 Aug 2021 02:47:01 -0000 | |
5 | ||
0 | 6 | golang-glide (0.13.1-3) unstable; urgency=medium |
1 | 7 | |
2 | 8 | * Team upload. |
4 | 4 | "errors" |
5 | 5 | "runtime" |
6 | 6 | "sort" |
7 | ||
7 | 8 | //"go/build" |
8 | 9 | "os" |
9 | 10 | "path/filepath" |
974 | 975 | // Some packages, such as github.com/RoaringBitmap/roaring are importing |
975 | 976 | // it with build flags in files for go1.9. |
976 | 977 | "math/bits": struct{}{}, |
978 | ||
979 | // crypto/ed25519 is a package being added to the Go 1.13 standard library. | |
980 | // It is importing itself with build flags in files for go1.13. | |
981 | "crypto/ed25519": struct{}{}, | |
977 | 982 | } |
978 | 983 | |
979 | 984 | // FindPkg takes a package name and attempts to find it on the filesystem |
33 | 33 | "os" |
34 | 34 | ) |
35 | 35 | |
36 | var version = "0.13.0-dev" | |
36 | var version = "0.13.2-dev" | |
37 | 37 | |
38 | 38 | const usage = `Vendor Package Management for your Go projects. |
39 | 39 |
0 | hash: 1f13d16b2759f4c698bf1fa66a55ef06a42ba86859153c478f903e60502a1273 | |
1 | updated: 2017-10-04T10:27:41.570512797-04:00 | |
0 | hash: b9e4643253d2170374b095ae0f19f71c3ef5c0549ba32a7148a6797e99a95144 | |
1 | updated: 2019-07-09T18:35:06.713855-04:00 | |
2 | 2 | imports: |
3 | 3 | - name: github.com/codegangsta/cli |
4 | 4 | version: cfb38830724cc34fedffe9a2a29fb54fa9169cd1 |
5 | 5 | - name: github.com/Masterminds/semver |
6 | version: 15d8430ab86497c5c0da827b748823945e1cf1e1 | |
6 | version: c7af12943936e8c39859482e61f0574c2fd7fc75 | |
7 | 7 | - name: github.com/Masterminds/vcs |
8 | version: 6f1c6d150500e452704e9863f68c2559f58616bf | |
8 | version: f94282d8632a0620f79f0c6ff0e82604e8c5c85b | |
9 | 9 | - name: github.com/mitchellh/go-homedir |
10 | 10 | version: b8bc1bf767474819792c23f32d8286a45736f1c6 |
11 | 11 | - name: gopkg.in/yaml.v2 |
12 | version: a3f3340b5840cee44f372bddb5880fcbc419b46a | |
12 | version: 670d4cfef0544295bc27a114dbac37980d83185a | |
13 | 13 | testImports: [] |
10 | 10 | import: |
11 | 11 | - package: gopkg.in/yaml.v2 |
12 | 12 | - package: github.com/Masterminds/vcs |
13 | version: ^1.12.0 | |
13 | version: ^1.13.1 | |
14 | 14 | - package: github.com/codegangsta/cli |
15 | 15 | version: ^1.16.0 |
16 | 16 | - package: github.com/Masterminds/semver |
69 | 69 | godepMark[pp] = true |
70 | 70 | |
71 | 71 | msg.Info("Removing: %s", path) |
72 | return os.RemoveAll(path) | |
72 | if err := os.RemoveAll(path); err != nil { | |
73 | return err | |
74 | } | |
75 | return filepath.SkipDir | |
73 | 76 | } |
74 | 77 | |
75 | 78 | msg.Debug("%s is not a directory. Skipping removal", path) |
6 | 6 | "github.com/Masterminds/glide/godep/strip" |
7 | 7 | "github.com/Masterminds/glide/msg" |
8 | 8 | ) |
9 | ||
10 | func getWalkFunction(searchPath string, removeAll func(p string) error) func(path string, | |
11 | info os.FileInfo, err error) error { | |
12 | return func(path string, info os.FileInfo, err error) error { | |
13 | if err != nil { | |
14 | return err | |
15 | } | |
16 | ||
17 | // Skip the base vendor directory | |
18 | if path == searchPath { | |
19 | return nil | |
20 | } | |
21 | ||
22 | if info.Name() == "vendor" && info.IsDir() { | |
23 | msg.Info("Removing: %s", path) | |
24 | err = removeAll(path) | |
25 | if nil != err { | |
26 | return err | |
27 | } | |
28 | return filepath.SkipDir | |
29 | } | |
30 | return nil | |
31 | } | |
32 | } | |
9 | 33 | |
10 | 34 | // StripVendor removes nested vendor and Godeps/_workspace/ directories. |
11 | 35 | func StripVendor() error { |
18 | 42 | return err |
19 | 43 | } |
20 | 44 | |
21 | err := filepath.Walk(searchPath, func(path string, info os.FileInfo, err error) error { | |
22 | // Skip the base vendor directory | |
23 | if path == searchPath { | |
24 | return nil | |
25 | } | |
45 | err := filepath.Walk(searchPath, getWalkFunction(searchPath, CustomRemoveAll)) | |
26 | 46 | |
27 | name := info.Name() | |
28 | if name == "vendor" { | |
29 | if _, err := os.Stat(path); err == nil { | |
30 | if info.IsDir() { | |
31 | msg.Info("Removing: %s", path) | |
32 | return CustomRemoveAll(path) | |
33 | } | |
34 | ||
35 | msg.Debug("%s is not a directory. Skipping removal", path) | |
36 | return nil | |
37 | } | |
38 | } | |
39 | return nil | |
40 | }) | |
41 | 47 | if err != nil { |
42 | 48 | return err |
43 | 49 | } |
0 | package path | |
1 | ||
2 | import ( | |
3 | "io/ioutil" | |
4 | "os" | |
5 | "path" | |
6 | "testing" | |
7 | ) | |
8 | ||
9 | func generateTestDirectory(t *testing.T) string { | |
10 | baseDir, err := ioutil.TempDir(os.TempDir(), "mgt") | |
11 | if nil != err { | |
12 | t.Error("Unable to create temp directory: ", err.Error()) | |
13 | } | |
14 | paths := map[string][]string{ | |
15 | "github.com/fake/log": {"log.go"}, | |
16 | "github.com/phoney/foo": {"bar.go"}, | |
17 | "github.com/phoney/foo/vendor": {"test.go", "foo.bar"}, | |
18 | "github.com/aws/aws-sdk-go/awsmigrate/awsmigrate-renamer/vendor": {}, | |
19 | "github.com/aws/aws-sdk-go/awsmigrate/awsmigrate-renamer/vendor/golang.org/x/tools/go/buildutil": {"allpackages.go", "tags.go", "fakecontext.go"}, | |
20 | "github.com/aws/aws-sdk-go/vendor": {"key_test.go", "key.go"}, | |
21 | "github.com/aws/aws-sdk-go/vendor/github.com/go-ini/ini": {"struct_test.go", "error.go", "ini_test.go"}, | |
22 | } | |
23 | os.OpenFile(path.Join(baseDir, "glide.yaml"), os.O_RDONLY|os.O_CREATE, 0666) | |
24 | for p, files := range paths { | |
25 | p = path.Join(baseDir, "vendor", p) | |
26 | if err = os.MkdirAll(p, 0777); nil != err { | |
27 | t.Errorf("Unable to create vendor dir: %s\n%s", p, err.Error()) | |
28 | } | |
29 | for _, f := range files { | |
30 | os.OpenFile(path.Join(p, f), os.O_RDONLY|os.O_CREATE, 0666) | |
31 | } | |
32 | } | |
33 | return baseDir | |
34 | } | |
35 | ||
36 | func TestNestVendorNoError(t *testing.T) { | |
37 | workingDir := generateTestDirectory(t) | |
38 | os.Chdir(workingDir) | |
39 | err := StripVendor() | |
40 | if nil != err { | |
41 | t.Errorf("Unexpected error in StripVendor: %s", err.Error()) | |
42 | } | |
43 | } |
0 | package path | |
1 | ||
2 | import ( | |
3 | "errors" | |
4 | "os" | |
5 | "path/filepath" | |
6 | "reflect" | |
7 | "testing" | |
8 | "time" | |
9 | ) | |
10 | ||
11 | type mockFileInfo struct { | |
12 | name string | |
13 | isDir bool | |
14 | } | |
15 | ||
16 | func (mfi *mockFileInfo) Name() string { | |
17 | return mfi.name | |
18 | } | |
19 | ||
20 | func (mfi *mockFileInfo) Size() int64 { | |
21 | panic("not implemented") | |
22 | } | |
23 | ||
24 | func (mfi *mockFileInfo) Mode() os.FileMode { | |
25 | panic("not implemented") | |
26 | } | |
27 | ||
28 | func (mfi *mockFileInfo) ModTime() time.Time { | |
29 | panic("not implemented") | |
30 | } | |
31 | ||
32 | func (mfi *mockFileInfo) IsDir() bool { | |
33 | return mfi.isDir | |
34 | } | |
35 | ||
36 | func (mfi *mockFileInfo) Sys() interface{} { | |
37 | panic("not implemented") | |
38 | } | |
39 | ||
40 | type removeAll struct { | |
41 | calledWith string | |
42 | err error | |
43 | } | |
44 | ||
45 | func (rah *removeAll) removeAll(p string) error { | |
46 | rah.calledWith = p | |
47 | return rah.err | |
48 | } | |
49 | ||
50 | func TestWalkFunction(t *testing.T) { | |
51 | type args struct { | |
52 | searchPath string | |
53 | removeAll *removeAll | |
54 | path string | |
55 | info os.FileInfo | |
56 | err error | |
57 | } | |
58 | tests := []struct { | |
59 | name string | |
60 | args args | |
61 | want error | |
62 | wantCalledWith string | |
63 | }{ | |
64 | { | |
65 | name: "WalkFunctionSkipsNonVendor", | |
66 | args: args{searchPath: "foo", | |
67 | removeAll: &removeAll{}, | |
68 | path: "foo/bar", | |
69 | info: &mockFileInfo{name: "bar", isDir: true}, | |
70 | err: nil, | |
71 | }, | |
72 | want: nil, | |
73 | wantCalledWith: "", | |
74 | }, | |
75 | { | |
76 | name: "WalkFunctionSkipsNonDir", | |
77 | args: args{searchPath: "foo", | |
78 | removeAll: &removeAll{}, | |
79 | path: "foo/vendor", | |
80 | info: &mockFileInfo{name: "vendor", isDir: false}, | |
81 | err: nil, | |
82 | }, | |
83 | want: nil, | |
84 | wantCalledWith: "", | |
85 | }, | |
86 | { | |
87 | name: "WalkFunctionDeletesVendor", | |
88 | args: args{searchPath: "foo", | |
89 | removeAll: &removeAll{}, | |
90 | path: "foo/vendor", | |
91 | info: &mockFileInfo{name: "vendor", isDir: true}, | |
92 | err: nil, | |
93 | }, | |
94 | want: filepath.SkipDir, | |
95 | wantCalledWith: "foo/vendor", | |
96 | }, | |
97 | { | |
98 | name: "WalkFunctionReturnsPassedError", | |
99 | args: args{searchPath: "foo", | |
100 | removeAll: &removeAll{}, | |
101 | path: "foo/vendor", | |
102 | info: &mockFileInfo{name: "vendor", isDir: true}, | |
103 | err: errors.New("expected"), | |
104 | }, | |
105 | want: errors.New("expected"), | |
106 | wantCalledWith: "", | |
107 | }, | |
108 | { | |
109 | name: "WalkFunctionReturnsRemoveAllError", | |
110 | args: args{searchPath: "foo", | |
111 | removeAll: &removeAll{err: errors.New("expected")}, | |
112 | path: "foo/vendor", | |
113 | info: &mockFileInfo{name: "vendor", isDir: true}, | |
114 | err: nil, | |
115 | }, | |
116 | want: errors.New("expected"), | |
117 | wantCalledWith: "foo/vendor", | |
118 | }, | |
119 | { | |
120 | name: "WalkFunctionSkipsBaseDir", | |
121 | args: args{searchPath: "vendor", | |
122 | removeAll: &removeAll{}, | |
123 | path: "vendor", | |
124 | info: &mockFileInfo{name: "vendor", isDir: true}, | |
125 | err: nil, | |
126 | }, | |
127 | want: nil, | |
128 | wantCalledWith: "", | |
129 | }, | |
130 | } | |
131 | for _, test := range tests { | |
132 | walkFunction := getWalkFunction(test.args.searchPath, test.args.removeAll.removeAll) | |
133 | if actual := walkFunction(test.args.path, test.args.info, test.args.err); !reflect.DeepEqual(actual, test.want) { | |
134 | t.Errorf("walkFunction() = %v, want %v", actual, test.want) | |
135 | } | |
136 | if test.args.removeAll.calledWith != test.wantCalledWith { | |
137 | t.Errorf("removeAll argument = \"%s\", want \"%s\"", test.args.removeAll.calledWith, test.wantCalledWith) | |
138 | } | |
139 | } | |
140 | } |