download: Disarchive mirrors can be URL-returning procedures.
As discussed at <https://issues.guix.gnu.org/47336#16>. * guix/build/download.scm (url-fetch)[disarchive-uris]: Accept MIRROR as a procedure. * guix/download.scm (%disarchive-mirrors): Add comment. This change can only be made once a 'guix perform-download' that understands procedures is widely deployed.
This commit is contained in:
		
							parent
							
								
									67da646087
								
							
						
					
					
						commit
						3cb5ae8577
					
				
					 2 changed files with 16 additions and 9 deletions
				
			
		| 
						 | 
					@ -747,14 +747,19 @@ otherwise simply ignore them."
 | 
				
			||||||
                content-addressed-mirrors))
 | 
					                content-addressed-mirrors))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  (define disarchive-uris
 | 
					  (define disarchive-uris
 | 
				
			||||||
    (append-map (match-lambda
 | 
					    (append-map (lambda (mirror)
 | 
				
			||||||
                  ((? string? mirror)
 | 
					                  (let ((make-url (match mirror
 | 
				
			||||||
 | 
					                                    ((? string?)
 | 
				
			||||||
 | 
					                                     (lambda (hash-algo hash)
 | 
				
			||||||
 | 
					                                       (string-append
 | 
				
			||||||
 | 
					                                        mirror
 | 
				
			||||||
 | 
					                                        (symbol->string hash-algo) "/"
 | 
				
			||||||
 | 
					                                        (bytevector->base16-string hash))))
 | 
				
			||||||
 | 
					                                    ((? procedure?)
 | 
				
			||||||
 | 
					                                     mirror))))
 | 
				
			||||||
                    (map (match-lambda
 | 
					                    (map (match-lambda
 | 
				
			||||||
                           ((hash-algo . hash)
 | 
					                           ((hash-algo . hash)
 | 
				
			||||||
                           (string->uri
 | 
					                            (string->uri (make-url hash-algo hash))))
 | 
				
			||||||
                            (string-append mirror
 | 
					 | 
				
			||||||
                                           (symbol->string hash-algo) "/"
 | 
					 | 
				
			||||||
                                           (bytevector->base16-string hash)))))
 | 
					 | 
				
			||||||
                         hashes)))
 | 
					                         hashes)))
 | 
				
			||||||
                disarchive-mirrors))
 | 
					                disarchive-mirrors))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -400,6 +400,8 @@
 | 
				
			||||||
              (object->string %content-addressed-mirrors)))
 | 
					              (object->string %content-addressed-mirrors)))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(define %disarchive-mirrors
 | 
					(define %disarchive-mirrors
 | 
				
			||||||
 | 
					  ;; TODO: Eventually turn into a procedure that takes a hash algorithm
 | 
				
			||||||
 | 
					  ;; (symbol) and hash (bytevector).
 | 
				
			||||||
  '("https://disarchive.ngyro.com/"))
 | 
					  '("https://disarchive.ngyro.com/"))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(define %disarchive-mirror-file
 | 
					(define %disarchive-mirror-file
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Reference in a new issue