Commit a7cb7862 authored by Mustafa Gezen's avatar Mustafa Gezen 🏗
Browse files

set sensible defaults for committer, and fix some import prefix branch usage

parent 5762a402
...@@ -114,8 +114,8 @@ func main() { ...@@ -114,8 +114,8 @@ func main() {
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", "distrobuild-bot", "Name of committer") root.Flags().StringVar(&gitCommitterName, "git-committer-name", "rockyautomation", "Name of committer")
root.Flags().StringVar(&gitCommitterEmail, "git-committer-email", "mustafa+distrobuild@bycrates.com", "Email of committer") root.Flags().StringVar(&gitCommitterEmail, "git-committer-email", "rockyautomation@rockylinux.org", "Email of committer")
root.Flags().StringVar(&modulePrefix, "module-prefix", "https://git.centos.org/modules", "Where to retrieve modules if exists. Only used when source-rpm is a git repo") root.Flags().StringVar(&modulePrefix, "module-prefix", "https://git.centos.org/modules", "Where to retrieve modules if exists. Only used when source-rpm is a git repo")
root.Flags().StringVar(&rpmPrefix, "rpm-prefix", "https://git.centos.org/rpms", "Where to retrieve SRPM content. Only used when source-rpm is not a local file") root.Flags().StringVar(&rpmPrefix, "rpm-prefix", "https://git.centos.org/rpms", "Where to retrieve SRPM content. Only used when source-rpm is not a local file")
root.Flags().StringVar(&importBranchPrefix, "import-branch-prefix", "c", "Import branch prefix") root.Flags().StringVar(&importBranchPrefix, "import-branch-prefix", "c", "Import branch prefix")
......
...@@ -134,7 +134,7 @@ func ProcessRPM(pd *ProcessData) { ...@@ -134,7 +134,7 @@ func ProcessRPM(pd *ProcessData) {
var matchString string var matchString string
if !tagImportRegex.MatchString(md.tagBranch) { if !tagImportRegex.MatchString(md.tagBranch) {
if pd.ModuleMode { if pd.ModuleMode {
prefix := fmt.Sprintf("refs/heads/c%d", pd.Version) prefix := fmt.Sprintf("refs/heads/%s%d", pd.ImportBranchPrefix, pd.Version)
if strings.HasPrefix(md.tagBranch, prefix) { if strings.HasPrefix(md.tagBranch, prefix) {
replace := strings.Replace(md.tagBranch, "refs/heads/", "", 1) replace := strings.Replace(md.tagBranch, "refs/heads/", "", 1)
matchString = fmt.Sprintf("refs/tags/imports/%s/%s", replace, filepath.Base(pd.RpmLocation)) matchString = fmt.Sprintf("refs/tags/imports/%s/%s", replace, filepath.Base(pd.RpmLocation))
...@@ -142,7 +142,7 @@ func ProcessRPM(pd *ProcessData) { ...@@ -142,7 +142,7 @@ func ProcessRPM(pd *ProcessData) {
} }
} }
if !tagImportRegex.MatchString(matchString) { if !tagImportRegex.MatchString(matchString) {
log.Fatal("import tag invalid") continue
} }
} else { } else {
matchString = md.tagBranch matchString = md.tagBranch
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment