diff options
Diffstat (limited to 'stuff.go')
| -rw-r--r-- | stuff.go | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -18,13 +18,21 @@ import ( ) // scanDebs finds all .deb files and extracts their metadata. -func scanDebs(root string) ([]DebInfo, error) { +func scanDebs(root string, count int) ([]DebInfo, error) { var debs []DebInfo + var counter int err := filepath.Walk(root, func(path string, info os.FileInfo, err error) error { if err != nil { return err } if !info.IsDir() && strings.HasSuffix(info.Name(), ".deb") { + if count == -1 { + return nil + } + counter += 1 + if counter > count { + return nil + } log.Printf(" -> Processing %s", path) // Get control info |
