diff --git a/aptly/interfaces.go b/aptly/interfaces.go index f0791614..a89ba414 100644 --- a/aptly/interfaces.go +++ b/aptly/interfaces.go @@ -36,7 +36,7 @@ type PublishedStorage interface { // Remove removes single file under public path Remove(path string) error // LinkFromPool links package file from pool to dist's pool location - LinkFromPool(publishedDirectory string, sourcePool PackagePool, sourcePath string) error + LinkFromPool(publishedDirectory string, sourcePool PackagePool, sourcePath, sourceMD5 string) error // Filelist returns list of files under prefix Filelist(prefix string) ([]string, error) // RenameFile renames (moves) file diff --git a/deb/package.go b/deb/package.go index e965a8a0..9cd78c00 100644 --- a/deb/package.go +++ b/deb/package.go @@ -477,7 +477,7 @@ func (p *Package) LinkFromPool(publishedStorage aptly.PublishedStorage, packageP relPath := filepath.Join("pool", component, poolDir) publishedDirectory := filepath.Join(prefix, relPath) - err = publishedStorage.LinkFromPool(publishedDirectory, packagePool, sourcePath) + err = publishedStorage.LinkFromPool(publishedDirectory, packagePool, sourcePath, f.Checksums.MD5) if err != nil { return err } diff --git a/files/public.go b/files/public.go index f2280c40..e13b3836 100644 --- a/files/public.go +++ b/files/public.go @@ -78,7 +78,7 @@ func (storage *PublishedStorage) RemoveDirs(path string, progress aptly.Progress // sourcePath is filepath to package file in package pool // // LinkFromPool returns relative path for the published file to be included in package index -func (storage *PublishedStorage) LinkFromPool(publishedDirectory string, sourcePool aptly.PackagePool, sourcePath string) error { +func (storage *PublishedStorage) LinkFromPool(publishedDirectory string, sourcePool aptly.PackagePool, sourcePath, sourceMD5 string) error { // verify that package pool is local pool is filesystem pool _ = sourcePool.(*PackagePool) diff --git a/files/public_test.go b/files/public_test.go index f5718b25..cbb1bc5a 100644 --- a/files/public_test.go +++ b/files/public_test.go @@ -153,7 +153,7 @@ func (s *PublishedStorageSuite) TestLinkFromPool(c *C) { err = ioutil.WriteFile(t.sourcePath, []byte("Contents"), 0644) c.Assert(err, IsNil) - err = s.storage.LinkFromPool(filepath.Join(t.prefix, "pool", t.component, t.poolDirectory), pool, t.sourcePath) + err = s.storage.LinkFromPool(filepath.Join(t.prefix, "pool", t.component, t.poolDirectory), pool, t.sourcePath, "") c.Assert(err, IsNil) st, err := os.Stat(filepath.Join(s.storage.rootPath, t.prefix, t.expectedFilename)) @@ -171,6 +171,6 @@ func (s *PublishedStorageSuite) TestLinkFromPool(c *C) { err = ioutil.WriteFile(sourcePath, []byte("Contents"), 0644) c.Assert(err, IsNil) - err = s.storage.LinkFromPool(filepath.Join("", "pool", "main", "m/mars-invaders"), pool, sourcePath) + err = s.storage.LinkFromPool(filepath.Join("", "pool", "main", "m/mars-invaders"), pool, sourcePath, "") c.Check(err, ErrorMatches, ".*file already exists and is different") }