mirror of
https://github.com/rocky-linux/srpmproc.git
synced 2024-11-10 15:21:28 +00:00
22 lines
436 B
Go
22 lines
436 B
Go
package directives
|
|
|
|
import (
|
|
"github.com/go-git/go-git/v5"
|
|
srpmprocpb "github.com/mstg/srpmproc/pb"
|
|
"path/filepath"
|
|
"strings"
|
|
)
|
|
|
|
func checkAddPrefix(file string) string {
|
|
if strings.HasPrefix(file, "SOURCES/") ||
|
|
strings.HasPrefix(file, "SPECS/") {
|
|
return file
|
|
}
|
|
|
|
return filepath.Join("SOURCES", file)
|
|
}
|
|
|
|
func Apply(cfg *srpmprocpb.Cfg, patchTree *git.Worktree, pushTree *git.Worktree) {
|
|
replace(cfg, patchTree, pushTree)
|
|
}
|