Skip to content

fetch debian repository's metadata and parse it without dpkg/apt

Notifications You must be signed in to change notification settings

snyh/go-dpkg-parser

Repository files navigation

go-dpkg-parser

fetch debian repository's metadata and parse it without dpkg/apt

package main

import (
	"fmt"

	"github.com/snyh/go-dpkg-parser"
)

func main() {
	r := dpkg.NewRepository("cache") // where to save the local cache data

	//         source url and the suite name
	r.AddSuite("http://mirrors.163.com/debian/", "stable", "")

	a, err := r.Archive("amd64") //architecture name
	if err != nil {
		panic(err)
	}
	for name, p := range a.Packages {
		fmt.Println(name, "---------", p.Get("filename"))
	}
}

About

fetch debian repository's metadata and parse it without dpkg/apt

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published