Skip to content

Commit 1e8ad3f

Browse files
committed
url-to-release is an exhaustive search instead of a heuristic
1 parent 5a501e0 commit 1e8ad3f

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

ql-https.lisp

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,15 @@
5959
(apply #'fetcher url file args)))))
6060

6161
(defun url-to-release (url)
62-
"extracts name of release from URL"
63-
(when (search "/archive/" url)
64-
(let* ((start (+ (search "/archive/" url) (length "/archive/")))
65-
(end (position #\/ url :start start)))
66-
(subseq url start end))))
62+
"obtains name of release from URL"
63+
(let* ((http-url (if (string-equal "https" (subseq url 0 5))
64+
(uiop:strcat "http" (subseq url 5))
65+
url))
66+
(all-releases (ql-dist:provided-releases t))
67+
(release (find http-url all-releases
68+
:test #'string=
69+
:key #'ql-dist:archive-url)))
70+
(ql-dist:project-name release)))
6771

6872
#+sbcl
6973
(defun md5 (file)

0 commit comments

Comments
 (0)