Gentoo Archives: gentoo-commits

From: "Diego Petteno (flameeyes)" <flameeyes@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in dev-ruby/uuidtools/files: uuidtools-1.0.7+ruby-1.8.7.patch
Date: Mon, 27 Apr 2009 12:48:06
Message-Id: E1LyQFf-0005MY-UD@stork.gentoo.org
1 flameeyes 09/04/27 12:48:03
2
3 Added: uuidtools-1.0.7+ruby-1.8.7.patch
4 Log:
5 Add a fix for uuidtools with Ruby 1.8.7's securerandom and make it install for Ruby 1.9 too.
6 (Portage version: 2.2_rc31/cvs/Linux x86_64)
7
8 Revision Changes Path
9 1.1 dev-ruby/uuidtools/files/uuidtools-1.0.7+ruby-1.8.7.patch
10
11 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-ruby/uuidtools/files/uuidtools-1.0.7+ruby-1.8.7.patch?rev=1.1&view=markup
12 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-ruby/uuidtools/files/uuidtools-1.0.7+ruby-1.8.7.patch?rev=1.1&content-type=text/plain
13
14 Index: uuidtools-1.0.7+ruby-1.8.7.patch
15 ===================================================================
16 Index: uuidtools-1.0.7/lib/uuidtools.rb
17 ===================================================================
18 --- uuidtools-1.0.7.orig/lib/uuidtools.rb
19 +++ uuidtools-1.0.7/lib/uuidtools.rb
20 @@ -191,10 +191,7 @@ class UUID
21 octet.to_i(16)
22 end
23 else
24 - nodes = SecureRandom.random_bytes(6).split("").map do |chr|
25 - # Ruby 1.9 / Ruby 1.8
26 - chr.respond_to?(:ord) ? chr.ord : chr.sum(8)
27 - end
28 + nodes = SecureRandom.random_bytes(6).unpack("C*")
29 nodes[0] |= 0b00000001
30 end
31 for i in 0..5