10 SRC_URI
(require pmsf/src-uri) | package: pmsf-src-uri |
10.1 SRC_URI structs
(require pmsf/src-uri/struct) | package: pmsf-src-uri |
struct
(struct psource (uri file-name) #:extra-constructor-name make-psource #:transparent) uri : url? file-name : (or/c #false string?)
> (psource (string->url "https://asd.asd/asd-0.tar") #false)
(psource
(url "https" #f "asd.asd" #f #t (list (path/param "asd-0.tar" '())) '() #f)
#f)
struct
(struct psrc-uri (sources) #:extra-constructor-name make-psrc-uri #:transparent) sources : (listof (or/c pcondition? psource?))
> (psrc-uri (list (psource (string->url "https://asd.asd/asd-0.tar") #false)))
(psrc-uri
(list
(psource
(url "https" #f "asd.asd" #f #t (list (path/param "asd-0.tar" '())) '() #f)
#f)))
10.2 SRC_URI conversion
(require pmsf/src-uri/convert) | package: pmsf-src-uri |
procedure
(psrc-uri->string input-psrc-uri) → string?
input-psrc-uri : psrc-uri?
> (psrc-uri->string (psrc-uri (list (psource (string->url "https://asd.asd/asd-0.tar") #false)))) "https://asd.asd/asd-0.tar"
> (psrc-uri->string (psrc-uri (list (pcondition "amd64" (list (psource (string->url "https://asd.asd/asd-0_x86.tar") "asd-0.tar")))))) "amd64? ( https://asd.asd/asd-0_x86.tar -> asd-0.tar )"
procedure
(port->psrc-uri input-port) → psrc-uri?
input-port : input-port?
procedure
(string->psrc-uri input-string) → psrc-uri?
input-string : string?
> (string->psrc-uri "https://asd.asd/asd-0.tar")
(psrc-uri
(list
(psource
(url "https" #f "asd.asd" #f #t (list (path/param "asd-0.tar" '())) '() #f)
#f)))
> (string->psrc-uri "amd64? ( https://asd.asd/asd-0_x86.tar -> asd-0.tar )")
(psrc-uri
(list
(pcondition
"amd64"
(list
(psource
(url
"https"
#f
"asd.asd"
#f
#t
(list (path/param "asd-0_x86.tar" '()))
'()
#f)
"asd-0.tar")))))
10.3 SRC_URI querying
(require pmsf/src-uri/query) | package: pmsf-src-uri |
procedure
(psrc-uri->sources input-psrc-uri) → (listof psource?)
input-psrc-uri : psrc-uri?
> (psrc-uri->sources (string->psrc-uri (string-append "amd64? ( https://asd.asd/asd-0_x86.tar ) " "arm64? ( https://asd.asd/asd-0_arm64.tar )")))
(list
(psource
(url
"https"
#f
"asd.asd"
#f
#t
(list (path/param "asd-0_x86.tar" '()))
'()
#f)
#f)
(psource
(url
"https"
#f
"asd.asd"
#f
#t
(list (path/param "asd-0_arm64.tar" '()))
'()
#f)
#f))