mirror of
https://github.com/rocky-linux/srpmproc.git
synced 2024-12-04 18:36:26 +00:00
Introduce --allow-stream-branches
This commit is contained in:
parent
f92efe75b6
commit
8fdc3a98e1
@ -63,6 +63,7 @@ var (
|
||||
manualCommits string
|
||||
upstreamPrefixHttps string
|
||||
moduleFallbackStream string
|
||||
allowStreamBranches bool
|
||||
)
|
||||
|
||||
var root = &cobra.Command{
|
||||
@ -168,6 +169,7 @@ func mn(_ *cobra.Command, _ []string) {
|
||||
ManualCommits: manualCs,
|
||||
UpstreamPrefixHttps: upstreamPrefixHttps,
|
||||
ModuleFallbackStream: moduleFallbackStream,
|
||||
AllowStreamBranches: allowStreamBranches,
|
||||
FsCreator: fsCreator,
|
||||
})
|
||||
}
|
||||
@ -199,6 +201,7 @@ func main() {
|
||||
root.Flags().StringVar(&manualCommits, "manual-commits", "", "Comma separated branch and commit list for packages with broken release tags (Format: BRANCH:HASH)")
|
||||
root.Flags().StringVar(&upstreamPrefixHttps, "upstream-prefix-https", "", "Web version of upstream prefix. Required if module-mode")
|
||||
root.Flags().StringVar(&moduleFallbackStream, "module-fallback-stream", "", "Override fallback stream. Some module packages are published as collections and mostly use the same stream name, some of them deviate from the main stream")
|
||||
root.Flags().BoolVar(&allowStreamBranches, "allow-stream-branches", false, "Allow import from stream branches")
|
||||
|
||||
if err := root.Execute(); err != nil {
|
||||
log.Fatal(err)
|
||||
|
@ -50,5 +50,6 @@ type ProcessData struct {
|
||||
ManualCommits []string
|
||||
UpstreamPrefixHttps string
|
||||
ModuleFallbackStream string
|
||||
AllowStreamBranches bool
|
||||
FsCreator func(branch string) billy.Filesystem
|
||||
}
|
||||
|
@ -59,7 +59,12 @@ func gitlabify(str string) string {
|
||||
// all files that are remote goes into .gitignore
|
||||
// all ignored files' hash goes into .{Name}.metadata
|
||||
func ProcessRPM(pd *data.ProcessData) {
|
||||
tagImportRegex = regexp.MustCompile(fmt.Sprintf("refs/tags/(imports/(%s.|%s.-.+)/(.*))", pd.ImportBranchPrefix, pd.ImportBranchPrefix))
|
||||
if pd.AllowStreamBranches {
|
||||
tagImportRegex = regexp.MustCompile(fmt.Sprintf("refs/tags/(imports/(%s(?:.s|.)|%s(?:|s).-.+)/(.*))", pd.ImportBranchPrefix, pd.ImportBranchPrefix))
|
||||
} else {
|
||||
tagImportRegex = regexp.MustCompile(fmt.Sprintf("refs/tags/(imports/(%s.|%s.-.+)/(.*))", pd.ImportBranchPrefix, pd.ImportBranchPrefix))
|
||||
}
|
||||
|
||||
md := pd.Importer.RetrieveSource(pd)
|
||||
md.BlobCache = map[string][]byte{}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user