Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions rpm/sles.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,15 @@ func (b *SLESBackend) GetKernelHeaders(directory string) error {
// https://download.opensuse.org/repositories/Kernel:
if version := b.target.OSRelease["VERSION"]; version != "" {
addKernelRepository := func(version string) {
versionSplit := strings.SplitN(version, "-", 2)
version = "SLE" + version
repoID := "Kernel_" + version
baseurl := fmt.Sprintf("https://download.opensuse.org/repositories/Kernel:/%s/standard/", version)
gpgKey := fmt.Sprintf("https://download.opensuse.org/repositories/Kernel:/%s/standard/repodata/repomd.xml.key", version)
subPath := "standard"
if versionSplit[0] == "15" {
subPath = "pool"
}
baseurl := fmt.Sprintf("https://download.opensuse.org/repositories/Kernel:/%s/%s/", version, subPath)
gpgKey := fmt.Sprintf("https://download.opensuse.org/repositories/Kernel:/%s/%s/repodata/repomd.xml.key", version, subPath)

b.logger.Infof("Using with %s repository", repoID)
b.dnfBackend.AddRepository(repoID, baseurl, true, gpgKey, "", "", "")
Expand Down