rpmdb

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 23, 2024 License: MIT Imports: 15 Imported by: 45

Documentation

Index

Constants

View Source
const (
	PGPHASHALGO_MD5       = iota + 1 /*!< MD5 */
	PGPHASHALGO_SHA1                 /*!< SHA1 */
	PGPHASHALGO_RIPEMD160            /*!< RIPEMD160 */

	PGPHASHALGO_MD2         /*!< MD2 */
	PGPHASHALGO_TIGER192    /*!< TIGER192 */
	PGPHASHALGO_HAVAL_5_160 /*!< HAVAL-5-160 */
	PGPHASHALGO_SHA256      /*!< SHA256 */
	PGPHASHALGO_SHA384      /*!< SHA384 */
	PGPHASHALGO_SHA512      /*!< SHA512 */
	PGPHASHALGO_SHA224      /*!< SHA224 */
)
View Source
const (
	RPMFILE_CONFIG    int32 = 1 << iota /*!< from %%config */
	RPMFILE_DOC                         /*!< from %%doc */
	RPMFILE_ICON                        /*!< from %%donotuse. */
	RPMFILE_MISSINGOK                   /*!< from %%config(missingok) */
	RPMFILE_NOREPLACE                   /*!< from %%config(noreplace) */
	RPMFILE_SPECFILE                    /*!< @todo (unnecessary) marks 1st file in srpm. */
	RPMFILE_GHOST                       /*!< from %%ghost */
	RPMFILE_LICENSE                     /*!< from %%license */
	RPMFILE_README                      /*!< from %%readme */

	RPMFILE_PUBKEY   /*!< from %%pubkey */
	RPMFILE_ARTIFACT /*!< from %%artifact */
)

source: https://github.com/rpm-software-management/rpm/blob/da55723907418bfb3939cd6ddd941b3fdb4f6887/lib/rpmfiles.h#L46-L63

View Source
const (
	// ref. https://github.com/rpm-software-management/rpm/blob/rpm-4.14.3-release/lib/rpmtag.h#L34
	RPMTAG_HEADERIMAGE      = 61
	RPMTAG_HEADERSIGNATURES = 62
	RPMTAG_HEADERIMMUTABLE  = 63
	HEADER_I18NTABLE        = 100
	RPMTAG_HEADERI18NTABLE  = HEADER_I18NTABLE

	// rpmTag_e
	// ref. https://github.com/rpm-software-management/rpm/blob/rpm-4.14.3-release/lib/rpmtag.h#L34
	RPMTAG_SIGMD5         = 261  /* x */
	RPMTAG_NAME           = 1000 /* s */
	RPMTAG_VERSION        = 1001 /* s */
	RPMTAG_RELEASE        = 1002 /* s */
	RPMTAG_EPOCH          = 1003 /* i */
	RPMTAG_INSTALLTIME    = 1008 /* i */
	RPMTAG_SIZE           = 1009 /* i */
	RPMTAG_VENDOR         = 1011 /* s */
	RPMTAG_LICENSE        = 1014 /* s */
	RPMTAG_ARCH           = 1022 /* s */
	RPMTAG_FILESIZES      = 1028 /* i[] */
	RPMTAG_FILEMODES      = 1030 /* h[] , specifically []uint16 (ref https://github.com/rpm-software-management/rpm/blob/2153fa4ae51a84547129b8ebb3bb396e1737020e/lib/rpmtypes.h#L53 )*/
	RPMTAG_FILEDIGESTS    = 1035 /* s[] */
	RPMTAG_FILEFLAGS      = 1037 /* i[] */
	RPMTAG_FILEUSERNAME   = 1039 /* s[] */
	RPMTAG_FILEGROUPNAME  = 1040 /* s[] */
	RPMTAG_SOURCERPM      = 1044 /* s */
	RPMTAG_PROVIDENAME    = 1047 /* s[] */
	RPMTAG_REQUIRENAME    = 1049 /* s[] */
	RPMTAG_DIRINDEXES     = 1116 /* i[] */
	RPMTAG_BASENAMES      = 1117 /* s[] */
	RPMTAG_DIRNAMES       = 1118 /* s[] */
	RPMTAG_FILEDIGESTALGO = 5011 /* i  */
	RPMTAG_SUMMARY        = 1004 /* s */
	RPMTAG_PGP            = 259  /* b */

	// rpmTag_enhances
	// https://github.com/rpm-software-management/rpm/blob/rpm-4.16.0-release/lib/rpmtag.h#L375
	RPMTAG_MODULARITYLABEL = 5096

	// rpmTagType_e
	// ref. https://github.com/rpm-software-management/rpm/blob/rpm-4.14.3-release/lib/rpmtag.h#L431
	RPM_MIN_TYPE          = 0
	RPM_NULL_TYPE         = 0
	RPM_CHAR_TYPE         = 1
	RPM_INT8_TYPE         = 2
	RPM_INT16_TYPE        = 3
	RPM_INT32_TYPE        = 4
	RPM_INT64_TYPE        = 5
	RPM_STRING_TYPE       = 6
	RPM_BIN_TYPE          = 7
	RPM_STRING_ARRAY_TYPE = 8
	RPM_I18NSTRING_TYPE   = 9
	RPM_MAX_TYPE          = 9
)

Variables

This section is empty.

Functions

func Htonl

func Htonl(val int32) int32

func HtonlU

func HtonlU(val uint32) uint32

Types

type DigestAlgorithm

type DigestAlgorithm int32

func (DigestAlgorithm) String

func (d DigestAlgorithm) String() string

type FileInfo

type FileInfo struct {
	Path      string
	Mode      uint16
	Digest    string
	Size      int32
	Username  string
	Groupname string
	Flags     FileFlags
}

type PackageInfo

type PackageInfo struct {
	Epoch           *int
	Name            string
	Version         string
	Release         string
	Arch            string
	SourceRpm       string
	Size            int
	License         string
	Vendor          string
	Modularitylabel string
	Summary         string
	PGP             string
	SigMD5          string
	DigestAlgorithm DigestAlgorithm
	InstallTime     int
	BaseNames       []string
	DirIndexes      []int32
	DirNames        []string
	FileSizes       []int32
	FileDigests     []string
	FileModes       []uint16
	FileFlags       []int32
	UserNames       []string
	GroupNames      []string

	Provides []string
	Requires []string
}

func (*PackageInfo) EpochNum

func (p *PackageInfo) EpochNum() int

func (*PackageInfo) InstalledFileNames

func (p *PackageInfo) InstalledFileNames() ([]string, error)

func (*PackageInfo) InstalledFiles

func (p *PackageInfo) InstalledFiles() ([]FileInfo, error)

type RpmDB

type RpmDB struct {
	// contains filtered or unexported fields
}

func Open

func Open(path string) (*RpmDB, error)

func (*RpmDB) Close

func (d *RpmDB) Close() error

func (*RpmDB) ListPackages

func (d *RpmDB) ListPackages() ([]*PackageInfo, error)

func (*RpmDB) Package

func (d *RpmDB) Package(name string) (*PackageInfo, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL