https://svn.lrde.epita.fr/svn/lrdetools/trunk
Index: ChangeLog
from Nicolas Pouillard <ertai(a)lrde.epita.fr>
GPG signature in now optional.
* vcs/lib/vcs/mail.rb: Handle the 'sign' option of the user
configuration.
* vcs/lib/vcs/vcs.rb: Set a the default value to true.
* vcs/NEWS: Explain this feature.
NEWS | 5 +++++
lib/vcs/mail.rb | 8 ++++++--
lib/vcs/vcs.rb | 3 ++-
3 files changed, 13 insertions(+), 3 deletions(-)
Index: vcs/lib/vcs/mail.rb
--- vcs/lib/vcs/mail.rb (revision 238)
+++ vcs/lib/vcs/mail.rb (working copy)
@@ -10,7 +10,7 @@
MAIL = Sendmail::MAIL_FILE
MAILER = Sendmail.new
- DEFAULT_OPTIONS = %w[ --confirm --sign --mime ]
+ DEFAULT_OPTIONS = %w[ --confirm --mime ]
#
# Mail.
@@ -18,7 +18,9 @@
def mail! ( *args )
error_handling :mail_failed
unless MAIL.exist?
- print_body(MAIL, MAILER.parse_mail_options(*(DEFAULT_OPTIONS + args)))
+ options = DEFAULT_OPTIONS + args
+ options << '--sign' if Vcs.user_conf.sign
+ print_body(MAIL, MAILER.parse_mail_options(*options))
end
MAILER.sendmail
MAIL.delete
@@ -33,6 +35,7 @@
end
def mail_conf_checker
+ if Vcs.user_conf.sign
unless `gpg --version` =~ /^gpg \(GnuPG\)/
LOG.error 'mail: gunpg is required'
end
@@ -40,6 +43,7 @@
LOG.error 'no private key: in your ~/.gnupg'
end
end
+ end
add_conf_checker :mail_conf_checker
Index: vcs/NEWS
--- vcs/NEWS (revision 238)
+++ vcs/NEWS (working copy)
@@ -39,6 +39,11 @@
* ,messages is now +commited: You can rename your ,messages and keep just
one directory for commited meta information.
+ * GnuPG signature is now optional:
+ In a .vcs configuration file you can disable the signature option.
+ For this just add this "sign: false" to .vcs configuration file.
+ However it's better to keep this option set.
+
New in 0.3 2005-09-16:
* The help command now show all commands including vcs ones.
Index: vcs/lib/vcs/vcs.rb
--- vcs/lib/vcs/vcs.rb (revision 238)
+++ vcs/lib/vcs/vcs.rb (working copy)
@@ -35,7 +35,8 @@
:unmask => [/^\\/],
:junk => [/^,/],
:precious => [/^(\+|\.vcs)/],
- :color => :auto
+ :color => :auto,
+ :sign => true
)
@@output_io_methods ||= %w[ print puts putc ] # FIXME and so ...