[DRE-commits] [SCM] ruby-bdb.git branch, debian-sid, updated. debian/0.6.5-1-14-ge3b5802

Ondřej Surý ondrej at sury.org
Wed May 25 12:39:09 UTC 2011


The following commit has been merged in the debian-sid branch:
commit 1628b87d25ccd5ac990fea42b013eba463c664e4
Author: Ondřej Surý <ondrej at sury.org>
Date:   Wed May 25 10:43:20 2011 +0200

    Make BDB version checks less prone to errors due version 5 introduction

diff --git a/debian/patches/add-support-for-libdb_version_5_and_higher.patch b/debian/patches/add-support-for-libdb_version_5_and_higher.patch
new file mode 100644
index 0000000..62c0675
--- /dev/null
+++ b/debian/patches/add-support-for-libdb_version_5_and_higher.patch
@@ -0,0 +1,129 @@
+--- a/docs/env.rb
++++ b/docs/env.rb
+@@ -154,7 +154,7 @@ class BDB::Env
+    def  close()
+    end
+    
+-   #only with BDB::VERSION_MAJOR == 4 && BDB::VERSION_MINOR >= 1
++   #only with BDB::VERSION > 4.1
+    #
+    #remove the database specified by <em>file</em> and <em>database</em>. If no
+    #<em>database</em> is <em>nil</em>, the underlying file represented by 
+@@ -166,7 +166,7 @@ class BDB::Env
+    def  dbremove(file, database = nil, flags = 0)
+    end
+    
+-   #only with BDB::VERSION_MAJOR == 4 && BDB::VERSION_MINOR >= 1
++   #only with BDB::VERSION > 4.1
+    #
+    #rename the database specified by <em>file</em> and <em>database</em> to
+    #<em>newname</em>. If <em>database</em> is <em>nil</em>, the underlying file
+@@ -296,7 +296,7 @@ class BDB::Env
+    def  open_db(type, name = nil, subname = nil, flags = 0, mode = 0)
+    end
+    
+-   #only with BDB::VERSION_MAJOR == 3 && BDB::VERSION_MINOR >= 3
++   #only with BDB::VERSION >= 3.3
+    #
+    #iterate over all prepared transactions. The transaction <em>txn</em>
+    #must be made a call to #abort, #commit, #discard
+@@ -307,7 +307,7 @@ class BDB::Env
+       yield txn, id
+    end
+    
+-   #only with BDB::VERSION_MAJOR == 3 && BDB::VERSION_MINOR >= 2
++   #only with BDB::VERSION >= 3.2
+    #
+    #<em>flags</em> can have the value <em>BDB::CDB_ALLDB</em>, <em>BDB::NOMMAP</em>
+    #<em>BDB::TXN_NOSYNC</em>
+--- a/docs/transaction.rb
++++ b/docs/transaction.rb
+@@ -99,7 +99,7 @@ class BDB::Txn
+    def  txn_close(flags = 0)
+    end
+    
+-   #only with BDB::VERSION_MAJOR == 3 && BDB::VERSION_MINOR >= 3
++   #only with BDB::VERSION_MAJOR > 3 || (BDB::VERSION_MAJOR == 3 && BDB::VERSION_MINOR >= 3)
+    #
+    #Discard a prepared but not resolved transaction handle, must be called
+    #only within BDB::Env#recover
+@@ -110,7 +110,7 @@ class BDB::Txn
+    def  txn_discard
+    end
+    
+-   #only with BDB::VERSION_MAJOR == 4 && BDB::VERSION_MINOR >= 1
++   #only with BDB::VERSION_MAJOR > 4 || (BDB::VERSION_MAJOR == 4 && BDB::VERSION_MINOR >= 1)
+    #
+    #remove the database specified by <em>file</em> and <em>database</em>. If no
+    #<em>database</em> is <em>nil</em>, the underlying file represented by 
+@@ -122,7 +122,7 @@ class BDB::Txn
+    def  dbremove(file, database = nil, flags = 0)
+    end
+    
+-   #only with BDB::VERSION_MAJOR == 4 && BDB::VERSION_MINOR >= 1
++   #only with BDB::VERSION_MAJOR > 4 || (BDB::VERSION_MAJOR == 4 && BDB::VERSION_MINOR >= 1)
+    #
+    #rename the database specified by <em>file</em> and <em>database</em> to
+    #<em>newname</em>. If <em>database</em> is <em>nil</em>, the underlying file
+--- a/tests/btree.rb
++++ b/tests/btree.rb
+@@ -195,7 +195,7 @@ class TestBtree < Inh::TestCase
+       assert_equal("bbb", $bdb["2"] = "bbb", "<set dup>")
+       assert_equal("aaaa", $bdb["3"] = "aaaa", "<set dup>")
+       rep = [["a", "b", "c", "d"], ['aa', 'bb', 'cc'], ['aaa', 'bbb'], ['aaaa']]
+-      if BDB::VERSION_MAJOR > 2 || BDB::VERSION_MINOR >= 6
++      if BDB::VERSION_MAJOR > 2 || (BDB::VERSION_MAJOR == 2 && BDB::VERSION_MINOR >= 6)
+ 	 for i in [0, 1, 2, 3]
+ 	    k0, v0 = [], []
+ 	    $bdb.duplicates(i.to_s, false).each {|v| v0 << v}
+@@ -468,7 +468,7 @@ class TestBtree < Inh::TestCase
+       end
+    end
+ 
+-   if BDB::VERSION_MAJOR == 3 && BDB::VERSION_MINOR >= 3
++   if BDB::VERSION_MAJOR > 3 || (BDB::VERSION_MAJOR == 3 && BDB::VERSION_MINOR >= 3)
+       def test_22_blurb
+ 	 $bdb.each(nil, 10) do |k, v|
+ 	    assert_equal($hash[k], v, "<value>")
+--- a/tests/hash.rb
++++ b/tests/hash.rb
+@@ -177,7 +177,7 @@ class TestHash < Inh::TestCase
+       assert_equal("aaa", $bdb["2"] = "aaa", "<set dup>")
+       assert_equal("bbb", $bdb["2"] = "bbb", "<set dup>")
+       assert_equal("aaaa", $bdb["3"] = "aaaa", "<set dup>")
+-      if BDB::VERSION_MAJOR > 2 || BDB::VERSION_MINOR >= 6
++      if BDB::VERSION_MAJOR > 2 || (BDB::VERSION_MAJOR == 2 && BDB::VERSION_MINOR >= 6)
+ 	 assert_equal(4, $bdb.count("0"), "<count dup 0>")
+ 	 assert_equal(3, $bdb.count("1"), "<count dup 1>")
+ 	 assert_equal(2, $bdb.count("2"), "<count dup 2>")
+@@ -421,7 +421,7 @@ class TestHash < Inh::TestCase
+       end
+    end
+ 
+-   if BDB::VERSION_MAJOR == 3 && BDB::VERSION_MINOR >= 3
++   if BDB::VERSION_MAJOR > 3 || (BDB::VERSION_MAJOR == 3 && BDB::VERSION_MINOR >= 3)
+       def test_20_blurb
+ 	 $bdb.each(nil, 10) do |k, v|
+ 	    assert_equal($hash[k], v, "<value>")
+--- a/tests/lock.rb
++++ b/tests/lock.rb
+@@ -115,7 +115,7 @@ class TestLock < Inh::TestCase
+       assert_equal(1, inc = db1.push("record1")[0], "<set db>")
+       assert_kind_of(BDB::Txn, txn2 = $env.begin("flags" => BDB::TXN_NOWAIT))
+       assert_kind_of(BDB::Queue, db2 = txn2.assoc($db))
+-      if BDB::VERSION_MAJOR >= 4 && BDB::VERSION_MINOR >= 2
++      if BDB::VERSION_MAJOR > 4 || (BDB::VERSION_MAJOR == 4 && BDB::VERSION_MINOR >= 2)
+ 	 assert_raises(BDB::LockDead) { db2[inc] }
+       else
+ 	 assert_raises(BDB::LockGranted) { db2[inc] }
+--- a/tests/marshal.rb
++++ b/tests/marshal.rb
+@@ -117,7 +117,7 @@ class TestBtree < Inh::TestCase
+ 	 end
+ 	 ind += 1
+       end
+-      if BDB::VERSION_MAJOR > 2 || BDB::VERSION_MINOR >= 6
++      if BDB::VERSION_MAJOR > 2 || (BDB::VERSION_MAJOR == 2 && BDB::VERSION_MINOR >= 6)
+ 	 assert_equal(4, $bdb.count("0"), "<count dup 0>")
+ 	 assert_equal(3, $bdb.count("1"), "<count dup 1>")
+ 	 assert_equal(2, $bdb.count("2"), "<count dup 2>")
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..2d295ea
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1,5 @@
+build-against-libdb.patch
+doc-in-a-single-dir.patch
+dont-check-patch-level.patch
+fail-make-test-if-tests-fail.patch
+add-support-for-libdb_version_5_and_higher.patch

-- 
ruby-bdb.git



More information about the Pkg-ruby-extras-commits mailing list