Skip to content

Commit 8cbb3e5

Browse files
committed
estimate: ignore some modules based on a blocklist
This is more in line with the work involved to package a module for Debian. Closes: #263
1 parent 5def67d commit 8cbb3e5

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

estimate.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,13 @@ import (
1717
// majorVersionRegexp checks if an import path contains a major version suffix.
1818
var majorVersionRegexp = regexp.MustCompile(`([/.])v([0-9]+)$`)
1919

20+
// moduleBlocklist is a map of modules that we want to exclude from the estimate
21+
// output, associated with the reason why.
22+
var moduleBlocklist = map[string]string{
23+
"github.com/arduino/go-win32-utils": "Windows only",
24+
"github.com/Microsoft/go-winio": "Windows only",
25+
}
26+
2027
func get(gopath, repodir, repo, rev string) error {
2128
done := make(chan struct{})
2229
defer close(done)
@@ -230,6 +237,11 @@ func estimate(importpath, revision string) error {
230237
return
231238
}
232239
}
240+
// Ignore modules from the blocklist.
241+
if reason, found := moduleBlocklist[mod]; found {
242+
log.Printf("Ignoring module %s: %s", mod, reason)
243+
return
244+
}
233245
line := strings.Repeat(" ", indent)
234246
if rrseen[repoRoot] {
235247
line += fmt.Sprintf("\033[90m%s\033[0m", mod)

0 commit comments

Comments
 (0)