Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
eb4865fb
Unverified
Commit
eb4865fb
authored
Feb 24, 2019
by
Davanum Srinivas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Hack to ignore stale packages in godep
Change-Id: Ibf0877521310d6f2baad605bf1216940e95cb9cd
parent
317ecf58
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
2 deletions
+31
-2
godep-save.sh
hack/godep-save.sh
+16
-2
pkg.go
third_party/forked/godep/pkg.go
+13
-0
save.go
third_party/forked/godep/save.go
+2
-0
No files found.
hack/godep-save.sh
View file @
eb4865fb
...
...
@@ -52,9 +52,23 @@ if [[ -d Godeps ]]; then
mv
Godeps
"
${
BACKUP
}
/Godeps"
fi
## Workaround "httplex" was dropped from golang.org/x/net repo and the code
## was moved to the "golang.org/x/net/http/httpguts" directory, we do not use
## this directly, however many packages we vendor are still using the older
## golang.org/x/net and we need to keep this until all those dependencies
## are switched to newer golang.org/x/net.
IGNORED_PACKAGES
=(
"golang.org/x/net/lex/httplex"
)
REQUIRED_BINS
=(
"golang.org/x/net/internal/nettest"
"golang.org/x/net/internal/socks"
"golang.org/x/net/internal/sockstest"
)
# Some things we want in godeps aren't code dependencies, so ./...
# won't pick them up.
REQUIRED_BINS
=(
REQUIRED_BINS
+
=(
"github.com/bazelbuild/bazel-gazelle/cmd/gazelle"
"github.com/bazelbuild/buildtools/buildozer"
"github.com/cespare/prettybench"
...
...
@@ -74,7 +88,7 @@ kube::log::status "Running godep save - this might take a while"
# This uses $(pwd) rather than ${KUBE_ROOT} because KUBE_ROOT will be
# realpath'ed, and godep barfs ("... is not using a known version control
# system") on our staging dirs.
GOPATH
=
"
${
GOPATH
}
:
$(
pwd
)
/staging"
${
KUBE_GODEP
:?
}
save
"
${
REQUIRED_BINS
[@]
}
"
GOPATH
=
"
${
GOPATH
}
:
$(
pwd
)
/staging"
${
KUBE_GODEP
:?
}
save
-i
$(
IFS
=
,
;
echo
"
${
IGNORED_PACKAGES
[*]
}
"
)
"
${
REQUIRED_BINS
[@]
}
"
# create a symlink in vendor directory pointing to the staging client. This
# let other packages use the staging client as if it were vendored.
...
...
third_party/forked/godep/pkg.go
View file @
eb4865fb
package
main
import
(
"fmt"
"go/build"
"os"
"regexp"
"sort"
"strings"
)
...
...
@@ -42,9 +45,19 @@ func LoadPackages(names ...string) (a []*Package, err error) {
if
len
(
names
)
==
0
{
return
nil
,
nil
}
pkgs
:=
strings
.
Split
(
ignorePackages
,
","
)
sort
.
Strings
(
pkgs
)
for
_
,
i
:=
range
importPaths
(
names
)
{
p
,
err
:=
listPackage
(
i
)
if
err
!=
nil
{
if
len
(
pkgs
)
>
0
{
idx
:=
sort
.
SearchStrings
(
pkgs
,
i
)
if
idx
<
len
(
pkgs
)
&&
pkgs
[
idx
]
==
i
{
fmt
.
Fprintf
(
os
.
Stderr
,
"warning: ignoring package %q
\n
"
,
i
)
continue
}
}
return
nil
,
err
}
a
=
append
(
a
,
p
)
...
...
third_party/forked/godep/save.go
View file @
eb4865fb
...
...
@@ -64,11 +64,13 @@ For more about specifying packages, see 'go help packages'.
var
(
saveR
,
saveT
bool
ignorePackages
string
)
func
init
()
{
cmdSave
.
Flag
.
BoolVar
(
&
saveR
,
"r"
,
false
,
"rewrite import paths"
)
cmdSave
.
Flag
.
BoolVar
(
&
saveT
,
"t"
,
false
,
"save test files"
)
cmdSave
.
Flag
.
StringVar
(
&
ignorePackages
,
"i"
,
""
,
"list of packages to ignore separated by commas"
)
}
func
runSave
(
cmd
*
Command
,
args
[]
string
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment