Permalink
Browse files

Use Ironclad and Babel-Streams instead of md5sum and sha1sum.

  • Loading branch information...
1 parent 793a514 commit 0c5e755dd2ff3b2ce653030741b4a43cef5f470c @orivej committed Dec 3, 2012
Showing with 8 additions and 5 deletions.
  1. +1 −1 README.md
  2. +1 −1 quickdist.asd
  3. +6 −3 quickdist.lisp
View
@@ -1,6 +1,6 @@
# Overview
-Quickdist creates and updates Quicklisp distributions from a directory of local projects. It maintains distinfo.txt, releases.txt, systems.txt and source archive - all that is needed for a distribution. Currently it requires external utilities to work: /bin/tar, /usr/bin/md5sum, /usr/bin/sha1sum.
+Quickdist creates and updates Quicklisp distributions from a directory of local projects. It maintains distinfo.txt, releases.txt, systems.txt and source archive - all that is needed for a distribution. Currently it requires /bin/tar to work.
# API
View
@@ -1,7 +1,7 @@
(asdf:defsystem quickdist
:depends-on (alexandria
cl-fad
- external-program
+ external-program babel-streams ironclad
quicklisp
com.informatimago.common-lisp.lisp-reader)
:serial t
View
@@ -54,11 +54,14 @@ system-index-url: {base-url}/{name}/{version}/systems.txt
(subseq s 0 (position #\Space s))))
(defun md5sum (path)
- (external-program-word "/usr/bin/md5sum" (list (princ-to-string path))))
+ (ironclad:byte-array-to-hex-string
+ (ironclad:digest-file :md5 path)))
(defun tar-content-sha1 (path)
- (let ((tar (external-program:start "/bin/tar" (list "-xOf" path) :output :stream)))
- (external-program-word "/usr/bin/sha1sum" nil :input (external-program:process-output-stream tar))))
+ (let ((octets (babel-streams:with-output-to-sequence (buffer)
+ (external-program:run "/bin/tar" (list "-xOf" path) :output buffer))))
+ (ironclad:byte-array-to-hex-string
+ (ironclad:digest-sequence :sha1 octets))))
(defun last-directory (path)
(first (last (pathname-directory path))))

0 comments on commit 0c5e755

Please sign in to comment.