mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-06-02 04:50:49 +00:00
Fix the installer path for Ubuntu Focal
Ubuntu has started depreciating the Debian installer in focal and moved the installer images to a different path. In versions after focal, they are completly removed. This basically gives us more time to figure out how to use the new system.
This commit is contained in:
committed by
André Roth
parent
43a0ceb350
commit
c2ee086487
+5
-1
@@ -249,7 +249,7 @@ func newIndexFiles(publishedStorage aptly.PublishedStorage, basePath, tempDir, s
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (files *indexFiles) PackageIndex(component, arch string, udeb, installer bool) *indexFile {
|
func (files *indexFiles) PackageIndex(component, arch string, udeb bool, installer bool, distribution string) *indexFile {
|
||||||
if arch == ArchitectureSource {
|
if arch == ArchitectureSource {
|
||||||
udeb = false
|
udeb = false
|
||||||
}
|
}
|
||||||
@@ -264,7 +264,11 @@ func (files *indexFiles) PackageIndex(component, arch string, udeb, installer bo
|
|||||||
if udeb {
|
if udeb {
|
||||||
relativePath = filepath.Join(component, "debian-installer", fmt.Sprintf("binary-%s", arch), "Packages")
|
relativePath = filepath.Join(component, "debian-installer", fmt.Sprintf("binary-%s", arch), "Packages")
|
||||||
} else if installer {
|
} else if installer {
|
||||||
|
if distribution == "focal" {
|
||||||
|
relativePath = filepath.Join(component, fmt.Sprintf("installer-%s", arch), "current", "legacy-images", "SHA256SUMS")
|
||||||
|
} else {
|
||||||
relativePath = filepath.Join(component, fmt.Sprintf("installer-%s", arch), "current", "images", "SHA256SUMS")
|
relativePath = filepath.Join(component, fmt.Sprintf("installer-%s", arch), "current", "images", "SHA256SUMS")
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
relativePath = filepath.Join(component, fmt.Sprintf("binary-%s", arch), "Packages")
|
relativePath = filepath.Join(component, fmt.Sprintf("binary-%s", arch), "Packages")
|
||||||
}
|
}
|
||||||
|
|||||||
+6
-1
@@ -189,7 +189,12 @@ func NewInstallerPackageFromControlFile(input Stanza, repo *RemoteRepo, componen
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
relPath := filepath.Join("dists", repo.Distribution, component, fmt.Sprintf("%s-%s", p.Name, architecture), "current", "images")
|
var relPath string
|
||||||
|
if repo.Distribution == "focal" {
|
||||||
|
relPath = filepath.Join("dists", repo.Distribution, component, fmt.Sprintf("%s-%s", p.Name, architecture), "current", "legacy-images")
|
||||||
|
} else {
|
||||||
|
relPath = filepath.Join("dists", repo.Distribution, component, fmt.Sprintf("%s-%s", p.Name, architecture), "current", "images")
|
||||||
|
}
|
||||||
for i := range files {
|
for i := range files {
|
||||||
files[i].downloadPath = relPath
|
files[i].downloadPath = relPath
|
||||||
|
|
||||||
|
|||||||
+7
-3
@@ -641,7 +641,7 @@ func (p *PublishedRepo) Publish(packagePool aptly.PackagePool, publishedStorageP
|
|||||||
|
|
||||||
// For all architectures, pregenerate packages/sources files
|
// For all architectures, pregenerate packages/sources files
|
||||||
for _, arch := range p.Architectures {
|
for _, arch := range p.Architectures {
|
||||||
indexes.PackageIndex(component, arch, false, false)
|
indexes.PackageIndex(component, arch, false, false, p.Distribution)
|
||||||
}
|
}
|
||||||
|
|
||||||
list.PrepareIndex()
|
list.PrepareIndex()
|
||||||
@@ -664,9 +664,13 @@ func (p *PublishedRepo) Publish(packagePool aptly.PackagePool, publishedStorageP
|
|||||||
return err2
|
return err2
|
||||||
}
|
}
|
||||||
relPath = filepath.Join("pool", component, poolDir)
|
relPath = filepath.Join("pool", component, poolDir)
|
||||||
|
} else {
|
||||||
|
if p.Distribution == "focal" {
|
||||||
|
relPath = filepath.Join("dists", p.Distribution, component, fmt.Sprintf("%s-%s", pkg.Name, arch), "current", "legacy-images")
|
||||||
} else {
|
} else {
|
||||||
relPath = filepath.Join("dists", p.Distribution, component, fmt.Sprintf("%s-%s", pkg.Name, arch), "current", "images")
|
relPath = filepath.Join("dists", p.Distribution, component, fmt.Sprintf("%s-%s", pkg.Name, arch), "current", "images")
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
err = pkg.LinkFromPool(publishedStorage, packagePool, p.Prefix, relPath, forceOverwrite)
|
err = pkg.LinkFromPool(publishedStorage, packagePool, p.Prefix, relPath, forceOverwrite)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -703,7 +707,7 @@ func (p *PublishedRepo) Publish(packagePool aptly.PackagePool, publishedStorageP
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bufWriter, err = indexes.PackageIndex(component, arch, pkg.IsUdeb, pkg.IsInstaller).BufWriter()
|
bufWriter, err = indexes.PackageIndex(component, arch, pkg.IsUdeb, pkg.IsInstaller, p.Distribution).BufWriter()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@@ -757,7 +761,7 @@ func (p *PublishedRepo) Publish(packagePool aptly.PackagePool, publishedStorageP
|
|||||||
|
|
||||||
// For all architectures, pregenerate .udeb indexes
|
// For all architectures, pregenerate .udeb indexes
|
||||||
for _, arch := range p.Architectures {
|
for _, arch := range p.Architectures {
|
||||||
indexes.PackageIndex(component, arch, true, false)
|
indexes.PackageIndex(component, arch, true, false, p.Distribution)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -259,7 +259,11 @@ func (repo *RemoteRepo) UdebPath(component string, architecture string) string {
|
|||||||
// InstallerPath returns path of Packages files for given component and
|
// InstallerPath returns path of Packages files for given component and
|
||||||
// architecture
|
// architecture
|
||||||
func (repo *RemoteRepo) InstallerPath(component string, architecture string) string {
|
func (repo *RemoteRepo) InstallerPath(component string, architecture string) string {
|
||||||
|
if repo.Distribution == "focal" {
|
||||||
|
return fmt.Sprintf("%s/installer-%s/current/legacy-images/SHA256SUMS", component, architecture)
|
||||||
|
} else {
|
||||||
return fmt.Sprintf("%s/installer-%s/current/images/SHA256SUMS", component, architecture)
|
return fmt.Sprintf("%s/installer-%s/current/images/SHA256SUMS", component, architecture)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// PackageURL returns URL of package file relative to repository root
|
// PackageURL returns URL of package file relative to repository root
|
||||||
|
|||||||
Reference in New Issue
Block a user