From 0dc93f41c87256a1bab12975e98ebbe2f9426ffa Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Sun, 16 May 2021 14:55:15 -0700 Subject: use UIOP rather than dpkg(1) to compare prerequisite data versions For both performance and portability reasons. Signed-off-by: Sean Whitton --- src/util.lisp | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) (limited to 'src/util.lisp') diff --git a/src/util.lisp b/src/util.lisp index cbc21c2..60653da 100644 --- a/src/util.lisp +++ b/src/util.lisp @@ -249,28 +249,20 @@ previous output." ;;;; Version numbers +(defun number->string (x) + (etypecase x (string x) (number (format nil "~D" x)))) + (defun version< (x y) - (dpkg-version-compare x "<<" y)) + (uiop:version< (number->string x) (number->string y))) (defun version> (x y) - (dpkg-version-compare x ">>" y)) + (version< y x)) (defun version<= (x y) - (dpkg-version-compare x "<=" y)) + (uiop:version<= (number->string x) (number->string y))) (defun version>= (x y) - (dpkg-version-compare x ">=" y)) - -(defun dpkg-version-compare (x r y) - (zerop (nth-value 2 (run-program `("dpkg" "--compare-versions" - ,(etypecase x - (string x) - (number (format nil "~A" x))) - ,r - ,(etypecase y - (string y) - (number (format nil "~A" y)))) - :ignore-error-status t)))) + (version<= y x)) ;;;; Encoding of strings to filenames -- cgit v1.2.3