mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-04-20 19:38:39 +00:00
set Architectures from flat mirror
note: 'Architecture' is not official, but used by nvidia mirrors for no debian arch 'x86_64'. shold this be supported ?
This commit is contained in:
@@ -350,21 +350,30 @@ ok:
|
||||
return err
|
||||
}
|
||||
|
||||
if !repo.IsFlat() {
|
||||
architectures := strings.Split(stanza["Architectures"], " ")
|
||||
sort.Strings(architectures)
|
||||
// "source" architecture is never present, despite Release file claims
|
||||
architectures = utils.StrSlicesSubstract(architectures, []string{ArchitectureSource})
|
||||
if len(repo.Architectures) == 0 {
|
||||
repo.Architectures = architectures
|
||||
} else if !repo.SkipArchitectureCheck {
|
||||
err = utils.StringsIsSubset(repo.Architectures, architectures,
|
||||
fmt.Sprintf("architecture %%s not available in repo %s, use -force-architectures to override", repo))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
var architectures []string
|
||||
if len(stanza["Architectures"]) > 0 {
|
||||
architectures = strings.Split(stanza["Architectures"], " ")
|
||||
} else if len(stanza["Architecture"]) > 0 {
|
||||
architectures = strings.Split(stanza["Architecture"], " ")
|
||||
}
|
||||
if len(architectures) == 0 {
|
||||
fmt.Printf("stanza arch: %s\n", stanza["Architecture"])
|
||||
architectures = strings.Split(stanza["Architecture"], " ")
|
||||
}
|
||||
sort.Strings(architectures)
|
||||
// "source" architecture is never present, despite Release file claims
|
||||
architectures = utils.StrSlicesSubstract(architectures, []string{ArchitectureSource})
|
||||
if len(repo.Architectures) == 0 {
|
||||
repo.Architectures = architectures
|
||||
} else if !repo.SkipArchitectureCheck {
|
||||
err = utils.StringsIsSubset(repo.Architectures, architectures,
|
||||
fmt.Sprintf("architecture %%s not available in repo %s, use -force-architectures to override", repo))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
if !repo.IsFlat() {
|
||||
components := strings.Split(stanza["Components"], " ")
|
||||
if strings.Contains(repo.Distribution, "/") {
|
||||
distributionLast := path.Base(repo.Distribution) + "/"
|
||||
|
||||
Reference in New Issue
Block a user