{ungoogled-,}chromium,chromedriver: 130.0.6723.58 -> 130.0.6723.69 (#351519)
[NixPkgs.git] / pkgs / development / lisp-modules / import / main.lisp
blob2ab754d05a4c63c9a3d17010ef090d33a8bbb19f
1 (defpackage org.lispbuilds.nix/main
2 (:use :common-lisp
3 :org.lispbuilds.nix/database/sqlite
4 :org.lispbuilds.nix/repository/quicklisp
5 :org.lispbuilds.nix/api)
6 (:local-nicknames
7 (:http :dexador)))
9 (in-package org.lispbuilds.nix/main)
11 (defun resource (name type)
12 (make-pathname
13 :defaults (asdf:system-source-directory :org.lispbuilds.nix)
14 :name name
15 :type type))
17 (defvar *sqlite*
18 (make-instance
19 'sqlite-database
20 :init-file (resource "init" "sql")
21 :url "packages.sqlite"))
23 (defvar *quicklisp* nil)
25 (defun get-quicklisp-version ()
26 (let ((response (http:get "http://beta.quicklisp.org/dist/quicklisp.txt")))
27 (subseq
28 (second (uiop:split-string response :separator '(#\Newline)))
29 9)))
31 (defun init-quicklisp ()
32 (setf *quicklisp*
33 (make-instance
34 'quicklisp-repository
35 :dist-url
36 (format nil
37 "https://beta.quicklisp.org/dist/quicklisp/~a/"
38 (get-quicklisp-version)))))
40 (defun run-importers ()
41 (ignore-errors (delete-file "packages.sqlite"))
42 (import-lisp-packages *quicklisp* *sqlite*)
43 (format t "Imported packages from quicklisp to ~A~%"
44 (truename "packages.sqlite")))
46 (defun gen-nix-file ()
47 (database->nix-expression *sqlite* "imported.nix")
48 (format t "Dumped nix file to ~a~%"
49 (truename "imported.nix")))
51 (defun main ()
52 (format t "~%")
53 (init-quicklisp)
54 (run-importers)
55 (gen-nix-file))