You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildr.apache.org by to...@apache.org on 2010/04/01 05:04:10 UTC

svn commit: r929793 - /buildr/trunk/rakelib/stage.rake

Author: toulmean
Date: Thu Apr  1 03:04:10 2010
New Revision: 929793

URL: http://svn.apache.org/viewvc?rev=929793&view=rev
Log:
support for the gpg cmd in case gpg is installed, not gpg2

Modified:
    buildr/trunk/rakelib/stage.rake

Modified: buildr/trunk/rakelib/stage.rake
URL: http://svn.apache.org/viewvc/buildr/trunk/rakelib/stage.rake?rev=929793&r1=929792&r2=929793&view=diff
==============================================================================
--- buildr/trunk/rakelib/stage.rake (original)
+++ buildr/trunk/rakelib/stage.rake Thu Apr  1 03:04:10 2010
@@ -23,6 +23,7 @@ rescue LoadError
   task(:setup) { install_gem 'rubyforge' }
 end
 
+gpg_cmd = 'gpg2'
 
 task :prepare do |task, args|
   # Make sure we're doing a release from checked code.
@@ -48,7 +49,10 @@ task :prepare do |task, args|
   lambda do
     args.gpg or fail "Please run with gpg=<argument for gpg --local-user>"
     gpg_ok = `gpg2 --list-keys #{args.gpg}`
-    gpg_ok = `gpg --list-keys #{args.gpg}` if !$?.success?
+    if !$?.success?
+      gpg_ok = `gpg --list-keys #{args.gpg}` 
+      gpg_cmd = 'gpg'
+    end
     fail "No GPG user #{args.gpg}" if gpg_ok.empty?
   end.call
 
@@ -113,7 +117,7 @@ task :stage=>['setup', 'doc:setup', :clo
       bytes = File.open(pkg, 'rb') { |file| file.read }
       File.open(pkg + '.md5', 'w') { |file| file.write Digest::MD5.hexdigest(bytes) << ' ' << File.basename(pkg) }
       File.open(pkg + '.sha1', 'w') { |file| file.write Digest::SHA1.hexdigest(bytes) << ' ' << File.basename(pkg) }
-      sh 'gpg2', '--local-user', args.gpg, '--armor', '--output', pkg + '.asc', '--detach-sig', pkg, :verbose=>true
+      sh gpg_cmd, '--local-user', args.gpg, '--armor', '--output', pkg + '.asc', '--detach-sig', pkg, :verbose=>true
     end
     cp 'etc/KEYS', '_staged/dist'
     puts "[X] Created and signed release packages in _staged/dist"