mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-07-26 13:47:40 +00:00
Specify output filename instead of directory
"temp" downloader uses its own naming for downloaded files.
This commit is contained in:
+1
-4
@@ -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 {
|
||||||
|
|||||||
Reference in New Issue
Block a user