Skip to content

Commit

Permalink
Tolerate "errornous" packages in go list
Browse files Browse the repository at this point in the history
Fixes: #204
  • Loading branch information
Reinhard Tartler authored and anthonyfok committed Mar 22, 2024
1 parent 69f76b8 commit 6ab50da
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions make.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ func (u *upstream) tar(gopath, repo string) error {
// findMains finds main packages within the repo (useful to auto-detect the
// package type).
func (u *upstream) findMains(gopath, repo string) error {
cmd := exec.Command("go", "list", "-f", "{{.ImportPath}} {{.Name}}", repo+"/...")
cmd := exec.Command("go", "list", "-e", "-f", "{{.ImportPath}} {{.Name}}", repo+"/...")
cmd.Dir = filepath.Join(gopath, "src", repo)
cmd.Env = passthroughEnv()
cmd.Stderr = os.Stderr
Expand All @@ -227,7 +227,7 @@ func (u *upstream) findMains(gopath, repo string) error {
log.Println("WARNING: In findMains:", fmt.Errorf("%q: %w", cmd.Args, err))
// See https://bugs.debian.org/992610
log.Printf("Retrying without appending \"/...\" to repo")
cmd = exec.Command("go", "list", "-f", "{{.ImportPath}} {{.Name}}", repo)
cmd = exec.Command("go", "list", "-e", "-f", "{{.ImportPath}} {{.Name}}", repo)
cmd.Dir = filepath.Join(gopath, "src", repo)
cmd.Env = passthroughEnv()
cmd.Stderr = os.Stderr
Expand Down Expand Up @@ -256,7 +256,7 @@ func (u *upstream) findMains(gopath, repo string) error {
func (u *upstream) findDependencies(gopath, repo string) error {
log.Printf("Determining dependencies\n")

cmd := exec.Command("go", "list", "-f", "{{join .Imports \"\\n\"}}\n{{join .TestImports \"\\n\"}}\n{{join .XTestImports \"\\n\"}}", repo+"/...")
cmd := exec.Command("go", "list", "-e", "-f", "{{join .Imports \"\\n\"}}\n{{join .TestImports \"\\n\"}}\n{{join .XTestImports \"\\n\"}}", repo+"/...")
cmd.Dir = filepath.Join(gopath, "src", repo)
cmd.Env = passthroughEnv()
cmd.Stderr = os.Stderr
Expand All @@ -266,7 +266,7 @@ func (u *upstream) findDependencies(gopath, repo string) error {
log.Println("WARNING: In findDependencies:", fmt.Errorf("%q: %w", cmd.Args, err))
// See https://bugs.debian.org/992610
log.Printf("Retrying without appending \"/...\" to repo")
cmd = exec.Command("go", "list", "-f", "{{join .Imports \"\\n\"}}\n{{join .TestImports \"\\n\"}}\n{{join .XTestImports \"\\n\"}}", repo)
cmd = exec.Command("go", "list", "-e", "-f", "{{join .Imports \"\\n\"}}\n{{join .TestImports \"\\n\"}}\n{{join .XTestImports \"\\n\"}}", repo)
cmd.Dir = filepath.Join(gopath, "src", repo)
cmd.Env = passthroughEnv()
cmd.Stderr = os.Stderr
Expand Down

0 comments on commit 6ab50da

Please sign in to comment.