diff --git a/deb/index_files.go b/deb/index_files.go index 88c3c709..f0e2ba9e 100644 --- a/deb/index_files.go +++ b/deb/index_files.go @@ -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 diff --git a/deb/publish_test.go b/deb/publish_test.go index 0459c113..5a5b3cfa 100644 --- a/deb/publish_test.go +++ b/deb/publish_test.go @@ -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)