mirror of
https://github.com/rocky-linux/srpmproc.git
synced 2024-11-10 15:21:28 +00:00
32 lines
636 B
Go
32 lines
636 B
Go
package internal
|
|
|
|
import (
|
|
"github.com/cavaliercoder/go-rpm"
|
|
)
|
|
|
|
// TODO: ugly hack, should create an interface
|
|
// since GitMode does not parse an RPM file, we just mimick
|
|
// the headers of an actual file to reuse rpmFile.Name()
|
|
func createPackageFile(name string) *rpm.PackageFile {
|
|
return &rpm.PackageFile{
|
|
Lead: rpm.Lead{},
|
|
Headers: []rpm.Header{
|
|
{},
|
|
{
|
|
Version: 0,
|
|
IndexCount: 1,
|
|
Length: 1,
|
|
Indexes: []rpm.IndexEntry{
|
|
{
|
|
Tag: 1000,
|
|
Type: rpm.IndexDataTypeStringArray,
|
|
Offset: 0,
|
|
ItemCount: 1,
|
|
Value: []string{name},
|
|
},
|
|
},
|
|
},
|
|
},
|
|
}
|
|
}
|