diff --git a/install-repo.sh b/install-repo.sh
index 6c4278b..7566fd6 100755
--- a/install-repo.sh
+++ b/install-repo.sh
@@ -2,14 +2,13 @@
set -e
REPO_DIR=$HOME/common-lisp
-REPO_DIR=/tmp/common-lisp
GITHUB='https://github.com/'
KMX='https://git.kmx.io/'
# detect gnu make
-if which gmake; then
+if which gmake > /dev/null; then
MAKE=gmake
else
MAKE=make
@@ -36,8 +35,8 @@ maybe_clone "${GITHUB}" 'fare' 'asdf'
# Install Repo from Github
maybe_clone "${KMX}" 'kmx.io' 'repo'
-if ! [ -f "${REPO_DIR}/repo.manifest" ]; then
- ( cd "${REPO_DIR}" && ln -s kmx.io/repo/repo.manifest; )
+if ! [ -f "${REPO_DIR}/repo-index.lisp" ]; then
+ ( cd "${REPO_DIR}" && ln -s kmx.io/repo/repo-index.lisp; )
fi
# Configure SBCL
diff --git a/repo-index.lisp b/repo-index.lisp
new file mode 100644
index 0000000..1f39820
--- /dev/null
+++ b/repo-index.lisp
@@ -0,0 +1,197 @@
+;; repo - common interface for version control systems
+;; Copyright 2016-2022 kmx.io <contact@kmx.io>
+;;
+;; Permission is hereby granted to use this software granted
+;; the above copyright notice and this permission paragraph
+;; are included in all copies and substantial portions of this
+;; software.
+;;
+;; THIS SOFTWARE IS PROVIDED "AS-IS" WITHOUT ANY GUARANTEE OF
+;; PURPOSE AND PERFORMANCE. IN NO EVENT WHATSOEVER SHALL THE
+;; AUTHOR BE CONSIDERED LIABLE FOR THE USE AND PERFORMANCE OF
+;; THIS SOFTWARE.
+
+(in-package :repo-user)
+
+(git "http://git.kpe.io/cl-base64.git")
+(git "http://git.kpe.io/puri.git")
+(git "https://gitlab.common-lisp.net/alexandria/alexandria.git")
+(git "https://gitlab.common-lisp.net/cl-irregsexp/cl-irregsexp.git")
+(git "https://gitlab.common-lisp.net/cl-smtp/cl-smtp.git")
+(git "https://gitlab.common-lisp.net/cl-utilities/cl-utilities.git")
+(git "https://gitlab.common-lisp.net/metabang-bind/metabang-bind.git")
+(git "https://gitlab.common-lisp.net/rfc2388/rfc2388.git")
+
+(github "3b" "3bmd")
+(github "AccelerationNet" "cl-inflector")
+(github "BnMcGn" "html-entities")
+(github "KDr2" "cl-fastcgi")
+(github "KDr2" "sb-fastcgi")
+(github "adamczykm" "iterate")
+(github "ahefner" "shuffletron")
+(github "binghe" "portable-threads")
+(github "cffi" "cffi")
+(github "chaitanyagupta" "chronicity")
+(github "cl-babel" "babel")
+(github "cl-plus-ssl" "cl-plus-ssl" :packages '("cl+ssl"))
+(github "cosmos72" "stmx")
+(github "didierverna" "clon")
+(github "didierverna" "declt")
+(github "didierverna" "tfm")
+(github "diogoalexandrefranco" "cl-strings")
+(github "dlowe-net" "local-time")
+(github "drdo" "do-urlencode")
+(github "e-user" "cl-heredoc")
+(github "edicl" "chunga")
+(github "edicl" "cl-fad")
+(github "edicl" "cl-interpol")
+(github "edicl" "cl-ppcre")
+(github "edicl" "cl-unicode")
+(github "edicl" "drakma")
+(github "edicl" "flexi-streams")
+(github "edicl" "hunchentoot")
+(github "eugeneia" "cl-qprint")
+(github "fare" "asdf")
+(github "filonenko-mikhail" "cl-portaudio")
+(github "froydnj" "chipz")
+(github "fukamachi" "fast-http")
+(github "fukamachi" "proc-parse")
+(github "fukamachi" "quri")
+(github "fukamachi" "smart-buffer")
+(github "fukamachi" "trivial-utf-8")
+(github "fukamachi" "xsubseq")
+(github "gwkkwg" "trivial-backtrace")
+(github "hankhero" "cl-json")
+(github "jdz" "rfc2388")
+(github "jech" "cl-yacc")
+(github "keithj" "deoxybyte-unix")
+(github "lmj" "global-vars")
+(github "marijnh" "parse-js")
+(github "melisgl" "named-readtables")
+(github "mishoo" "cl-uglify-js")
+(github "nallen05" "rw-ut")
+(github "nallen05" "trivial-email-utf-8")
+(github "next-browser" "next")
+(github "nightfly19" "cl-arrows")
+(github "nikodemus" "esrap")
+(github "orthecreedence" "blackbird")
+(github "orthecreedence" "cl-async" :packages '("cl-async" "cl-async-repl" "cl-async-ssl"))
+(github "orthecreedence" "cl-libuv")
+(github "orthecreedence" "vom")
+(github "orthecreedence" "wookie")
+(github "pcostanza" "closer-mop")
+(github "phmarek" "yason")
+(github "phoe" "safe-read")
+(github "pmai" "md5")
+(github "robert-strandh" "Acclimation")
+(github "robert-strandh" "Awele")
+(github "robert-strandh" "CLIM-demo-adventure")
+(github "robert-strandh" "CLIMatis")
+(github "robert-strandh" "Claire")
+(github "robert-strandh" "Claret")
+(github "robert-strandh" "Classeur")
+(github "robert-strandh" "Climacs")
+(github "robert-strandh" "Climed")
+(github "robert-strandh" "Cloak")
+(github "robert-strandh" "Clobber")
+(github "robert-strandh" "Clordane")
+(github "robert-strandh" "Cluffer-Emacs-compatibility")
+(github "robert-strandh" "Clump")
+(github "robert-strandh" "Cluster")
+(github "robert-strandh" "Compta")
+(github "robert-strandh" "Concrete-Syntax-Tree")
+(github "robert-strandh" "Ducling")
+(github "robert-strandh" "Eclector")
+(github "robert-strandh" "Enamel")
+(github "robert-strandh" "First-Climacs")
+(github "robert-strandh" "Flexichain")
+(github "robert-strandh" "GF-font-viewer")
+(github "robert-strandh" "Gsharp")
+(github "robert-strandh" "Incremental-reader")
+(github "robert-strandh" "McCLIM")
+(github "robert-strandh" "Nomenclatura")
+(github "robert-strandh" "SICL")
+(github "robert-strandh" "Second-Climacs")
+(github "robert-strandh" "Spell")
+(github "robert-strandh" "Stealth-mixin")
+(github "robert-strandh" "Subsequence")
+(github "robert-strandh" "Sudoku")
+(github "robert-strandh" "Text-annotation")
+(github "robert-strandh" "Trans-Clime")
+(github "robert-strandh" "USE-finder")
+(github "robert-strandh" "dpANS-parser")
+(github "rpav" "c2ffi")
+(github "rpav" "cl-autowrap")
+(github "rpav" "fast-io")
+(github "sellout" "external-program")
+(github "sharplispers" "ironclad")
+(github "sharplispers" "nibbles")
+(github "sharplispers" "parse-number")
+(github "sharplispers" "split-sequence")
+(github "sionescu" "bordeaux-threads")
+(github "sionescu" "static-vectors")
+(github "slime" "slime")
+(github "thephoeron" "let-over-lambda")
+(github "tpapp" "ffa")
+(github "trivial-features" "trivial-features")
+(github "trivial-garbage" "trivial-garbage")
+(github "trivial-gray-streams" "trivial-gray-streams")
+(github "usocket" "usocket")
+(github "vii" "teepeedee2")
+(github "vseloved" "cl-redis")
+(github "vseloved" "rutils")
+(github "zkat" "chanl")
+
+(kmx "RailsOnLisp" "bootstrap")
+(kmx "RailsOnLisp" "bordeaux-queue")
+(kmx "RailsOnLisp" "bordeaux-set")
+(kmx "RailsOnLisp" "can")
+(kmx "RailsOnLisp" "font-awesome")
+(kmx "RailsOnLisp" "gravatar")
+(kmx "RailsOnLisp" "rol-assets")
+(kmx "RailsOnLisp" "rol-files")
+(kmx "RailsOnLisp" "rol-log")
+(kmx "RailsOnLisp" "rol-server")
+(kmx "RailsOnLisp" "rol-template")
+(kmx "RailsOnLisp" "rol-uri")
+(kmx "RailsOnLisp" "thot")
+(kmx "cffi-posix" "cffi-dirent")
+(kmx "cffi-posix" "cffi-epoll")
+(kmx "cffi-posix" "cffi-errno")
+(kmx "cffi-posix" "cffi-fcntl")
+(kmx "cffi-posix" "cffi-socket")
+(kmx "cffi-posix" "cffi-stat")
+(kmx "cffi-posix" "cffi-unistd")
+(kmx "cl-remap" "remap")
+(kmx "cl-remap" "uiop-remap")
+(kmx "cl-remap" "unistd-remap")
+(kmx "cl-stream" "babel-stream")
+(kmx "cl-stream" "cl-stream")
+(kmx "cl-stream" "matcher-stream")
+(kmx "cl-stream" "parser-stream")
+(kmx "cl-stream" "token-stream")
+(kmx "cl-stream" "unistd-stdio")
+(kmx "cl-stream" "unistd-stream")
+(kmx "facts-db" "cl-facts")
+(kmx "facts-db" "cl-lessp")
+(kmx "facts-db" "cl-rollback")
+(kmx "idl" "excel-fun.git")
+(kmx "idl" "idl-calc.git")
+(kmx "kmx.io" "cl-debug")
+(kmx "kmx.io" "repo")
+(kmx "lowh" "exec-js")
+(kmx "thodg" "cffi-portaudio")
+(kmx "thodg" "cfg")
+(kmx "thodg" "cl-github-v3")
+(kmx "thodg" "cl-github-v3")
+(kmx "thodg" "cl-unix-cybernetics")
+(kmx "thodg" "css-lexer")
+(kmx "thodg" "css-parser")
+(kmx "thodg" "fb")
+(kmx "thodg" "less-lexer")
+(kmx "thodg" "less-parser")
+(kmx "thodg" "positional")
+(kmx "thodg" "random-sequence")
+(kmx "thodg" "re.git")
+(kmx "thodg" "str")
+(kmx "thodg" "str.git")
diff --git a/repo.lisp b/repo.lisp
index 91f42ea..f11f3b6 100644
--- a/repo.lisp
+++ b/repo.lisp
@@ -23,12 +23,11 @@
#:github
#:install
#:kmx
- #:manifest
- #:*manifest*
+ #:index
+ #:*index*
#:repo
#:*repo-dir*
#:*repos*
- #:svn
#:update))
(defpackage :repo-user
@@ -423,60 +422,6 @@
(push repo *repos*)
repo))))
-
-;; subversion command
-
-(defvar *svn*
- #+unix (or (probe-file "/usr/bin/svn")
- (probe-file "/usr/local/bin/svn")
- (first-line (ignore-errors (sh "which svn")))))
-
-(defun $svn (&rest args)
- (apply 'run-program *svn* args))
-
-;; subversion repository class
-
-(defclass svn-repo (repo) ())
-
-(defgeneric $svn-checkout (repo))
-(defgeneric $svn-update (repo))
-
-(defmethod $svn-checkout ((repo svn-repo))
- (let ((local (repo-local-dir repo))
- (url (repo-url repo)))
- (when (probe-dir local)
- (error "svn checkout: not overwriting existing local directory~&~S" local))
- (let ((parent (dirname local)))
- (ensure-directories-exist (str parent "/") :verbose t)
- ($svn "co" url (translate-home local))
- nil)))
-
-(defmethod $svn-update ((repo svn-repo))
- (let ((local (repo-local-dir repo)))
- ($svn "up" (translate-home local))
- nil))
-
-(defmethod install ((repo svn-repo))
- (let ((local (repo-local-dir repo)))
- (unless (probe-dir local)
- ($svn-checkout repo))
- (asdf::load-asd (repo-asd repo))))
-
-(defmethod update ((repo svn-repo))
- (when (probe-dir (repo-local-dir repo))
- ($svn-update repo)))
-
-(defun svn (url dir/name &rest initargs)
- (or (repo-by-url url)
- (let ((repo (apply #'make-instance 'svn-repo
- :dir (dirname dir/name)
- :name (basename dir/name)
- :url url :uri url
- :head (basename url)
- initargs)))
- (push repo *repos*)
- repo)))
-
;; repo uri handler
(defparameter *repo-uri-handlers*
@@ -542,140 +487,140 @@
(defmethod update ((repos cons))
(map nil 'update repos))
-;; manifest
+;; index
-(defvar *manifest*)
+(defvar *index*)
-(defclass manifest ()
+(defclass index ()
((write-date :initarg :write-date
- :accessor manifest-write-date
+ :accessor index-write-date
:type rational)
(dir :initarg :dir
- :reader manifest-dir
+ :reader index-dir
:type string)
(repos :initarg :repos
- :accessor manifest-repos
+ :accessor index-repos
:type list)))
-(defgeneric manifest-file (manifest))
-(defgeneric reload-manifest (manifest))
-(defgeneric maybe-reload-manifest (manifest))
+(defgeneric index-file (index))
+(defgeneric reload-index (index))
+(defgeneric maybe-reload-index (index))
-(defmethod print-object ((obj manifest) stream)
+(defmethod print-object ((obj index) stream)
(print-unreadable-object (obj stream :type t :identity t)
(format stream "~S ~A repos"
- (manifest-file obj)
- (length (manifest-repos obj)))))
+ (index-file obj)
+ (length (index-repos obj)))))
-(defmethod manifest-file ((manifest manifest))
- (str (manifest-dir manifest) "/repo.manifest"))
+(defmethod index-file ((index index))
+ (str (index-dir index) "/repo-index.lisp"))
-(defun manifest-from-file (pathname)
+(defun index-from-file (pathname)
(let ((*repos* nil)
(write-date (file-write-date pathname)))
(load pathname)
- (make-instance 'manifest
+ (make-instance 'index
:write-date write-date
:dir (dirname pathname)
:repos *repos*)))
-(defmethod reload-manifest ((manifest manifest))
- (let* ((pathname (manifest-file manifest))
+(defmethod reload-index ((index index))
+ (let* ((pathname (index-file index))
(*repos* nil)
(write-date (file-write-date pathname)))
(load pathname)
- (setf (manifest-write-date manifest) write-date
- (manifest-repos manifest) *repos*))
- manifest)
-
-(defmethod maybe-reload-manifest ((manifest manifest))
- (if (< (manifest-write-date manifest)
- (file-write-date (manifest-file manifest)))
- (reload-manifest manifest)
- manifest))
-
-(defmethod install ((manifest manifest))
- (let ((manifest (maybe-reload-manifest manifest)))
- (let ((*repo-dir* (manifest-dir manifest))
- (*repos* (manifest-repos manifest)))
+ (setf (index-write-date index) write-date
+ (index-repos index) *repos*))
+ index)
+
+(defmethod maybe-reload-index ((index index))
+ (if (< (index-write-date index)
+ (file-write-date (index-file index)))
+ (reload-index index)
+ index))
+
+(defmethod install ((index index))
+ (let ((index (maybe-reload-index index)))
+ (let ((*repo-dir* (index-dir index))
+ (*repos* (index-repos index)))
(install *repos*))))
-(defmethod update ((manifest manifest))
- (let ((manifest (maybe-reload-manifest manifest)))
- (let ((*repo-dir* (manifest-dir manifest))
- (*repos* (manifest-repos manifest)))
+(defmethod update ((index index))
+ (let ((index (maybe-reload-index index)))
+ (let ((*repo-dir* (index-dir index))
+ (*repos* (index-repos index)))
(update *repos*))))
-;; manifest uri handlers
+;; index uri handlers
-(defun manifest-file-p (x)
- (or (string= "repo.manifest" x)
- (string-ends-with "/repo.manifest" x)))
+(defun index-file-p (x)
+ (or (string= "repo-index.lisp" x)
+ (string-ends-with "/repo-index.lisp" x)))
-(defun local-manifest-uri-handler (x)
- (let ((end (string-ends-with "/repo.manifest" x)))
+(defun local-index-uri-handler (x)
+ (let ((end (string-ends-with "/repo-index.lisp" x)))
(when end
(let* ((*repo-dir* (subseq x 0 end))
- (manifest (str *repo-dir* "/repo.manifest")))
- (when (probe-file manifest)
- (manifest-from-file manifest))))))
+ (index (str *repo-dir* "/repo-index.lisp")))
+ (when (probe-file index)
+ (index-from-file index))))))
-(defvar *manifest-uri-handlers*
- '(local-manifest-uri-handler))
+(defvar *index-uri-handlers*
+ '(local-index-uri-handler))
-(defun manifest (uri)
- "Load manifest from uri"
+(defun index (uri)
+ "Load index from uri"
(labels ((do-handlers (handlers)
(unless (endp handlers)
(or (funcall (first handlers) uri)
(do-handlers (rest handlers))))))
- (do-handlers *manifest-uri-handlers*)))
+ (do-handlers *index-uri-handlers*)))
-(defun manifest-or-die (uri)
- (or (manifest uri) (error "failed to load manifest ~S" uri)))
+(defun index-or-die (uri)
+ (or (index uri) (error "failed to load index ~S" uri)))
;; install and update commands
(defmethod install ((x string))
- (when *manifest*
- (maybe-reload-manifest *manifest*))
- (setq *repos* (manifest-repos *manifest*))
- (if (manifest-file-p x)
- (install (manifest-or-die x))
+ (when *index*
+ (maybe-reload-index *index*))
+ (setq *repos* (index-repos *index*))
+ (if (index-file-p x)
+ (install (index-or-die x))
(install (repo-or-die x))))
(defmethod install ((x null))
nil)
(defmethod install ((x symbol))
- (when *manifest*
- (maybe-reload-manifest *manifest*))
- (setq *repos* (manifest-repos *manifest*))
+ (when *index*
+ (maybe-reload-index *index*))
+ (setq *repos* (index-repos *index*))
(install (repo-or-die x)))
(defmethod update ((x string))
- (when *manifest*
- (maybe-reload-manifest *manifest*))
- (setq *repos* (manifest-repos *manifest*))
- (if (manifest-file-p x)
- (update (manifest-or-die x))
+ (when *index*
+ (maybe-reload-index *index*))
+ (setq *repos* (index-repos *index*))
+ (if (index-file-p x)
+ (update (index-or-die x))
(update (repo-or-die x))))
(defmethod update ((x null))
nil)
(defmethod update ((x symbol))
- (when *manifest*
- (maybe-reload-manifest *manifest*))
- (setq *repos* (manifest-repos *manifest*))
+ (when *index*
+ (maybe-reload-index *index*))
+ (setq *repos* (index-repos *index*))
(update (repo-or-die x)))
;; system-definition
(defun sysdef (x)
- (when *manifest*
- (maybe-reload-manifest *manifest*))
- (setq *repos* (manifest-repos *manifest*))
+ (when *index*
+ (maybe-reload-index *index*))
+ (setq *repos* (index-repos *index*))
(let ((repo (or (find-repo-by-package x)
(repo x))))
(when repo
@@ -685,9 +630,9 @@
;; setup
(defun boot ()
- (let ((manifest-file (str *repo-dir* "/repo.manifest")))
- (when (probe-file manifest-file)
- (setq *manifest* (manifest manifest-file))
- (setq *repos* (manifest-repos *manifest*))
+ (let ((index-file (str *repo-dir* "/repo-index.lisp")))
+ (when (probe-file index-file)
+ (setq *index* (index index-file))
+ (setq *repos* (index-repos *index*))
(when (find-package :asdf)
(pushnew 'sysdef asdf:*system-definition-search-functions*)))))