summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go28
1 files changed, 23 insertions, 5 deletions
diff --git a/main.go b/main.go
index db09e03..abcd21a 100644
--- a/main.go
+++ b/main.go
@@ -89,7 +89,7 @@ func main() {
}
if argv.Newest != nil {
- s, err = doNewest()
+ s, err = doNewest("amd64")
}
if err != nil {
@@ -99,12 +99,14 @@ func main() {
}
// make a list of the newest .deb files
-func doNewest() (string, error) {
+func doNewest(arch string) (string, error) {
log.Info("Processing dir", filepath.Join(me.pb.BaseDir, "pool"))
newest := zoopb.NewPackages()
- var counter int
for p := range me.pb.IterAll() {
+ if p.Architecture != arch {
+ continue
+ }
found := newest.FindByPackage(p.Package)
if found == nil {
// package is new
@@ -125,7 +127,23 @@ func doNewest() (string, error) {
}
newest.SortPackage()
- footer := newest.PrintTable()
- log.Info("newest packages ?", footer, counter)
+ var myshit string
+ for p := range newest.IterAll() {
+ controlfile, err := p.GetDebianControlFile()
+ if err != nil {
+ log.Info("make debInfo file error", err)
+ panic("deb error")
+ }
+ log.Info(controlfile)
+ myshit += controlfile + "\n"
+ }
+
+ fullname := "/home/mirrors/wit/first.Packages"
+ if err := os.WriteFile(fullname, []byte(myshit), 0644); err != nil {
+ return fullname, err
+ }
+
+ // footer := newest.PrintTable()
+ // log.Info("newest packages ?", footer, counter)
return "doNewest", nil
}