Skip to content

Commit

Permalink
Added md5sum-checking code to install-aur-package.
Browse files Browse the repository at this point in the history
  • Loading branch information
kingcons committed Oct 4, 2009
1 parent 1fed781 commit ad0c103
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions aur.lisp
Expand Up @@ -91,9 +91,22 @@

(setf (current-directory) pkg-name)

;; ask user whether he wishes to edit the PKGBUILD
(when (ask-y/n "Review/edit PKGBUILD" t)
(launch-editor "PKGBUILD"))
(flet ((review-pkgbuild () ;; ask user whether he wishes to edit the PKGBUILD
(when (ask-y/n "Review/edit PKGBUILD" t)
(launch-editor "PKGBUILD"))))
;; check to see if the PKGBUILD has been seen before
;; if not, add its md5sum to the checksum-db and ask the user to review it
;; otherwise, compare its md5sum to that on record and prompt the user if necessary
(multiple-value-bind (value present) (gethash pkg-name *checksums*)
(let ((pkgbuild-md5 (sb-md5:md5sum-file "PKGBUILD")))
(if (not present)
(progn
(review-pkgbuild)
(setf (gethash pkg-name *checksums*) pkgbuild-md5))
(unless (equal value pkgbuild-md5)
(when (ask-y/n "The PKGBUILD checksum doesn't match our records. Review the PKGBUILD?")
(launch-editor "PKGBUILD")))))))


(unless (ask-y/n (format nil "Continue building ~S" pkg-name) t)
(return-from install-aur-package))
Expand Down

0 comments on commit ad0c103

Please sign in to comment.