-
Notifications
You must be signed in to change notification settings - Fork 0
/
debian-package.lisp
29 lines (25 loc) · 1.26 KB
/
debian-package.lisp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
(in-package #:qldeb)
;; Bugfix for gzip-stream:gzip-input-stream
(defclass gzip-input-stream (gzip-stream:gzip-input-stream)
((gzip-stream::read-buffer :accessor gzip-stream::read-buffer-of :initform
(flexi-streams:make-in-memory-input-stream
(make-array 0 :element-type '(unsigned-byte 8))))))
(defmacro with-targz-archive (vars &body body)
`(let ((,(first vars) (archive:open-archive
'archive:tar-archive
(gunzipped-stream ,(second vars)))))
(multiple-value-prog1 ,@body
(archive:close-archive ,(first vars)))))
(defun gunzipped-stream (sequence)
(make-instance
'gzip-input-stream
:understream (flexi-streams:make-in-memory-input-stream
(coerce sequence '(vector (unsigned-byte 8))))))
(defun make-debian-package (archive-array system)
(let ((package (with-targz-archive (archive archive-array)
(make-deb-packager archive system)))
(data-files (with-targz-archive (archive archive-array)
(make-data-files archive system))))
(multiple-value-prog1 package
(deb-packager:initialize-control-files package #())
(deb-packager:initialize-data-files package data-files))))