From 8c51d50cd27770d9e2e88b34f22c7c9d7fb220a5 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Thu, 1 Oct 2015 22:04:24 -0600 Subject: [PATCH] raco pkg: improve Git repo-download caching Drop the path and branch from a URL that references a Git repository, so that a single download is used for multiple packages in the same repo. --- racket/collects/pkg/private/download.rkt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/racket/collects/pkg/private/download.rkt b/racket/collects/pkg/private/download.rkt index 8199c822ff..47fc8e401b 100644 --- a/racket/collects/pkg/private/download.rkt +++ b/racket/collects/pkg/private/download.rkt @@ -27,12 +27,12 @@ rest] [_ rp]))) -(define (do-cache-file file url checksum use-cache? download-printf download!) +(define (do-cache-file file url key checksum use-cache? download-printf download!) (cond [(and use-cache? checksum) (cache-file file #:exists-ok? #t - (list (url->string url) checksum) + (list key checksum) (get-download-cache-dir) download! #:log-error-string (lambda (s) (log-pkg-error s)) @@ -76,7 +76,8 @@ " server response: ~a") (url->string url) (read-line (open-input-string reply-s)))))))))) - (do-cache-file file url checksum use-cache? download-printf download!))) + (do-cache-file file url (url->string url) checksum + use-cache? download-printf download!))) (define (clean-cache pkg-url checksum) (when pkg-url @@ -116,7 +117,8 @@ #:exists-ok? #t (directory-list)))) - (do-cache-file tmp.tgz url checksum use-cache? download-printf download!) + (do-cache-file tmp.tgz url (vector transport host port repo) checksum + use-cache? download-printf download!) (unless unpacked? (untgz tmp.tgz #:dest dest-dir))