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 (
|
var (
|
||||||
sourceRpm string
|
sourceRpm string
|
||||||
|
sourceRpmGitName string
|
||||||
sshKeyLocation string
|
sshKeyLocation string
|
||||||
sshUser string
|
sshUser string
|
||||||
upstreamPrefix string
|
upstreamPrefix string
|
||||||
@ -72,6 +73,7 @@ func mn(_ *cobra.Command, _ []string) {
|
|||||||
Version: version,
|
Version: version,
|
||||||
StorageAddr: storageAddr,
|
StorageAddr: storageAddr,
|
||||||
Package: sourceRpm,
|
Package: sourceRpm,
|
||||||
|
PackageGitName: sourceRpmGitName,
|
||||||
ModuleMode: moduleMode,
|
ModuleMode: moduleMode,
|
||||||
TmpFsMode: tmpFsMode,
|
TmpFsMode: tmpFsMode,
|
||||||
ModulePrefix: modulePrefix,
|
ModulePrefix: modulePrefix,
|
||||||
@ -125,6 +127,7 @@ func main() {
|
|||||||
root.Flags().StringVar(&storageAddr, "storage-addr", "", "Bucket to use as blob storage")
|
root.Flags().StringVar(&storageAddr, "storage-addr", "", "Bucket to use as blob storage")
|
||||||
_ = root.MarkFlagRequired("storage-addr")
|
_ = 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(&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(&sshUser, "ssh-user", "git", "SSH User")
|
||||||
root.Flags().StringVar(&gitCommitterName, "git-committer-name", "rockyautomation", "Name of committer")
|
root.Flags().StringVar(&gitCommitterName, "git-committer-name", "rockyautomation", "Name of committer")
|
||||||
|
@ -68,9 +68,10 @@ const (
|
|||||||
|
|
||||||
type ProcessDataRequest struct {
|
type ProcessDataRequest struct {
|
||||||
// Required
|
// Required
|
||||||
Version int
|
Version int
|
||||||
StorageAddr string
|
StorageAddr string
|
||||||
Package string
|
Package string
|
||||||
|
PackageGitName string
|
||||||
|
|
||||||
// Optional
|
// Optional
|
||||||
ModuleMode bool
|
ModuleMode bool
|
||||||
@ -219,6 +220,11 @@ func NewProcessData(req *ProcessDataRequest) (*data.ProcessData, error) {
|
|||||||
return nil, fmt.Errorf("package cannot be empty")
|
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 importer data.ImportMode
|
||||||
var blobStorage blob.Storage
|
var blobStorage blob.Storage
|
||||||
|
|
||||||
@ -238,9 +244,9 @@ func NewProcessData(req *ProcessDataRequest) (*data.ProcessData, error) {
|
|||||||
|
|
||||||
sourceRpmLocation := ""
|
sourceRpmLocation := ""
|
||||||
if req.ModuleMode {
|
if req.ModuleMode {
|
||||||
sourceRpmLocation = fmt.Sprintf("%s/%s", req.ModulePrefix, req.Package)
|
sourceRpmLocation = fmt.Sprintf("%s/%s", req.ModulePrefix, req.PackageGitName)
|
||||||
} else {
|
} else {
|
||||||
sourceRpmLocation = fmt.Sprintf("%s/%s", req.RpmPrefix, req.Package)
|
sourceRpmLocation = fmt.Sprintf("%s/%s", req.RpmPrefix, req.PackageGitName)
|
||||||
}
|
}
|
||||||
importer = &modes.GitMode{}
|
importer = &modes.GitMode{}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user