mirror of
https://github.com/ruby/ruby.git
synced 2025-09-18 18:13:58 +02:00
merge revision(s) 41076: [Backport #8558]
* lib/rubygems: Update to RubyGems 2.0.3 * test/rubygems: Tests for the above. * NEWS: Added RubyGems 2.0.3 note. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@41543 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
9970a90c88
commit
9bf4a463ab
11 changed files with 61 additions and 26 deletions
|
@ -1,3 +1,11 @@
|
||||||
|
Sat Jun 22 00:54:41 2013 Eric Hodel <drbrain@segment7.net>
|
||||||
|
|
||||||
|
* lib/rubygems: Update to RubyGems 2.0.3
|
||||||
|
|
||||||
|
* test/rubygems: Tests for the above.
|
||||||
|
|
||||||
|
* NEWS: Added RubyGems 2.0.3 note.
|
||||||
|
|
||||||
Wed Jun 19 04:20:31 2013 Charlie Somerville <charliesome@ruby-lang.org>
|
Wed Jun 19 04:20:31 2013 Charlie Somerville <charliesome@ruby-lang.org>
|
||||||
|
|
||||||
* vm_insnhelper.c (vm_call_method): ensure methods of type
|
* vm_insnhelper.c (vm_call_method): ensure methods of type
|
||||||
|
|
4
NEWS
4
NEWS
|
@ -461,6 +461,10 @@ with all sufficient information, see the ChangeLog file.
|
||||||
XML declaration is used for XML document encoding.
|
XML declaration is used for XML document encoding.
|
||||||
|
|
||||||
* RubyGems
|
* RubyGems
|
||||||
|
* Updated to 2.0.3. See
|
||||||
|
http://rubygems.rubyforge.org/rubygems-update/History_txt.html#label-2.0.3+%2F+2012-03-1
|
||||||
|
for release notes.
|
||||||
|
|
||||||
* Updated to 2.0.0
|
* Updated to 2.0.0
|
||||||
|
|
||||||
RubyGems 2.0.0 features the following improvements:
|
RubyGems 2.0.0 features the following improvements:
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
require 'rbconfig'
|
require 'rbconfig'
|
||||||
|
|
||||||
module Gem
|
module Gem
|
||||||
VERSION = '2.0.2'
|
VERSION = '2.0.3'
|
||||||
end
|
end
|
||||||
|
|
||||||
# Must be first since it unloads the prelude from 1.9.2
|
# Must be first since it unloads the prelude from 1.9.2
|
||||||
|
|
|
@ -180,7 +180,7 @@ For further reading on signing gems see `ri Gem::Security`.
|
||||||
end
|
end
|
||||||
|
|
||||||
def load_default_cert
|
def load_default_cert
|
||||||
cert_file = File.join Gem.user_home, 'gem-public_cert.pem'
|
cert_file = File.join Gem.default_cert_path
|
||||||
cert = File.read cert_file
|
cert = File.read cert_file
|
||||||
options[:issuer_cert] = OpenSSL::X509::Certificate.new cert
|
options[:issuer_cert] = OpenSSL::X509::Certificate.new cert
|
||||||
rescue Errno::ENOENT
|
rescue Errno::ENOENT
|
||||||
|
@ -196,7 +196,7 @@ For further reading on signing gems see `ri Gem::Security`.
|
||||||
end
|
end
|
||||||
|
|
||||||
def load_default_key
|
def load_default_key
|
||||||
key_file = File.join Gem.user_home, 'gem-private_key.pem'
|
key_file = File.join Gem.default_key_path
|
||||||
key = File.read key_file
|
key = File.read key_file
|
||||||
options[:key] = OpenSSL::PKey::RSA.new key
|
options[:key] = OpenSSL::PKey::RSA.new key
|
||||||
rescue Errno::ENOENT
|
rescue Errno::ENOENT
|
||||||
|
|
|
@ -110,4 +110,18 @@ module Gem
|
||||||
'ruby'
|
'ruby'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
##
|
||||||
|
# The default signing key path
|
||||||
|
|
||||||
|
def self.default_key_path
|
||||||
|
File.join Gem.user_home, ".gem", "gem-private_key.pem"
|
||||||
|
end
|
||||||
|
|
||||||
|
##
|
||||||
|
# The default signing certificate chain path
|
||||||
|
|
||||||
|
def self.default_cert_path
|
||||||
|
File.join Gem.user_home, ".gem", "gem-public_cert.pem"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -34,12 +34,12 @@ class Gem::Security::Signer
|
||||||
@key = key
|
@key = key
|
||||||
|
|
||||||
unless @key then
|
unless @key then
|
||||||
default_key = File.join Gem.user_home, 'gem-private_key.pem'
|
default_key = File.join Gem.default_key_path
|
||||||
@key = default_key if File.exist? default_key
|
@key = default_key if File.exist? default_key
|
||||||
end
|
end
|
||||||
|
|
||||||
unless @cert_chain then
|
unless @cert_chain then
|
||||||
default_cert = File.join Gem.user_home, 'gem-public_cert.pem'
|
default_cert = File.join Gem.default_cert_path
|
||||||
@cert_chain = [default_cert] if File.exist? default_cert
|
@cert_chain = [default_cert] if File.exist? default_cert
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -110,15 +110,15 @@ class Gem::Security::Signer
|
||||||
def re_sign_key # :nodoc:
|
def re_sign_key # :nodoc:
|
||||||
old_cert = @cert_chain.last
|
old_cert = @cert_chain.last
|
||||||
|
|
||||||
disk_cert_path = File.join Gem.user_home, 'gem-public_cert.pem'
|
disk_cert_path = File.join Gem.default_cert_path
|
||||||
disk_cert = File.read disk_cert_path rescue nil
|
disk_cert = File.read disk_cert_path rescue nil
|
||||||
disk_key =
|
disk_key =
|
||||||
File.read File.join(Gem.user_home, 'gem-private_key.pem') rescue nil
|
File.read File.join(Gem.default_key_path) rescue nil
|
||||||
|
|
||||||
if disk_key == @key.to_pem and disk_cert == old_cert.to_pem then
|
if disk_key == @key.to_pem and disk_cert == old_cert.to_pem then
|
||||||
expiry = old_cert.not_after.strftime '%Y%m%d%H%M%S'
|
expiry = old_cert.not_after.strftime '%Y%m%d%H%M%S'
|
||||||
old_cert_file = "gem-public_cert.pem.expired.#{expiry}"
|
old_cert_file = "gem-public_cert.pem.expired.#{expiry}"
|
||||||
old_cert_path = File.join Gem.user_home, old_cert_file
|
old_cert_path = File.join Gem.user_home, ".gem", old_cert_file
|
||||||
|
|
||||||
unless File.exist? old_cert_path then
|
unless File.exist? old_cert_path then
|
||||||
Gem::Security.write old_cert, old_cert_path
|
Gem::Security.write old_cert, old_cert_path
|
||||||
|
|
|
@ -308,10 +308,12 @@ Removed '/CN=alternate/DC=example'
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_execute_sign_default
|
def test_execute_sign_default
|
||||||
private_key_path = File.join Gem.user_home, 'gem-private_key.pem'
|
FileUtils.mkdir_p File.join Gem.user_home, '.gem'
|
||||||
|
|
||||||
|
private_key_path = File.join Gem.user_home, '.gem', 'gem-private_key.pem'
|
||||||
Gem::Security.write PRIVATE_KEY, private_key_path
|
Gem::Security.write PRIVATE_KEY, private_key_path
|
||||||
|
|
||||||
public_cert_path = File.join Gem.user_home, 'gem-public_cert.pem'
|
public_cert_path = File.join Gem.user_home, '.gem', 'gem-public_cert.pem'
|
||||||
Gem::Security.write PUBLIC_CERT, public_cert_path
|
Gem::Security.write PUBLIC_CERT, public_cert_path
|
||||||
|
|
||||||
path = File.join @tempdir, 'cert.pem'
|
path = File.join @tempdir, 'cert.pem'
|
||||||
|
@ -338,7 +340,9 @@ Removed '/CN=alternate/DC=example'
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_execute_sign_no_cert
|
def test_execute_sign_no_cert
|
||||||
private_key_path = File.join Gem.user_home, 'gem-private_key.pem'
|
FileUtils.mkdir_p File.join Gem.user_home, '.gem'
|
||||||
|
|
||||||
|
private_key_path = File.join Gem.user_home, '.gem', 'gem-private_key.pem'
|
||||||
Gem::Security.write PRIVATE_KEY, private_key_path
|
Gem::Security.write PRIVATE_KEY, private_key_path
|
||||||
|
|
||||||
path = File.join @tempdir, 'cert.pem'
|
path = File.join @tempdir, 'cert.pem'
|
||||||
|
@ -364,7 +368,9 @@ ERROR: --certificate not specified and ~/.gem/gem-public_cert.pem does not exis
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_execute_sign_no_key
|
def test_execute_sign_no_key
|
||||||
public_cert_path = File.join Gem.user_home, 'gem-public_cert.pem'
|
FileUtils.mkdir_p File.join Gem.user_home, '.gem'
|
||||||
|
|
||||||
|
public_cert_path = File.join Gem.user_home, '.gem', 'gem-public_cert.pem'
|
||||||
Gem::Security.write PUBLIC_CERT, public_cert_path
|
Gem::Security.write PUBLIC_CERT, public_cert_path
|
||||||
|
|
||||||
path = File.join @tempdir, 'cert.pem'
|
path = File.join @tempdir, 'cert.pem'
|
||||||
|
|
|
@ -1073,7 +1073,6 @@ gem 'other', version
|
||||||
|
|
||||||
CONFIG['CC'] = '$(TOUCH) $@ ||'
|
CONFIG['CC'] = '$(TOUCH) $@ ||'
|
||||||
CONFIG['LDSHARED'] = '$(TOUCH) $@ ||'
|
CONFIG['LDSHARED'] = '$(TOUCH) $@ ||'
|
||||||
$ruby = '#{Gem.ruby}'
|
|
||||||
|
|
||||||
create_makefile("#{@spec.name}")
|
create_makefile("#{@spec.name}")
|
||||||
RUBY
|
RUBY
|
||||||
|
|
|
@ -162,10 +162,12 @@ class TestGemPackage < Gem::Package::TarTestCase
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_build_auto_signed
|
def test_build_auto_signed
|
||||||
private_key_path = File.join Gem.user_home, 'gem-private_key.pem'
|
FileUtils.mkdir_p File.join(Gem.user_home, '.gem')
|
||||||
|
|
||||||
|
private_key_path = File.join Gem.user_home, '.gem', 'gem-private_key.pem'
|
||||||
Gem::Security.write PRIVATE_KEY, private_key_path
|
Gem::Security.write PRIVATE_KEY, private_key_path
|
||||||
|
|
||||||
public_cert_path = File.join Gem.user_home, 'gem-public_cert.pem'
|
public_cert_path = File.join Gem.user_home, '.gem', 'gem-public_cert.pem'
|
||||||
Gem::Security.write PUBLIC_CERT, public_cert_path
|
Gem::Security.write PUBLIC_CERT, public_cert_path
|
||||||
|
|
||||||
spec = Gem::Specification.new 'build', '1'
|
spec = Gem::Specification.new 'build', '1'
|
||||||
|
@ -509,7 +511,7 @@ class TestGemPackage < Gem::Package::TarTestCase
|
||||||
package.verify
|
package.verify
|
||||||
end
|
end
|
||||||
|
|
||||||
assert_equal 'No such file or directory - nonexistent.gem', e.message
|
assert_match ' - nonexistent.gem', e.message
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_verify_security_policy
|
def test_verify_security_policy
|
||||||
|
|
|
@ -50,10 +50,12 @@ class TestGemSecuritySigner < Gem::TestCase
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_initialize_default
|
def test_initialize_default
|
||||||
private_key_path = File.join Gem.user_home, 'gem-private_key.pem'
|
FileUtils.mkdir_p File.join(Gem.user_home, '.gem')
|
||||||
|
|
||||||
|
private_key_path = File.join Gem.user_home, '.gem', 'gem-private_key.pem'
|
||||||
Gem::Security.write PRIVATE_KEY, private_key_path
|
Gem::Security.write PRIVATE_KEY, private_key_path
|
||||||
|
|
||||||
public_cert_path = File.join Gem.user_home, 'gem-public_cert.pem'
|
public_cert_path = File.join Gem.user_home, '.gem', 'gem-public_cert.pem'
|
||||||
Gem::Security.write PUBLIC_CERT, public_cert_path
|
Gem::Security.write PUBLIC_CERT, public_cert_path
|
||||||
|
|
||||||
signer = Gem::Security::Signer.new nil, nil
|
signer = Gem::Security::Signer.new nil, nil
|
||||||
|
@ -120,12 +122,12 @@ c7NM7KZZjj7G++SXjYTEI1PHSA7aFQ/i/+qSUvx+Pg==
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_sign_expired_auto_update
|
def test_sign_expired_auto_update
|
||||||
FileUtils.mkdir_p Gem.user_home, :mode => 0700
|
FileUtils.mkdir_p File.join(Gem.user_home, '.gem'), :mode => 0700
|
||||||
|
|
||||||
private_key_path = File.join(Gem.user_home, 'gem-private_key.pem')
|
private_key_path = File.join(Gem.user_home, '.gem', 'gem-private_key.pem')
|
||||||
Gem::Security.write PRIVATE_KEY, private_key_path
|
Gem::Security.write PRIVATE_KEY, private_key_path
|
||||||
|
|
||||||
cert_path = File.join Gem.user_home, 'gem-public_cert.pem'
|
cert_path = File.join Gem.user_home, '.gem', 'gem-public_cert.pem'
|
||||||
Gem::Security.write EXPIRED_CERT, cert_path
|
Gem::Security.write EXPIRED_CERT, cert_path
|
||||||
|
|
||||||
signer = Gem::Security::Signer.new PRIVATE_KEY, [EXPIRED_CERT]
|
signer = Gem::Security::Signer.new PRIVATE_KEY, [EXPIRED_CERT]
|
||||||
|
@ -140,14 +142,14 @@ c7NM7KZZjj7G++SXjYTEI1PHSA7aFQ/i/+qSUvx+Pg==
|
||||||
expiry = EXPIRED_CERT.not_after.strftime "%Y%m%d%H%M%S"
|
expiry = EXPIRED_CERT.not_after.strftime "%Y%m%d%H%M%S"
|
||||||
|
|
||||||
expired_path =
|
expired_path =
|
||||||
File.join Gem.user_home, "gem-public_cert.pem.expired.#{expiry}"
|
File.join Gem.user_home, '.gem', "gem-public_cert.pem.expired.#{expiry}"
|
||||||
|
|
||||||
assert_path_exists expired_path
|
assert_path_exists expired_path
|
||||||
assert_equal EXPIRED_CERT.to_pem, File.read(expired_path)
|
assert_equal EXPIRED_CERT.to_pem, File.read(expired_path)
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_sign_expired_auto_update_exists
|
def test_sign_expired_auto_update_exists
|
||||||
FileUtils.mkdir_p Gem.user_home, :mode => 0700
|
FileUtils.mkdir_p File.join(Gem.user_home, '.gem'), :mode => 0700
|
||||||
|
|
||||||
expiry = EXPIRED_CERT.not_after.strftime "%Y%m%d%H%M%S"
|
expiry = EXPIRED_CERT.not_after.strftime "%Y%m%d%H%M%S"
|
||||||
expired_path =
|
expired_path =
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
#define RUBY_VERSION "2.0.0"
|
#define RUBY_VERSION "2.0.0"
|
||||||
#define RUBY_RELEASE_DATE "2013-06-20"
|
#define RUBY_RELEASE_DATE "2013-06-22"
|
||||||
#define RUBY_PATCHLEVEL 235
|
#define RUBY_PATCHLEVEL 236
|
||||||
|
|
||||||
#define RUBY_RELEASE_YEAR 2013
|
#define RUBY_RELEASE_YEAR 2013
|
||||||
#define RUBY_RELEASE_MONTH 6
|
#define RUBY_RELEASE_MONTH 6
|
||||||
#define RUBY_RELEASE_DAY 20
|
#define RUBY_RELEASE_DAY 22
|
||||||
|
|
||||||
#include "ruby/version.h"
|
#include "ruby/version.h"
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue