mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-04-20 19:38:39 +00:00
Rework mirror update (download packages) implementation
`PackageDownloadTask` is just a reference to file now. Whole process was rewritten to follow pattern: download to temp location inside the pool, verify/update checksums, import into pool as final step. This removes a lot of edge cases when aptly internal state might be broken if updating from rogue mirror. Also this changes whole memory model: package list/files are kept in memory now during the duration of `mirror update` command and saved to disk only in the end.
This commit is contained in:
@@ -132,7 +132,7 @@ func (s *PackagePoolSuite) TestImportMove(c *C) {
|
||||
info, err := s.pool.Stat(path)
|
||||
c.Assert(err, IsNil)
|
||||
c.Check(info.Size(), Equals, int64(2738))
|
||||
c.Check(info.Sys().(*syscall.Stat_t).Nlink, Equals, uint16(1))
|
||||
c.Check(int(info.Sys().(*syscall.Stat_t).Nlink), Equals, 1)
|
||||
}
|
||||
|
||||
func (s *PackagePoolSuite) TestImportNotExist(c *C) {
|
||||
@@ -204,7 +204,7 @@ func (s *PackagePoolSuite) TestSymlink(c *C) {
|
||||
|
||||
info, err = os.Lstat(dstPath)
|
||||
c.Assert(err, IsNil)
|
||||
c.Check(info.Sys().(*syscall.Stat_t).Mode&syscall.S_IFMT, Equals, uint16(syscall.S_IFLNK))
|
||||
c.Check(int(info.Sys().(*syscall.Stat_t).Mode&syscall.S_IFMT), Equals, int(syscall.S_IFLNK))
|
||||
}
|
||||
|
||||
func (s *PackagePoolSuite) TestGenerateRandomPath(c *C) {
|
||||
|
||||
Reference in New Issue
Block a user