Skip to content

Commit

Permalink
Add support for PROVIDES and REQUIRES (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
knqyf263 authored Feb 1, 2023
1 parent 4082a22 commit 584c43c
Show file tree
Hide file tree
Showing 4 changed files with 3,737 additions and 3,217 deletions.
13 changes: 13 additions & 0 deletions pkg/package.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ type PackageInfo struct {
FileFlags []int32
UserNames []string
GroupNames []string

Provides []string
Requires []string
}

type FileInfo struct {
Expand Down Expand Up @@ -116,6 +119,16 @@ func getNEVRA(indexEntries []indexEntry) (*PackageInfo, error) {
if pkgInfo.SourceRpm == "(none)" {
pkgInfo.SourceRpm = ""
}
case RPMTAG_PROVIDENAME:
if ie.Info.Type != RPM_STRING_ARRAY_TYPE {
return nil, xerrors.New("invalid tag providename")
}
pkgInfo.Provides = parseStringArray(ie.Data)
case RPMTAG_REQUIRENAME:
if ie.Info.Type != RPM_STRING_ARRAY_TYPE {
return nil, xerrors.New("invalid tag requirename")
}
pkgInfo.Requires = parseStringArray(ie.Data)
case RPMTAG_LICENSE:
if ie.Info.Type != RPM_STRING_TYPE {
return nil, xerrors.New("invalid tag license")
Expand Down
Loading

0 comments on commit 584c43c

Please sign in to comment.