From a7cb78629320272545e6308ad62b6f7cf2bf504f Mon Sep 17 00:00:00 2001 From: Mustafa Gezen Date: Mon, 15 Feb 2021 05:20:42 +0100 Subject: [PATCH] set sensible defaults for committer, and fix some import prefix branch usage --- cmd/srpmproc/main.go | 4 ++-- internal/process.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/srpmproc/main.go b/cmd/srpmproc/main.go index 483711e..fc090ba 100644 --- a/cmd/srpmproc/main.go +++ b/cmd/srpmproc/main.go @@ -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(&sshUser, "ssh-user", "git", "SSH User") - root.Flags().StringVar(&gitCommitterName, "git-committer-name", "distrobuild-bot", "Name of committer") - root.Flags().StringVar(&gitCommitterEmail, "git-committer-email", "mustafa+distrobuild@bycrates.com", "Email of committer") + root.Flags().StringVar(&gitCommitterName, "git-committer-name", "rockyautomation", "Name 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(&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") diff --git a/internal/process.go b/internal/process.go index 730650e..194aa1b 100644 --- a/internal/process.go +++ b/internal/process.go @@ -134,7 +134,7 @@ func ProcessRPM(pd *ProcessData) { var matchString string if !tagImportRegex.MatchString(md.tagBranch) { 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) { replace := strings.Replace(md.tagBranch, "refs/heads/", "", 1) matchString = fmt.Sprintf("refs/tags/imports/%s/%s", replace, filepath.Base(pd.RpmLocation)) @@ -142,7 +142,7 @@ func ProcessRPM(pd *ProcessData) { } } if !tagImportRegex.MatchString(matchString) { - log.Fatal("import tag invalid") + continue } } else { matchString = md.tagBranch