mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-11-12 14:31:02 +00:00
publish: add by-hash entries for skel and AppStream files
SkelIndex was the only index constructor not propagating acquireByHash, so with -acquire-by-hash the Release file advertises Acquire-By-Hash: yes while no by-hash/ entries exist for these files and apt gets a 404.
This commit is contained in:
1 parent
23c5a31922
commit
c4ad756b47
2 files changed
+19
-5
No files matched your search
+6
-5
@@ -397,11 +397,12 @@ func (files *indexFiles) SkelIndex(component, path string) *indexFile {
|
||||
relativePath := filepath.Join(component, path)
|
||||
|
||||
file = &indexFile{
|
||||
parent: files,
|
||||
discardable: false,
|
||||
compressable: false,
|
||||
onlyGzip: false,
|
||||
relativePath: relativePath,
|
||||
parent: files,
|
||||
discardable: false,
|
||||
compressable: false,
|
||||
onlyGzip: false,
|
||||
acquireByHash: files.acquireByHash,
|
||||
relativePath: relativePath,
|
||||
}
|
||||
|
||||
files.indexes[key] = file
|
||||
|
||||
@@ -537,6 +537,19 @@ func (s *PublishedRepoSuite) TestPublishAppStreamMultipleComponents(c *C) {
|
||||
c.Check(published, DeepEquals, contribContent)
|
||||
}
|
||||
|
||||
func (s *PublishedRepoSuite) TestPublishAppStreamAcquireByHash(c *C) {
|
||||
s.snapshot.AppStreamFiles = map[string]string{
|
||||
"main/dep11/Components-amd64.yml.gz": s.importAppStreamFile(c, "Components-amd64.yml.gz", []byte("DEP-11 content\n")),
|
||||
}
|
||||
|
||||
s.repo.AcquireByHash = true
|
||||
err := s.repo.Publish(s.packagePool, s.provider, s.factory, &NullSigner{}, nil, false, "")
|
||||
c.Assert(err, IsNil)
|
||||
|
||||
base := filepath.Join(s.publishedStorage.PublicPath(), "ppa/dists/squeeze")
|
||||
c.Check(filepath.Join(base, "main/dep11/by-hash/SHA256"), PathExists)
|
||||
}
|
||||
|
||||
func (s *PublishedRepoSuite) TestPublishNoSigner(c *C) {
|
||||
err := s.repo.Publish(s.packagePool, s.provider, s.factory, nil, nil, false, "")
|
||||
c.Assert(err, IsNil)
|
||||
|
||||
Reference in new issue
Block a user