Skip to content

A native implementation of the RPM file specification in Go

License

Notifications You must be signed in to change notification settings

andreasweberd/go-rpm

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-rpm, a fork of the then-refactored https://github.com/cavaliercoder/go-rpm library

A native implementation of the RPM file specification in Go.

$ go get github.com/andreasweberd/go-rpm

Initial goals include like-for-like implementation of existing rpm ecosystem features such as:

  • Reading of modern and legacy rpm package file formats
  • Reading, creating and updating modern and legacy yum repository metadata
  • Reading of the rpm database
package main

import (
	"fmt"
	"github.com/andreasweberd/go-rpm"
)

func main() {
	p, err := rpm.OpenPackageFile("golang-1.6.3-2.el7.rpm")
	if err != nil {
		panic(err)
	}

	fmt.Printf("Loaded package: %v - %s\n", p, p.Summary())

	// Output: golang-0:1.6.3-2.el7.x86_64 - The Go Programming Language
}

Tools

This package also includes two tools rpmdump and rpminfo.

The code for both tools demonstrates some use-cases of this package. They are both also useful for interrogating RPM packages on any platform.

$ rpminfo golang-1.6.3-2.el7.x86_64.rpm
Name        : golang
Version     : 1.6.3
Release     : 2.el7
Architecture: x86_64
Group       : Unspecified
Size        : 11809071
License     : BSD and Public Domain
Signature   : RSA/SHA256, Sun Nov 20 18:01:16 2016, Key ID 24c6a8a7f4a80eb5
Source RPM  : golang-1.6.3-2.el7.src.rpm
Build Date  : Tue Nov 15 12:20:30 2016
Build Host  : c1bm.rdu2.centos.org
Packager    : CentOS BuildSystem <http://bugs.centos.org>
Vendor      : CentOS
URL         : http://golang.org/
Summary     : The Go Programming Language
Description :
The Go Programming Language.

About

A native implementation of the RPM file specification in Go

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 98.8%
  • Other 1.2%