Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added md5sum-checking code to install-aur-package.

  • Loading branch information...
commit ad0c103b5eddd77a497955f75d9808bca0d8dedc 1 parent 1fed781
Brit Butler authored
Showing with 16 additions and 3 deletions.
  1. +16 −3 aur.lisp
19 aur.lisp
View
@@ -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))
Please sign in to comment.
Something went wrong with that request. Please try again.