mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-07-26 13:47:40 +00:00
Trim hashes when parsing packages, export package expected checksums.
This commit is contained in:
Vendored
+5
-5
@@ -89,9 +89,9 @@ func NewPackageFromControlFile(input Stanza) *Package {
|
|||||||
Filename: input["Filename"],
|
Filename: input["Filename"],
|
||||||
Checksums: utils.ChecksumInfo{
|
Checksums: utils.ChecksumInfo{
|
||||||
Size: filesize,
|
Size: filesize,
|
||||||
MD5: input["MD5sum"],
|
MD5: strings.TrimSpace(input["MD5sum"]),
|
||||||
SHA1: input["SHA1"],
|
SHA1: strings.TrimSpace(input["SHA1"]),
|
||||||
SHA256: input["SHA256"],
|
SHA256: strings.TrimSpace(input["SHA256"]),
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -273,7 +273,7 @@ func (p *Package) PoolDirectory() (string, error) {
|
|||||||
type PackageDownloadTask struct {
|
type PackageDownloadTask struct {
|
||||||
RepoURI string
|
RepoURI string
|
||||||
DestinationPath string
|
DestinationPath string
|
||||||
Size int64
|
Checksums utils.ChecksumInfo
|
||||||
}
|
}
|
||||||
|
|
||||||
// DownloadList returns list of missing package files for download in format
|
// DownloadList returns list of missing package files for download in format
|
||||||
@@ -293,7 +293,7 @@ func (p *Package) DownloadList(packageRepo *Repository) (result []PackageDownloa
|
|||||||
}
|
}
|
||||||
|
|
||||||
if !verified {
|
if !verified {
|
||||||
result = append(result, PackageDownloadTask{RepoURI: f.Filename, DestinationPath: poolPath, Size: f.Checksums.Size})
|
result = append(result, PackageDownloadTask{RepoURI: f.Filename, DestinationPath: poolPath, Checksums: f.Checksums})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user