Bug 184921 - databases/ruby-bdb: breaks on patchlevel upgrades of Berkeley DB
Summary: databases/ruby-bdb: breaks on patchlevel upgrades of Berkeley DB
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Steve Wills
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-12-17 09:20 UTC by Matthias Andree
Modified: 2014-01-02 20:27 UTC (History)
1 user (show)

See Also:


Attachments
ruby-bdb.patch.txt (1.72 KB, text/plain; charset=us-ascii)
2013-12-18 16:36 UTC, Steve Wills
no flags Details
ruby-bdb.patch2.txt (9.54 KB, text/plain; charset=us-ascii)
2013-12-18 19:12 UTC, Steve Wills
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Matthias Andree freebsd_committer 2013-12-17 09:20:00 UTC
I have just had ruby-bdb bomb out on me.

1. I used to have db5 installed, which was at 5.3.21.

2. I then upgraded db5 to 5.3.28 with portupgrade.

3. During that upgrade already, portupgrade started failing with the errors
   given below.

4. The fix is to have the ruby-bdb port only compare the db.h MAJOR and MINOR
   versions BUT NOT the patchlevel.  Utterly unable to write Ruby code,
   I cannot help with that.


===>  Cleaning for db5-5.3.28
** Updating origin in pkg for databases/db42 to databases/db5
--->  Cleaning out obsolete shared libraries
/usr/local/lib/ruby/1.9/rubygems/custom_require.rb:36:in `require':  (NotImplementedError)
BDB needs compatible versions of libdb & db.h
	you have db.h version 5.3.21 and libdb version 5.3.28
	from /usr/local/lib/ruby/1.9/rubygems/custom_require.rb:36:in `require'
	from /usr/local/lib/ruby/site_ruby/1.9/pkgtools/pkgdbtools.rb:84:in `db_driver='
	from /usr/local/lib/ruby/site_ruby/1.9/pkgtools/portsdb.rb:168:in `setup'
	from /usr/local/lib/ruby/site_ruby/1.9/pkgtools/pkgtools.rb:242:in `init_pkgtools_global'
	from /usr/local/sbin/portsclean:134:in `block in main'
	from /usr/local/lib/ruby/1.9/optparse.rb:882:in `initialize'
	from /usr/local/sbin/portsclean:70:in `new'
	from /usr/local/sbin/portsclean:70:in `main'
	from /usr/local/sbin/portsclean:727:in `<main>'
Comment 1 Edwin Groothuis freebsd_committer 2013-12-17 09:20:07 UTC
Responsible Changed
From-To: freebsd-ports-bugs->knu

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 Steve Wills freebsd_committer 2013-12-18 16:36:43 UTC
Hi,

The attached patch may solve the issue. Could you please test?

Thanks,
Steve
Comment 3 Steve Wills freebsd_committer 2013-12-18 19:12:14 UTC
Hi,

That previous patch isn't correct. This one may be more correct, although I'm
not sure about the change to src/bdb.h.

Steve
Comment 4 Steve Wills freebsd_committer 2014-01-01 18:29:21 UTC
Responsible Changed
From-To: knu->swills

I'll take it.
Comment 5 dfilter service freebsd_committer 2014-01-02 20:12:18 UTC
Author: swills
Date: Thu Jan  2 20:12:09 2014
New Revision: 338488
URL: http://svnweb.freebsd.org/changeset/ports/338488

Log:
  - Make check for bdb version ignore the patch level
  
  PR:		ports/184921

Added:
  head/databases/ruby-bdb/files/patch-bdbxml1__bdbxml.cc   (contents, props changed)
  head/databases/ruby-bdb/files/patch-bdbxml2__bdbxml.cc   (contents, props changed)
  head/databases/ruby-bdb/files/patch-src__bdb.c   (contents, props changed)
Modified:
  head/databases/ruby-bdb/Makefile   (contents, props changed)
  head/databases/ruby-bdb/files/patch-extconf.rb   (contents, props changed)

Modified: head/databases/ruby-bdb/Makefile
==============================================================================
--- head/databases/ruby-bdb/Makefile	Thu Jan  2 20:09:36 2014	(r338487)
+++ head/databases/ruby-bdb/Makefile	Thu Jan  2 20:12:09 2014	(r338488)
@@ -3,7 +3,7 @@
 
 PORTNAME=	bdb
 PORTVERSION=	0.6.6
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	databases ruby
 MASTER_SITES=	ftp://ftp.idaemons.org/pub/distfiles/ruby/ \
 		http://idaemons.org/distfiles/ruby/ \

