[SCM] vim-scripts packaging branch, master, updated. v20091011-30-gc476b42

James Vega jamessan at debian.org
Sun Aug 14 03:27:08 UTC 2011


The following commit has been merged in the master branch:
commit c86426dd2d24a9032f5650743a3b4df8217f68ed
Author: James Vega <jamessan at debian.org>
Date:   Sat Aug 13 22:44:32 2011 -0400

    Update gnupg.vim to 2.2
    
    Signed-off-by: James Vega <jamessan at debian.org>

diff --git a/debian/changelog b/debian/changelog
index 9308b27..dacd644 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -9,7 +9,7 @@ vim-scripts (20091012) UNRELEASED; urgency=low
     - vcscommand: Update to 1.99.35
     - calendar: Update to 2.5
     - bufexplorer: Update to 7.2.8
-    - gnupg: Update to 2.0
+    - gnupg: Update to 2.2
       + Fixes a bug when the user's shell is (t)csh and /bin/sh is dash.
         (Closes: #552085)
       + Do not prompt the user when the same key exists in multiple keyrings.
@@ -17,6 +17,7 @@ vim-scripts (20091012) UNRELEASED; urgency=low
       + Improve error handling when gpg command fails to prevent file
         truncation.  (Closes: #573440)
       + Use --armor when saving a new *.asc file.  (Closes: #496667)
+      + Handle the different settings for keyid-format. (Closes: #637718)
     - surround: Update to 1.90
     - NERD_commenter: Update to 2.3.0
     - xmledit: Update to 1.9.1
diff --git a/debian/vim-scripts.status b/debian/vim-scripts.status
index 654b0c1..36b42ee 100644
--- a/debian/vim-scripts.status
+++ b/debian/vim-scripts.status
@@ -69,7 +69,7 @@ author_url:  http://www.vim.org/account/profile.php?user_id=5603
 email:       vega.james at gmail.com
 license:     GNU GPL, see /usr/share/common-licenses/GPL-2
 disabledby:  let loaded_gnupg = 1
-version:     2.0
+version:     2.2
 
 script_name: plugin/taglist.vim
 addon:       taglist
diff --git a/html/index.html b/html/index.html
index 43b2c84..01ae7bb 100644
--- a/html/index.html
+++ b/html/index.html
@@ -49,7 +49,7 @@
    <li><a href="syntax_CVSAnnotate.vim.html">syntax/CVSAnnotate.vim.html</a></li>
   </ul>
   <p>
-  Page generated on Mon, 18 Jul 2011 22:40:17 -0400
+  Page generated on Sat, 13 Aug 2011 22:43:04 -0400
 .
   </p>
  </body>
diff --git a/html/plugin_gnupg.vim.html b/html/plugin_gnupg.vim.html
index ae11f82..2da5f33 100644
--- a/html/plugin_gnupg.vim.html
+++ b/html/plugin_gnupg.vim.html
@@ -135,6 +135,8 @@
             <td class="sidebarheader"><a href="/huh.php">Site Help</a></td>
         </tr>
 </table>
+<br>
+<g:plusone></g:plusone>
 
             <table width="172" cellpadding="0" cellspacing="0" border="0">
               <tr><td><img src="/images/spacer.gif" alt="" border="0" width="1" height="8"></td></tr>
@@ -166,8 +168,10 @@
 <tr>
   <td class="lightbg"><b> script karma </b></td>
   <td>
-    Rating <b>0/0</b>,
-    Downloaded by 0  </td>
+    Rating <b>9/3</b>,
+    Downloaded by 188     
+    <g:plusone></g:plusone>
+  </td>
   <td class="lightbg">
   <b> Comments, bugs, improvements </b>
   </td>
@@ -186,7 +190,7 @@
 <tr><td>utility</td></tr>
 <tr><td> </td></tr>
 <tr><td class="prompt">description</td></tr>
-<tr><td>This script implements transparent editing of gpg encrypted files. The filename must have a ".gpg", ".pgp" or ".asc" suffix. When opening such a file the content is decrypted, when opening a new file the script will ask for the recipients of the encrypted file. The file content will be encrypted to all recipients before it is written. The script turns off viminfo and swapfile to increase security.
<br>
<br>This is a continuation of the work initially done by Markus Braun in <a href="/scripts/script.php?script_id=661">vimscript #661</a>.  Development takes place at <a target="_blank" href="http://gitorious.org/vim-gnupg">http://gitorious.org/vim-gnupg</A>.
<br>
<br>Commands: 
<br>
<br>  :GPGEditRecipients 
<br>    Opens a scratch buffer to change the list of recipients. Recipients that 
<br>    are unknown (not in your public key) are highlighted and have 
<br>    a prepended "!". Closing the buffer makes the changes permanent. 
<br>
<br>  :GPGViewRecipients 
<br>    Prints the list of recipients. 
<br>
<br>  :GPGEditOptions 
<br>    Opens a scratch buffer to change the options for encryption (symmetric, 
<br>    asymmetric, signing). Closing the buffer makes the changes permanent. 
<br>    WARNING: There is no check of the entered options, so you need to know 
<br>    what you are doing. 
<br>
<br>  :GPGViewOptions 
<br>    Prints the list of options. 
<br>
<br>Variables: 
<br>
<br>  g:GPGExecutable 
<br>    If set used as gpg executable, otherwise the system chooses what is run 
<br>    when "gpg" is called. Defaults to "gpg". 
<br>
<br>  g:GPGUseAgent 
<br>    If set to 0 a possible available gpg-agent won't be used. Defaults to 1. 
<br>
<br>  g:GPGPreferSymmetric 
<br>    If set to 1 symmetric encryption is preferred for new files. Defaults to 0. 
<br>
<br>  g:GPGPreferArmor 
<br>    If set to 1 armored data is preferred for new files. Defaults to 0. 
<br>
<br>  g:GPGPreferSign 
<br>    If set to 1 signed data is preferred for new files. Defaults to 0. 
<br>
<br>  g:GPGDefaultRecipients 
<br>    If set, these recipients are used as defaults when no other recipient is 
<br>    defined. This variable is a Vim list. Default is unset. 
<br>
<br>Known Issues: 
<br>
<br>  In some cases gvim can't decryt files 
<br>
<br>  This is caused by the fact that a running gvim has no TTY and thus gpg is 
<br>  not able to ask for the passphrase by itself. This is a problem for Windows 
<br>  and Linux versions of gvim and could not be solved unless a "terminal 
<br>  emulation" is implemented for gvim. To circumvent this you have to use any 
<br>  combination of gpg-agent and a graphical pinentry program: 
<br>
<br>    - gpg-agent only: 
<br>        you need to provide the passphrase for the needed key to gpg-agent 
<br>        in a terminal before you open files with gvim which require this key. 
<br>
<br>    - pinentry only: 
<br>        you will get a popup window every time you open a file that needs to 
<br>        be decrypted. 
<br>
<br>    - gpgagent and pinentry: 
<br>        you will get a popup window the first time you open a file that 
<br>        needs to be decrypted. </td></tr>
+<tr><td>This script implements transparent editing of gpg encrypted files. The filename must have a ".gpg", ".pgp" or ".asc" suffix. When opening such a file the content is decrypted, when opening a new file the script will ask for the recipients of the encrypted file. The file content will be encrypted to all recipients before it is written. The script turns off viminfo and swapfile to increase security.
<br>
<br>This is a continuation of the work initially done by Markus Braun in <a href="/scripts/script.php?script_id=661">vimscript #661</a>.  Development takes place at <a target="_blank" href="http://gitorious.org/vim-gnupg">http://gitorious.org/vim-gnupg</A>.
<br>
<br>Commands: 
<br>
<br>  :GPGEditRecipients 
<br>    Opens a scratch buffer to change the list of recipients. Recipients that 
<br>    are unknown (not in your public key) are highlighted and have 
<br>    a prepended "!". Closing the buffer makes the changes permanent. 
<br>
<br>  :GPGViewRecipients 
<br>    Prints the list of recipients. 
<br>
<br>  :GPGEditOptions 
<br>    Opens a scratch buffer to change the options for encryption (symmetric, 
<br>    asymmetric, signing). Closing the buffer makes the changes permanent. 
<br>    WARNING: There is no check of the entered options, so you need to know 
<br>    what you are doing. 
<br>
<br>  :GPGViewOptions 
<br>    Prints the list of options. 
<br>
<br>Variables: 
<br>
<br>  g:GPGExecutable 
<br>    If set used as gpg executable, otherwise the system chooses what is run 
<br>    when "gpg" is called. Defaults to "gpg". 
<br>
<br>  g:GPGUseAgent 
<br>    If set to 0 a possible available gpg-agent won't be used. Defaults to 1. 
<br>
<br>  g:GPGPreferSymmetric 
<br>    If set to 1 symmetric encryption is preferred for new files. Defaults to 0. 
<br>
<br>  g:GPGPreferArmor 
<br>    If set to 1 armored data is preferred for new files. Defaults to 0. 
<br>
<br>  g:GPGPreferSign 
<br>    If set to 1 signed data is preferred for new files. Defaults to 0. 
<br>
<br>  g:GPGDefaultRecipients 
<br>    If set, these recipients are used as defaults when no other recipient is 
<br>    defined. This variable is a Vim list. Default is unset. 
<br>
<br>  g:GPGUsePipes
<br>    If set to 1, use pipes instead of temporary files when interacting with
<br>    gnupg.  When set to 1, this can cause terminal-based gpg agents to not
<br>    display correctly when prompting for passwords.  Defaults to 0.
<br>
<br>Known Issues: 
<br>
<br>  In some cases gvim can't decrypt files 
<br>
<br>  This is caused by the fact that a running gvim has no TTY and thus gpg is 
<br>  not able to ask for the passphrase by itself. This is a problem for Windows 
<br>  and Linux versions of gvim and could not be solved unless a "terminal 
<br>  emulation" is implemented for gvim. To circumvent this you have to use any 
<br>  combination of gpg-agent and a graphical pinentry program: 
<br>
<br>    - gpg-agent only: 
<br>        you need to provide the passphrase for the needed key to gpg-agent 
<br>        in a terminal before you open files with gvim which require this key. 
<br>
<br>    - pinentry only: 
<br>        you will get a popup window every time you open a file that needs to 
<br>        be decrypted. 
<br>
<br>    - gpgagent and pinentry: 
<br>        you will get a popup window the first time you open a file that 
<br>        needs to be decrypted. </td></tr>
 <tr><td> </td></tr>
 <tr><td class="prompt">install details</td></tr>
 <tr><td>Copy the gnupg.vim file to the $HOME/.vim/plugin directory. Refer to ':help add-plugin', ':help add-global-plugin' and ':help runtimepath' for more details about Vim plugins. 
<br>
<br>From "man 1 gpg-agent": 
<br>... 
<br>You should always add the following lines to your .bashrc or whatever initialization file is used for all shell invocations: 
<br>
<br>     GPG_TTY=`tty` 
<br>     export GPG_TTY 
<br>
<br>It is important that this environment variable always reflects the output of the tty command. For W32 systems this option is not required. 
<br>... 
<br>
<br>Most distributions provide software to ease handling of gpg and gpg-agent. Examples are keychain or seahorse.</td></tr>
@@ -223,6 +227,22 @@ Click on the package to download.
     <th valign="top">release notes</th>
 </tr>
 <tr>
+        <td class="rowodd" valign="top" nowrap><a href="download_script.php?src_id=16256">gnupg.vim</a></td>
+    <td class="rowodd" valign="top" nowrap><b>2.2</b></td>
+    <td class="rowodd" valign="top" nowrap><i>2011-08-13</i></td>
+    <td class="rowodd" valign="top" nowrap>7.0</td>
+    <td class="rowodd" valign="top"><i><a href="/account/profile.php?user_id=5603">James Vega</a></i></td>
+    <td class="rowodd" valign="top" width="2000">Correctly handle the different keyid-format options</td>
+</tr>
+<tr>
+        <td class="roweven" valign="top" nowrap><a href="download_script.php?src_id=16225">gnupg.vim</a></td>
+    <td class="roweven" valign="top" nowrap><b>2.1</b></td>
+    <td class="roweven" valign="top" nowrap><i>2011-08-10</i></td>
+    <td class="roweven" valign="top" nowrap>7.2</td>
+    <td class="roweven" valign="top"><i><a href="/account/profile.php?user_id=5603">James Vega</a></i></td>
+    <td class="roweven" valign="top" width="2000">Add g:GPGUsePipes variable to avoid saving unencrypted data to tempfiles (in a private directory)</td>
+</tr>
+<tr>
         <td class="rowodd" valign="top" nowrap><a href="download_script.php?src_id=15987">gnupg.vim</a></td>
     <td class="rowodd" valign="top" nowrap><b>2.0</b></td>
     <td class="rowodd" valign="top" nowrap><i>2011-06-26</i></td>
@@ -287,6 +307,15 @@ Click on the package to download.
   </tr>
 </table>
 
+<!-- for Google +1 button -->
+<script type="text/javascript">
+  (function() {
+    var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
+    po.src = 'https://apis.google.com/js/plusone.js';
+    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
+  })();
+</script>
+
 </body>
 </html>
 
diff --git a/plugin/gnupg.vim b/plugin/gnupg.vim
index e68e964..81cda0d 100644
--- a/plugin/gnupg.vim
+++ b/plugin/gnupg.vim
@@ -1,6 +1,6 @@
 " Name:    gnupg.vim
-" Last Change: 2011 June 26
-" Author:  James Vega <vega.james at gmail.com>
+" Last Change: 2011 Aug 13
+" Maintainer:  James Vega <vega.james at gmail.com>
 " Original Author:  Markus Braun <markus.braun at krawel.de>
 " Summary: Vim plugin for transparent editing of gpg encrypted files.
 " License: This program is free software; you can redistribute it and/or
@@ -84,6 +84,11 @@
 "     If set, these recipients are used as defaults when no other recipient is
 "     defined. This variable is a Vim list. Default is unset.
 "
+"   g:GPGUsePipes
+"     If set to 1, use pipes instead of temporary files when interacting with
+"     gnupg.  When set to 1, this can cause terminal-based gpg agents to not
+"     display correctly when prompting for passwords.  Defaults to 0.
+"
 " Known Issues: {{{2
 "
 "   In some cases gvim can't decrypt files
@@ -129,7 +134,7 @@
 if (exists("g:loaded_gnupg") || &cp || exists("#BufReadCmd*.\(gpg\|asc\|pgp\)"))
   finish
 endif
-let g:loaded_gnupg = '2.0'
+let g:loaded_gnupg = '2.2'
 let s:GPGInitRun = 0
 
 " check for correct vim version {{{2
@@ -227,6 +232,11 @@ function s:GPGInit()
     let g:GPGDefaultRecipients = []
   endif
 
+  " prefer not to use pipes since it can garble gpg agent display
+  if (!exists("g:GPGUsePipes"))
+    let g:GPGUsePipes = 0
+  endif
+
   " print version
   call s:GPGDebug(1, "gnupg.vim ". g:loaded_gnupg)
 
@@ -261,7 +271,7 @@ function s:GPGInit()
   " noshelltemp isn't currently supported on Windows, but it doesn't cause any
   " errors and this future proofs us against requiring changes if Windows
   " gains noshelltemp functionality
-  let s:shelltemp = 0
+  let s:shelltemp = !g:GPGUsePipes
   if (has("unix"))
     " unix specific settings
     let s:shellredir = ">%s 2>&1"
@@ -356,6 +366,7 @@ function s:GPGDecrypt()
   let &shelltemp = s:shelltempsave
   call s:GPGDebug(3, "output: ". output)
 
+  let asymmPattern = 'gpg: public key is \%(0x\)\=[[:xdigit:]]\{8,16}'
   " check if the file is symmetric/asymmetric encrypted
   if (match(output, "gpg: encrypted with [[:digit:]]\\+ passphrase") >= 0)
     " file is symmetric encrypted
@@ -375,7 +386,7 @@ function s:GPGDecrypt()
       echo
       echohl None
     endif
-  elseif (match(output, "gpg: public key is [[:xdigit:]]\\{8}") >= 0)
+  elseif (match(output, asymmPattern) >= 0)
     " file is asymmetric encrypted
     let b:GPGEncrypted = 1
     call s:GPGDebug(1, "this file is asymmetric encrypted")
@@ -383,10 +394,10 @@ function s:GPGDecrypt()
     let b:GPGOptions += ["encrypt"]
 
     " find the used public keys
-    let start = match(output, "gpg: public key is [[:xdigit:]]\\{8}")
+    let start = match(output, asymmPattern)
     while (start >= 0)
       let start = start + strlen("gpg: public key is ")
-      let recipient = strpart(output, start, 8)
+      let recipient = matchstr(output, '[[:xdigit:]]\{8,16}', start)
       call s:GPGDebug(1, "recipient is " . recipient)
       let name = s:GPGNameToID(recipient)
       if (strlen(name) > 0)
@@ -398,7 +409,7 @@ function s:GPGDecrypt()
         echom "The recipient \"" . recipient . "\" is not in your public keyring!"
         echohl None
       end
-      let start = match(output, "gpg: public key is [[:xdigit:]]\\{8}", start)
+      let start = match(output, asymmPattern, start)
     endwhile
   else
     " file is not encrypted

-- 
vim-scripts packaging



More information about the pkg-vim-maintainers mailing list