Documentation
¶
Overview ¶
Package debiancontrol implements a parser for Debian control files.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Paragraph ¶
func Parse ¶
Parses a Debian control file and returns a slice of Paragraphs.
Implemented according to chapter 5.1 (Syntax of control files) of the Debian Policy Manual: http://www.debian.org/doc/debian-policy/ch-controlfields.html
Example ¶
package main
import (
"fmt"
"github.com/stapelberg/godebiancontrol"
"log"
"os"
)
func main() {
file, err := os.Open("debian-mirror/dists/sid/main/source/Sources")
if err != nil {
log.Fatal(err)
}
defer file.Close()
paragraphs, err := godebiancontrol.Parse(file)
if err != nil {
log.Fatal(err)
}
// Print a list of which source package uses which package format.
for _, pkg := range paragraphs {
fmt.Printf("%s uses %s\n", pkg["Package"], pkg["Format"])
}
}
Output:
Click to show internal directories.
Click to hide internal directories.