mirror of
https://github.com/rocky-linux/srpmproc.git
synced 2024-06-02 00:00:17 +00:00
Introduce --allow-stream-branches
This commit is contained in:
parent
f92efe75b6
commit
8fdc3a98e1
|
@ -63,6 +63,7 @@ var (
|
||||||
manualCommits string
|
manualCommits string
|
||||||
upstreamPrefixHttps string
|
upstreamPrefixHttps string
|
||||||
moduleFallbackStream string
|
moduleFallbackStream string
|
||||||
|
allowStreamBranches bool
|
||||||
)
|
)
|
||||||
|
|
||||||
var root = &cobra.Command{
|
var root = &cobra.Command{
|
||||||
|
@ -168,6 +169,7 @@ func mn(_ *cobra.Command, _ []string) {
|
||||||
ManualCommits: manualCs,
|
ManualCommits: manualCs,
|
||||||
UpstreamPrefixHttps: upstreamPrefixHttps,
|
UpstreamPrefixHttps: upstreamPrefixHttps,
|
||||||
ModuleFallbackStream: moduleFallbackStream,
|
ModuleFallbackStream: moduleFallbackStream,
|
||||||
|
AllowStreamBranches: allowStreamBranches,
|
||||||
FsCreator: fsCreator,
|
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(&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(&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().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 {
|
if err := root.Execute(); err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
|
|
|
@ -50,5 +50,6 @@ type ProcessData struct {
|
||||||
ManualCommits []string
|
ManualCommits []string
|
||||||
UpstreamPrefixHttps string
|
UpstreamPrefixHttps string
|
||||||
ModuleFallbackStream string
|
ModuleFallbackStream string
|
||||||
|
AllowStreamBranches bool
|
||||||
FsCreator func(branch string) billy.Filesystem
|
FsCreator func(branch string) billy.Filesystem
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,7 +59,12 @@ func gitlabify(str string) string {
|
||||||
// all files that are remote goes into .gitignore
|
// all files that are remote goes into .gitignore
|
||||||
// all ignored files' hash goes into .{Name}.metadata
|
// all ignored files' hash goes into .{Name}.metadata
|
||||||
func ProcessRPM(pd *data.ProcessData) {
|
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 := pd.Importer.RetrieveSource(pd)
|
||||||
md.BlobCache = map[string][]byte{}
|
md.BlobCache = map[string][]byte{}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user