Specify output filename instead of directory

"temp" downloader uses its own naming for downloaded files.
This commit is contained in:
Lorenzo Bolla
2021-10-08 11:11:17 +02:00
parent eaac04ccf6
commit eff2e56d0d
+1 -4
View File
@@ -10,7 +10,6 @@ import (
"github.com/aptly-dev/aptly/utils" "github.com/aptly-dev/aptly/utils"
"github.com/cavaliercoder/grab" "github.com/cavaliercoder/grab"
"net/http" "net/http"
"path/filepath"
"time" "time"
"github.com/aptly-dev/aptly/aptly" "github.com/aptly-dev/aptly/aptly"
@@ -75,10 +74,8 @@ func (d *GrabDownloader) log(msg string, a ...interface{}) {
func (d *GrabDownloader) download(ctx context.Context, url string, destination string, expected *utils.ChecksumInfo, ignoreMismatch bool) error { func (d *GrabDownloader) download(ctx context.Context, url string, destination string, expected *utils.ChecksumInfo, ignoreMismatch bool) error {
// TODO clean up dest dir on permanent failure // TODO clean up dest dir on permanent failure
// TODO maxTries
d.log("Starting download %s -> %s\n", url, destination) d.log("Starting download %s -> %s\n", url, destination)
destDir := filepath.Dir(destination) req, _ := grab.NewRequest(destination, url)
req, _ := grab.NewRequest(destDir, url)
// TODO ignoreMismatch // TODO ignoreMismatch
if expected != nil { if expected != nil {