[PATCH 21.5] Remove PGP from package-get

Steve Youngs steve at sxemacs.org
Sat Aug 18 01:46:01 EDT 2007


diff -r ad09012c3de7 lisp/ChangeLog
--- a/lisp/ChangeLog	Wed Aug 15 23:23:30 2007 +0000
+++ b/lisp/ChangeLog	Sat Aug 18 15:39:25 2007 +1000
@@ -1,3 +1,16 @@ 2007-08-16  Adrian Aichner  <adrian at xema
+2007-08-18  Steve Youngs  <steve at sxemacs.org>
+
+	This changeset removes all of the PGP code from package-get,
+	resolving once and for all the package-index/PGP FAQ.
+	
+	* package-get.el (package-get-pgp-available-p): Removed.
+	(package-get-require-signed-base-updates): Ditto.
+	(package-entries-are-signed): Ditto.
+	(package-get-pgp-signed-begin-line): Ditto.
+	(package-get-pgp-signature-begin-line): Ditto.
+	(package-get-pgp-signature-end-line): Ditto.
+	(package-get-update-base-from-buffer): Remove the PGP nonsense.
+
diff -r ad09012c3de7 lisp/package-get.el
--- a/lisp/package-get.el	Wed Aug 15 23:23:30 2007 +0000
+++ b/lisp/package-get.el	Sat Aug 18 15:28:55 2007 +1000
@@ -410,50 +410,6 @@ Otherwise respect the `force-current' ar
   :type 'boolean
   :group 'package-get)
 
-(defun package-get-pgp-available-p ()
-  "Checks the availability of Mailcrypt and PGP executable.
-
-Returns t if both are found, nil otherwise.  As a side effect, set
-`mc-default-scheme' dependent on the PGP executable found."
-  (let (result)
-    (when (featurep 'mailcrypt-autoloads)
-      (autoload 'mc-setversion "mc-setversion"))
-    (when-fboundp 'mc-setversion
-      (cond ((locate-file "gpg" exec-path
-			  '("" ".btm" ".bat" ".cmd" ".exe" ".com")
-			  'executable)
-	     (mc-setversion "gpg")
-	     (setq result t))
-	    ((locate-file "pgpe" exec-path
-			  '("" ".btm" ".bat" ".cmd" ".exe" ".com")
-			  'executable)
-	     (mc-setversion "5.0")
-	     (setq result t))
-	    ((locate-file "pgp" exec-path
-			  '("" ".btm" ".bat" ".cmd" ".exe" ".com")
-			  'executable)
-	     (mc-setversion "2.6")
-	     (setq result t))))
-    (if result
-	result
-      nil)))
-
-(defcustom package-get-require-signed-base-updates (package-get-pgp-available-p)
-  "*If non-nil, try to verify the package index database via PGP.
-
-If nil, no PGP verification is done.  If the package index database
-entries are not PGP signed and this variable is non-nil, require user
-confirmation to continue with the package-get procedure.
-
-The default for this variable is the return value of
-`package-get-pgp-available-p', non-nil if both the \"Mailcrypt\"
-package and a suitable PGP executable are available, nil otherwise."
-:type 'boolean
-:group 'package-get)
-
-(defvar package-entries-are-signed nil
-  "Non-nil when the package index file has been PGP signed.")
-
 (defvar package-get-continue-update-base nil
   "Non-nil update the index even if it hasn't been signed.")
 
@@ -480,13 +436,6 @@ and remote access is likely in the near 
       (error 'void-variable
 	     "Package-get database not loaded")
     (setq package-get-was-current force-current)))
-
-(defconst package-get-pgp-signed-begin-line "^-----BEGIN PGP SIGNED MESSAGE-----"
-  "Text for start of PGP signed messages.")
-(defconst package-get-pgp-signature-begin-line "^-----BEGIN PGP SIGNATURE-----"
-  "Text for beginning of PGP signature.")
-(defconst package-get-pgp-signature-end-line "^-----END PGP SIGNATURE-----"
-  "Text for end of PGP signature.")
 
 ;;;###autoload
 (defun package-get-update-base-entry (entry)
@@ -615,39 +564,8 @@ used interactively, for example from a m
       (goto-char (point-min))
       (setq content-beg (point))
       (setq content-end (save-excursion (goto-char (point-max)) (point)))
-      (when (re-search-forward package-get-pgp-signed-begin-line nil t)
-        (setq content-beg (match-end 0)))
-      (when (re-search-forward package-get-pgp-signature-begin-line nil t)
-        (setq content-end (match-beginning 0))
-	(setq package-entries-are-signed t))
-      (re-search-forward package-get-pgp-signature-end-line nil t)
-      (setq package-get-continue-update-base t)
-      ;; This is a little overkill because the default value of
-      ;; `package-get-require-signed-base-updates' is the return of
-      ;; `package-get-pgp-available-p', but we have to allow for
-      ;; someone explicitly setting
-      ;; `package-get-require-signed-base-updates' to t. --SY
-      (when (and package-get-require-signed-base-updates
-		 (package-get-pgp-available-p))
-	(if package-entries-are-signed
-	    (let (good-sig)
-	      (setq package-get-continue-update-base nil)
-	      (autoload 'mc-verify "mc-toplev")
-	      (when (declare-fboundp (mc-verify))
-		(setq good-sig t))
-	      (if good-sig
-		  (setq package-get-continue-update-base t)
-		(error 'process-error 
-		       "GnuPG error.  Package database not updated")))
-	  (if (yes-or-no-p
-	       "Package Index is not PGP signed.  Continue anyway? ")
-	      (setq package-get-continue-update-base t)
-	    (setq package-get-continue-update-base nil)
-	    (warn "Package database not updated"))))
-      ;; ToDo: We should call package-get-maybe-save-index on the region
-      (when package-get-continue-update-base
-	(package-get-update-base-entries content-beg content-end)
-	(message "Updated package database")))))
+      (package-get-update-base-entries content-beg content-end)
+      (message "Updated package database"))))
 
 (defun package-get-update-base-entries (start end)
   "Update the package-get database with the entries found between

-- 
|---<Steve Youngs>---------------<GnuPG KeyID: A94B3003>---|
|       SXEmacs - The only _______ you'll ever need.       |
|         Fill in the blank, yes, it's THAT good!          |
|------------------------------------<steve at sxemacs.org>---|
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 312 bytes
Desc: not available
Url : http://lists.xemacs.org/pipermail/xemacs-patches/attachments/20070818/c94d6ce4/attachment.pgp


More information about the XEmacs-Patches mailing list