roswell.roswell/lisp/update.ros
SANO,Masatoshi 267ff72edc
Some checks failed
Linux / build (musl64, x86_64, -glibc2.31) (push) Has been cancelled
Linux / build (musl64, x86_64, -musl) (push) Has been cancelled
Linux / build (riscv64, linux/riscv64, musl64, riscv64, ) (push) Has been cancelled
Linux / build (riscv64, linux/riscv64, musl64, riscv64, -glibc2.31) (push) Has been cancelled
Linux / build (riscv64, linux/riscv64, musl64, riscv64, -musl) (push) Has been cancelled
osx / build (sbcl-bin/2.3.8, arm64) (push) Has been cancelled
osx / build (sbcl-bin/2.3.8, x86-64) (push) Has been cancelled
windows / build-windows (i686, i686, 32) (push) Has been cancelled
windows / build-windows (x86_64, amd64, 64) (push) Has been cancelled
windows / build-windows-arm64 (push) Has been cancelled
Linux / build (linux/amd64, deb, deb, x86-64) (push) Has been cancelled
Linux / build (, linux/amd64, musl) (push) Has been cancelled
Linux / build (aarch64, linux/arm64, musl64, arm64, ) (push) Has been cancelled
Linux / build (aarch64, linux/arm64, musl64, arm64, -glibc2.31) (push) Has been cancelled
Linux / build (aarch64, linux/arm64, musl64, arm64, -musl) (push) Has been cancelled
Linux / build (linux/amd64, pandoc, docs, x86-64) (push) Has been cancelled
Linux / build (musl64, x86_64, ) (push) Has been cancelled
fix ros update for github installed system named owner/repo (#578)
2026-07-18 15:11:33 +09:00

59 lines
2.3 KiB
Common Lisp

#!/bin/sh
#|-*- mode:lisp -*-|#
#|Update installed systems.
exec ros -Q -m roswell -N roswell -- $0 "$@"
|#
(progn ;;init forms
(roswell:ensure-asdf)
(roswell:include '("update-git" "update-hg" "update-default")))
(defpackage :ros.script.update.3692404755
(:use :cl :roswell.util))
(in-package :ros.script.update.3692404755)
(defvar *update-functions*
(list (module "update" "git")
(module "update" "hg")
(module "update" "default")))
(defun main (&rest argv)
(if argv
(or
;; security? update for specific version of impl. (future work.Should have it for alisp)
(let ((func (module "update" (first argv))))
(when func (apply func (rest argv)))
func)
;; update systems
(dolist (alias argv)
(loop
with path = (or
(and (find #\/ alias)
(let ((dir (merge-pathnames
(format nil "local-projects/~A/" alias)
(roswell.util:homedir))))
(when (probe-file (merge-pathnames ".git/" dir))
dir)))
(ignore-errors
(make-pathname
:type nil :name nil
:defaults (asdf:system-source-file (asdf:find-system alias)))))
for f in *update-functions*
for r = (and path (funcall f path))
when r do (roswell:roswell `("install" ,alias))
until r
finally (unless r (format *error-output* "no update function for ~A~%" alias)))))
(format *error-output* "~&Usage: ~A update [Method [params ...]]/systems ~%~%Methods:~%~{~A~%~}"
(roswell:opt "argv0")
(let*
((* (directory (make-pathname :defaults *load-pathname*
:name :wild
:type "lisp")))
(* (mapcar #'pathname-name *))
(* (remove-if-not #'(lambda (x)
(ignore-errors (string= x "update-" :end1 7)))
*))
(* (mapcar #'(lambda (x) (subseq x 7)) *)))
*))))
;;; vim: set ft=lisp lisp: