mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-01-12 03:21:33 +00:00
only allow mirrors with architectures set
This commit is contained in:
@@ -317,9 +317,9 @@ func (l *PackageList) VerifyDependencies(options int, architectures []string, so
|
||||
progress.InitBar(int64(l.Len())*int64(len(architectures)), false, aptly.BarGeneralVerifyDependencies)
|
||||
}
|
||||
|
||||
if len(architectures) == 0 {
|
||||
if len(architectures) == 0 {
|
||||
return nil, fmt.Errorf("no architectures defined, cannot verify dependencies")
|
||||
}
|
||||
}
|
||||
for _, arch := range architectures {
|
||||
cache := make(map[string]bool, 2048)
|
||||
|
||||
|
||||
@@ -350,29 +350,26 @@ ok:
|
||||
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
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if len(repo.Architectures) == 0 {
|
||||
return fmt.Errorf("no architectures found, please specify")
|
||||
}
|
||||
|
||||
if !repo.IsFlat() {
|
||||
components := strings.Split(stanza["Components"], " ")
|
||||
if strings.Contains(repo.Distribution, "/") {
|
||||
|
||||
Reference in New Issue
Block a user