mirror of
https://github.com/rocky-linux/srpmproc.git
synced 2024-12-04 18:36:26 +00:00
Add git name option for source-rpm
Adds the ability to set a source git repo name for the package that will be imported.
This commit is contained in:
parent
f2864a875a
commit
18f9f5c77c
@ -32,6 +32,7 @@ import (
|
||||
|
||||
var (
|
||||
sourceRpm string
|
||||
sourceRpmGitName string
|
||||
sshKeyLocation string
|
||||
sshUser string
|
||||
upstreamPrefix string
|
||||
@ -72,6 +73,7 @@ func mn(_ *cobra.Command, _ []string) {
|
||||
Version: version,
|
||||
StorageAddr: storageAddr,
|
||||
Package: sourceRpm,
|
||||
PackageGitName: sourceRpmGitName,
|
||||
ModuleMode: moduleMode,
|
||||
TmpFsMode: tmpFsMode,
|
||||
ModulePrefix: modulePrefix,
|
||||
@ -125,6 +127,7 @@ func main() {
|
||||
root.Flags().StringVar(&storageAddr, "storage-addr", "", "Bucket to use as blob storage")
|
||||
_ = root.MarkFlagRequired("storage-addr")
|
||||
|
||||
root.Flags().StringVar(&sourceRpmGitName, "source-rpm-git-name", "", "Actual git repo name of package if name is different from source-rpm value")
|
||||
root.Flags().StringVar(&sshKeyLocation, "ssh-key-location", "", "Location of the SSH key to use to authenticate against upstream")
|
||||
root.Flags().StringVar(&sshUser, "ssh-user", "git", "SSH User")
|
||||
root.Flags().StringVar(&gitCommitterName, "git-committer-name", "rockyautomation", "Name of committer")
|
||||
|
@ -68,9 +68,10 @@ const (
|
||||
|
||||
type ProcessDataRequest struct {
|
||||
// Required
|
||||
Version int
|
||||
StorageAddr string
|
||||
Package string
|
||||
Version int
|
||||
StorageAddr string
|
||||
Package string
|
||||
PackageGitName string
|
||||
|
||||
// Optional
|
||||
ModuleMode bool
|
||||
@ -219,6 +220,11 @@ func NewProcessData(req *ProcessDataRequest) (*data.ProcessData, error) {
|
||||
return nil, fmt.Errorf("package cannot be empty")
|
||||
}
|
||||
|
||||
// tells srpmproc what the source name actually is
|
||||
if req.PackageGitName == "" {
|
||||
req.PackageGitName = req.Package
|
||||
}
|
||||
|
||||
var importer data.ImportMode
|
||||
var blobStorage blob.Storage
|
||||
|
||||
@ -238,9 +244,9 @@ func NewProcessData(req *ProcessDataRequest) (*data.ProcessData, error) {
|
||||
|
||||
sourceRpmLocation := ""
|
||||
if req.ModuleMode {
|
||||
sourceRpmLocation = fmt.Sprintf("%s/%s", req.ModulePrefix, req.Package)
|
||||
sourceRpmLocation = fmt.Sprintf("%s/%s", req.ModulePrefix, req.PackageGitName)
|
||||
} else {
|
||||
sourceRpmLocation = fmt.Sprintf("%s/%s", req.RpmPrefix, req.Package)
|
||||
sourceRpmLocation = fmt.Sprintf("%s/%s", req.RpmPrefix, req.PackageGitName)
|
||||
}
|
||||
importer = &modes.GitMode{}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user