[gnus git] branch master updated: =2= Add an in-memory netrc cache (for now) to make ~/.authinfo.gpg files usable. ; Comment fix.

Lars Ingebrigtsen <[email protected]>
Newsgroups gmane.emacs.gnus.cvs
Message-ID <[email protected]>
       via  cf58cf0756669ae18adb68155540bf5cf3f437a4 (commit)
       via  01eb21e0a647ed82272f9528e90a67ee88846ee4 (commit)
      from  2addde39f256cab9ae5788b6c299f50f9bbc929b (commit)


- Log -----------------------------------------------------------------
commit cf58cf0756669ae18adb68155540bf5cf3f437a4
Author: Lars Ingebrigtsen <[email protected]>
Date:   Sun Feb 20 17:34:09 2011 -0800

    Add an in-memory netrc cache (for now) to make ~/.authinfo.gpg files usable.

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 616ed34..16e1fa3 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,8 @@
 2011-02-21  Lars Ingebrigtsen  <[email protected]>
 
+	* auth-source.el (auth-source-netrc-parse): Add an in-memory netrc
+	cache (for now) to make ~/.authinfo.gpg files usable.
+
 	* nnfolder.el (copyright-update): Define for the compiler.
 
 	* auth-source.el (auth-source-search): Fix unbound variable.
diff --git a/lisp/auth-source.el b/lisp/auth-source.el
index eaed8e8..3fe31b5 100644
--- a/lisp/auth-source.el
+++ b/lisp/auth-source.el
@@ -690,6 +690,8 @@ while \(:host t) would find all host entries."
 
 ;;; Backend specific parsing: netrc/authinfo backend
 
+(defvar auth-source-netrc-cache nil)
+
 ;;; (auth-source-netrc-parse "~/.authinfo.gpg")
 (defun* auth-source-netrc-parse (&rest
                                  spec
@@ -708,7 +710,19 @@ Note that the MAX parameter is used so we can exit the parse early."
               (max (or max 5000))       ; sanity check: default to stop at 5K
               (modified 0)
               alist elem result pair)
+	  (if (and auth-source-netrc-cache
+		   (equal (car auth-source-netrc-cache)
+			  (nth 5 (file-attributes file))))
+	      (insert (base64-decode-string
+		       (rot13-string (cdr auth-source-netrc-cache))))
           (insert-file-contents file)
+	    (when (string-match "\\.gpg\\'" file)
+	      ;; Store the contents of the file heavily encrypted in memory.
+	      (setq auth-source-netrc-cache
+		    (cons (nth 5 (file-attributes file))
+			  (rot13-string
+			   (base64-encode-string
+			    (buffer-string)))))))
           (goto-char (point-min))
           ;; Go through the file, line by line.
           (while (and (not (eobp))

commit 01eb21e0a647ed82272f9528e90a67ee88846ee4
Author: Lars Ingebrigtsen <[email protected]>
Date:   Sun Feb 20 17:26:11 2011 -0800

    Comment fix.

diff --git a/lisp/netrc.el b/lisp/netrc.el
index 59e9eab..b04863b 100644
--- a/lisp/netrc.el
+++ b/lisp/netrc.el
@@ -63,10 +63,10 @@
 	      alist elem result pair)
           (if (and netrc-cache
 		   (equal (car netrc-cache) (nth 5 (file-attributes file))))
-	      ;; Store the contents of the file heavily encrypted in memory.
 	      (insert (base64-decode-string (rot13-string (cdr netrc-cache))))
 	    (insert-file-contents file)
 	    (when (string-match "\\.gpg\\'" file)
+	      ;; Store the contents of the file heavily encrypted in memory.
 	      (setq netrc-cache (cons (nth 5 (file-attributes file))
 				      (rot13-string
 				       (base64-encode-string

-----------------------------------------------------------------------
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we listed those
revisions in full, above.

Summary of changes:
 lisp/ChangeLog      |    3 +++
 lisp/auth-source.el |   16 +++++++++++++++-
 lisp/netrc.el       |    2 +-
 3 files changed, 19 insertions(+), 2 deletions(-)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnus Project".

The branch, master has been updated


hooks/post-receive
-- 
Gnus Project
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.