Added: head/databases/ruby-bdb/files/patch-bdbxml1__bdbxml.cc
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/databases/ruby-bdb/files/patch-bdbxml1__bdbxml.cc	Thu Jan  2 20:12:09 2014	(r338488)
@@ -0,0 +1,48 @@
+--- ./bdbxml1/bdbxml.cc.orig	2011-04-06 19:35:39.000000000 +0000
++++ ./bdbxml1/bdbxml.cc	2013-12-18 19:00:54.663254132 +0000
+@@ -2316,7 +2316,7 @@
+ 
+     void Init_bdbxml()
+     {
+-	int major, minor, patch;
++	int major, minor;
+ 	VALUE version;
+ #ifdef BDB_LINK_OBJ
+ 	extern void Init_bdb();
+@@ -2339,19 +2339,16 @@
+ 	xb_mDb = rb_const_get(rb_cObject, rb_intern("BDB"));
+ 	major = NUM2INT(rb_const_get(xb_mDb, rb_intern("VERSION_MAJOR")));
+ 	minor = NUM2INT(rb_const_get(xb_mDb, rb_intern("VERSION_MINOR")));
+-	patch = NUM2INT(rb_const_get(xb_mDb, rb_intern("VERSION_PATCH")));
+-	if (major != DB_VERSION_MAJOR || minor != DB_VERSION_MINOR
+-	    || patch != DB_VERSION_PATCH) {
+-	    rb_raise(rb_eNotImpError, "\nBDB::XML needs compatible versions of BDB\n\tyou have BDB::XML version %d.%d.%d and BDB version %d.%d.%d\n",
+-		     DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
+-		     major, minor, patch);
++	if (major != DB_VERSION_MAJOR || minor != DB_VERSION_MINOR) {
++	    rb_raise(rb_eNotImpError, "\nBDB::XML needs compatible versions of BDB\n\tyou have BDB::XML version %d.%d and BDB version %d.%d\n",
++		     DB_VERSION_MAJOR, DB_VERSION_MINOR,
++		     major, minor);
+ 	}
+-	version = rb_tainted_str_new2(dbxml_version(&major, &minor, &patch));
+-	if (major != DBXML_VERSION_MAJOR || minor != DBXML_VERSION_MINOR
+-	    || patch != DBXML_VERSION_PATCH) {
+-	    rb_raise(rb_eNotImpError, "\nBDB::XML needs compatible versions of DbXml\n\tyou have DbXml.hpp version %d.%d.%d and libdbxml version %d.%d.%d\n",
+-		     DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
+-		     major, minor, patch);
++	version = rb_tainted_str_new2(dbxml_version(&major, &minor));
++	if (major != DBXML_VERSION_MAJOR || minor != DBXML_VERSION_MINOR) {
++	    rb_raise(rb_eNotImpError, "\nBDB::XML needs compatible versions of DbXml\n\tyou have DbXml.hpp version %d.%d and libdbxml version %d.%d\n",
++		     DB_VERSION_MAJOR, DB_VERSION_MINOR,
++		     major, minor);
+ 	}
+ 
+ 	xb_eFatal = rb_const_get(xb_mDb, rb_intern("Fatal"));
+@@ -2374,7 +2371,6 @@
+ 	rb_define_const(xb_mXML, "VERSION", version);
+ 	rb_define_const(xb_mXML, "VERSION_MAJOR", INT2FIX(major));
+ 	rb_define_const(xb_mXML, "VERSION_MINOR", INT2FIX(minor));
+-	rb_define_const(xb_mXML, "VERSION_PATCH", INT2FIX(patch));
+ #ifdef DBXML_CHKSUM_SHA1
+ 	rb_define_const(xb_mXML, "CHKSUM_SHA1", INT2NUM(DBXML_CHKSUM_SHA1));
+ #endif

Added: head/databases/ruby-bdb/files/patch-bdbxml2__bdbxml.cc
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/databases/ruby-bdb/files/patch-bdbxml2__bdbxml.cc	Thu Jan  2 20:12:09 2014	(r338488)
@@ -0,0 +1,48 @@
+--- ./bdbxml2/bdbxml.cc.orig	2011-04-06 19:35:39.000000000 +0000
++++ ./bdbxml2/bdbxml.cc	2013-12-18 19:00:54.677253900 +0000
+@@ -5510,7 +5510,7 @@
+ 
+     void Init_bdbxml()
+     {
+-	int major, minor, patch;
++	int major, minor;
+ 	VALUE version;
+ #ifdef BDB_LINK_OBJ
+ 	extern void Init_bdb();
+@@ -5535,19 +5535,16 @@
+ 	xb_mDb = rb_const_get(rb_cObject, rb_intern("BDB"));
+ 	major = NUM2INT(rb_const_get(xb_mDb, rb_intern("VERSION_MAJOR")));
+ 	minor = NUM2INT(rb_const_get(xb_mDb, rb_intern("VERSION_MINOR")));
+-	patch = NUM2INT(rb_const_get(xb_mDb, rb_intern("VERSION_PATCH")));
+-	if (major != DB_VERSION_MAJOR || minor != DB_VERSION_MINOR
+-	    || patch != DB_VERSION_PATCH) {
+-	    rb_raise(rb_eNotImpError, "\nBDB::XML needs compatible versions of BDB\n\tyou have BDB::XML version %d.%d.%d and BDB version %d.%d.%d\n",
+-		     DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
+-		     major, minor, patch);
++	if (major != DB_VERSION_MAJOR || minor != DB_VERSION_MINOR) {
++	    rb_raise(rb_eNotImpError, "\nBDB::XML needs compatible versions of BDB\n\tyou have BDB::XML version %d.%d and BDB version %d.%d\n",
++		     DB_VERSION_MAJOR, DB_VERSION_MINOR,
++		     major, minor);
+ 	}
+-	version = rb_tainted_str_new2(dbxml_version(&major, &minor, &patch));
+-	if (major != DBXML_VERSION_MAJOR || minor != DBXML_VERSION_MINOR
+-	    || patch != DBXML_VERSION_PATCH) {
+-	    rb_raise(rb_eNotImpError, "\nBDB::XML needs compatible versions of DbXml\n\tyou have DbXml.hpp version %d.%d.%d and libdbxml version %d.%d.%d\n",
+-		     DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
+-		     major, minor, patch);
++	version = rb_tainted_str_new2(dbxml_version(&major, &minor));
++	if (major != DBXML_VERSION_MAJOR || minor != DBXML_VERSION_MINOR) {
++	    rb_raise(rb_eNotImpError, "\nBDB::XML needs compatible versions of DbXml\n\tyou have DbXml.hpp version %d.%d and libdbxml version %d.%d\n",
++		     DB_VERSION_MAJOR, DB_VERSION_MINOR,
++		     major, minor);
+ 	}
+ 
+         xb_mObs = rb_const_get(rb_cObject, rb_intern("ObjectSpace"));
+@@ -5604,7 +5601,6 @@
+ 	rb_define_const(xb_mXML, "VERSION", version);
+ 	rb_define_const(xb_mXML, "VERSION_MAJOR", INT2FIX(major));
+ 	rb_define_const(xb_mXML, "VERSION_MINOR", INT2FIX(minor));
+-	rb_define_const(xb_mXML, "VERSION_PATCH", INT2FIX(patch));
+ #if HAVE_DBXML_CONST_DBXML_ADOPT_DBENV
+         rb_define_const(xb_mXML, "ADOPT_DBENV", INT2NUM(DBXML_ADOPT_DBENV));
+ #endif

Modified: head/databases/ruby-bdb/files/patch-extconf.rb
==============================================================================
--- head/databases/ruby-bdb/files/patch-extconf.rb	Thu Jan  2 20:09:36 2014	(r338487)
+++ head/databases/ruby-bdb/files/patch-extconf.rb	Thu Jan  2 20:12:09 2014	(r338488)
@@ -1,5 +1,5 @@
---- extconf.rb.orig	2011-08-22 22:53:57.000000000 -0700
-+++ extconf.rb	2011-08-22 22:54:10.000000000 -0700
+--- ./extconf.rb.orig	2011-04-06 19:35:39.000000000 +0000
++++ ./extconf.rb	2013-12-18 19:00:54.688254572 +0000
 @@ -50,7 +50,7 @@
  rdoc: docs/doc/index.html
  

Added: head/databases/ruby-bdb/files/patch-src__bdb.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/databases/ruby-bdb/files/patch-src__bdb.c	Thu Jan  2 20:12:09 2014	(r338488)
@@ -0,0 +1,26 @@
+--- ./src/bdb.c.orig	2011-04-06 19:35:39.000000000 +0000
++++ ./src/bdb.c	2013-12-18 19:04:39.134238326 +0000
+@@ -166,11 +166,10 @@
+ 	rb_raise(rb_eNameError, "module already defined");
+     }
+     version = rb_tainted_str_new2(db_version(&major, &minor, &patch));
+-    if (major != DB_VERSION_MAJOR || minor != DB_VERSION_MINOR
+-	|| patch != DB_VERSION_PATCH) {
+-        rb_raise(rb_eNotImpError, "\nBDB needs compatible versions of libdb & db.h\n\tyou have db.h version %d.%d.%d and libdb version %d.%d.%d\n",
+-		 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
+-		 major, minor, patch);
++    if (major != DB_VERSION_MAJOR || minor != DB_VERSION_MINOR) {
++        rb_raise(rb_eNotImpError, "\nBDB needs compatible versions of libdb & db.h\n\tyou have db.h version %d.%d and libdb version %d.%d\n",
++		 DB_VERSION_MAJOR, DB_VERSION_MINOR,
++		 major, minor);
+     }
+     bdb_mMarshal = rb_const_get(rb_cObject, rb_intern("Marshal"));
+     bdb_id_current_db = rb_intern("__bdb_current_db__");
+@@ -189,7 +188,6 @@
+     rb_define_const(bdb_mDb, "VERSION", version);
+     rb_define_const(bdb_mDb, "VERSION_MAJOR", INT2FIX(major));
+     rb_define_const(bdb_mDb, "VERSION_MINOR", INT2FIX(minor));
+-    rb_define_const(bdb_mDb, "VERSION_PATCH", INT2FIX(patch));
+     rb_define_const(bdb_mDb, "VERSION_NUMBER", INT2NUM(BDB_VERSION));
+ #if HAVE_CONST_DB_BTREE
+     rb_define_const(bdb_mDb, "BTREE", INT2FIX(DB_BTREE));
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 6 Steve Wills freebsd_committer 2014-01-02 20:27:05 UTC
State Changed
From-To: open->closed

Fix committed.