Coverage report: /home/ellis/comp/core/app/packy/proto.lisp
Kind | Covered | All | % |
expression | 0 | 60 | 0.0 |
branch | 0 | 4 | 0.0 |
Key
Not instrumented
Conditionalized out
Executed
Not executed
Both branches taken
One branch taken
Neither branch taken
1
;;; proto.lisp --- Packy Protocol
8
(define-condition packy-condition () ())
9
(deferror packy-error (simple-error packy-condition) () (:auto t))
11
(defclass package-id (id)
12
((id :initform (make-array 16 :element-type 'octet) :initarg :id :type (octet-vector 16) :accessor id)))
14
(defmethod make-id ((kind (eql :package)))
15
(make-instance 'package-id))
17
(defmethod make-random-id ((kind (eql :package)))
19
(dotimes (i 16) (push (random 255) l))
20
(let ((v (make-array 16 :element-type 'octet
21
:initial-contents l)))
22
(make-instance 'package-id :id v))))
24
(defmethod print-object ((self package-id) stream)
25
(print-unreadable-object (self stream)
26
(format stream "~A" (octet-vector-to-hex-string (id self)))))
28
(defclass package-stream (pack io-stream) ())
30
(defclass compressed-package (package-stream decompressing-stream) ())
32
(defclass file-package (package-stream file-stream) ())
34
(defclass directory-package (package-stream)
35
((directory :initarg :directory :accessor dir)))
37
(defun packed-path-p (path)
38
"Return non-nil if PATH is a ZSTD compressed file or otherwise complete
40
(and (probe-file path) (equal "zst" (pathname-type path))))
42
(defgeneric pack (self &key &allow-other-keys)
43
(:method ((self pathname) &key)
44
(when (packed-path-p self)
45
(packy-error "Package is already compressed: ~A" self))))
47
(defgeneric unpack (self &key &allow-other-keys))
48
(defgeneric install-package (self &key &allow-other-keys))
49
(defgeneric uninstall-package (self &key &allow-other-keys))
50
(defgeneric update-package (self &key &allow-other-keys))
51
(defgeneric push-package (self &key &allow-other-keys))
52
(defgeneric pull-package (self &key &allow-other-keys))
53
(defgeneric query-package (self &key &allow-other-keys))
54
(defgeneric sync-package (self &key &allow-other-keys))
55
(defgeneric build-package (self &key &allow-other-keys))
56
(defgeneric prepare-package (self &key &allow-other-keys))
57
(defgeneric check-package (self &key &allow-other-keys))
58
(defgeneric package-version (self &key &allow-other-keys))