Bug 188084 - ports-mgmt/portupgrade : not working without ruby-bdb
Summary: ports-mgmt/portupgrade : not working without ruby-bdb
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: Bryan Drewery
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-30 15:20 UTC by Christoph Moench-Tegeder
Modified: 2014-10-13 17:08 UTC (History)
0 users

See Also:


Attachments
file.diff (377 bytes, patch)
2014-03-30 15:20 UTC, Christoph Moench-Tegeder
no flags Details | Diff
file.diff (1.63 KB, patch)
2014-03-30 15:20 UTC, Christoph Moench-Tegeder
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Christoph Moench-Tegeder freebsd_committer freebsd_triage 2014-03-30 15:20:00 UTC
	When upgrading my ruby stack to ruby 2.1, I disconvered that ruby-bdb
	is utterly broken with recent versions of ruby (ports/188083).
	Trying to use portupgrade without ruby-bdb gave me

: /usr/local/lib/ruby/site_ruby/2.1/pkgtools/pkgdbtools.rb:104:in `rescue in db_driver=': uninitialized constant PkgDBTools::DBError (NameError)
:         from /usr/local/lib/ruby/site_ruby/2.1/pkgtools/pkgdbtools.rb:63:in `db_driver='
:         from /usr/local/lib/ruby/site_ruby/2.1/pkgtools/portsdb.rb:168:in `setup'
:         from /usr/local/lib/ruby/site_ruby/2.1/pkgtools/pkgtools.rb:242:in `init_pkgtools_global'
:         from /usr/local/sbin/portupgrade:530:in `block in main'
:         from /usr/local/lib/ruby/2.1/optparse.rb:880:in `initialize'
:         from /usr/local/sbin/portupgrade:237:in `new'
:         from /usr/local/sbin/portupgrade:237:in `main'
:         from /usr/local/sbin/portupgrade:2371:in `<main>'

	so I set out to integrate yet another dbm into portupgrade.
	I happened to choose qdbm, which may not have been such a good idea,
	as ruby-qdbm itself is quite behind current ruby and needed
	patching, too (ports/188079).
	I'm proposing three patches:
	 1. do not try to use databases/ruby-bdb when on ruby 2.1 (it's already
	    blacklisted for ruby 2.0)
     2. explicitly stringify port_info when inserting it @db
        (portsdb.rb l.598) - some databases do not do that implicitly
     3. switch pkgtools to using qdbm (even as a default).
        I'm open to discussion and suggestions on this one (what DBM
        does the ruby community prefer these days?), as I'm not feeling
        too good about qdbm myself (see above).
        For the same reason I've not added ruby-qdbm as a dependency
        to portupgrade's Makefile.

Fix: Part 1, blacklist ruby-bdb for ruby 2.1:
Patches to be applied to the pkgtools source (not the port):
Part 2, explicitly stringify port_info:
Part 3, switch to qdbm:


Any thought?


Best Regards,
Christoph--ujbzuCUEguqUaBHdEscZ1GbCq2PIk6HZn7MexgJgdcpllO39
Content-Type: text/plain; name="file.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="file.diff"

Index: Makefile
===================================================================
--- Makefile	(revision 349592)
+++ Makefile	(working copy)
@@ -38,8 +38,8 @@
 INSTALL_TARGET+=	install-doc
 .endif
 
-# Reported that ruby-bdb is BROKEN with 2.0
-.if ${RUBY_VER} != 2.0
+# Reported that ruby-bdb is BROKEN with 2.0 and 2.1
+.if ${RUBY_VER} != 2.0 && ${RUBY_VER} != 2.1
 # For PKG_DBDRIVER={bdb_btree,bdb_hash}
 RUN_DEPENDS+=	${RUBY_SITEARCHLIBDIR}/bdb.so:${PORTSDIR}/databases/ruby-bdb
 .endif
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2014-03-30 15:20:05 UTC
Responsible Changed
From-To: freebsd-ports-bugs->bdrewery

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 Po-Chuan Hsieh freebsd_committer freebsd_triage 2014-03-30 17:46:26 UTC
Please test patch for databases/ruby-bdb [1] and ports-mgmt/portupgrade
[2]. Thanks!

[1] http://people.freebsd.org/~sunpoet/ruby-bdb.patch
    Ref: http://www.freebsd.org/cgi/query-pr.cgi?pr=188083
[2] http://people.freebsd.org/~sunpoet/portupgrade.patch

Regards,
sunpoet
Comment 3 dfilter service freebsd_committer freebsd_triage 2014-05-25 17:24:31 UTC
Author: bdrewery
Date: Sun May 25 16:24:26 2014
New Revision: 355252
URL: http://svnweb.freebsd.org/changeset/ports/355252
QAT: https://qat.redports.org/buildarchive/r355252/

Log:
  - Blacklist ruby-bdb with Ruby 2.1 [1]
  - Stop installing script(1) wrapper [2]
  - Fix ZSH dir leftover (somewhat a false-positive) [3]
  
  PR:		ports/188084 [1]
  Submitted by:	Christoph Moench-Tegeder <cmt@burggraben.net> [1]
  Submitted by:	sunpoet [2]
  Reported by:	swills [3]

Modified:
  head/ports-mgmt/portupgrade-devel/Makefile
  head/ports-mgmt/portupgrade-devel/pkg-plist
  head/ports-mgmt/portupgrade/Makefile
  head/ports-mgmt/portupgrade/pkg-plist

Modified: head/ports-mgmt/portupgrade-devel/Makefile
==============================================================================
--- head/ports-mgmt/portupgrade-devel/Makefile	Sun May 25 15:42:52 2014	(r355251)
+++ head/ports-mgmt/portupgrade-devel/Makefile	Sun May 25 16:24:26 2014	(r355252)
@@ -3,6 +3,7 @@
 
 PORTNAME=	portupgrade
 PORTVERSION=	20140524
+PORTREVISION=	1
 PORTEPOCH=	3
 CATEGORIES=	ports-mgmt
 MASTER_SITES=	GH \
@@ -40,18 +41,10 @@ INSTALL_TARGET+=	install-doc
 .endif
 
 # Reported that ruby-bdb is BROKEN with 2.0
-.if ${RUBY_VER} != 2.0
+.if ${RUBY_VER} != 2.0 && ${RUBY_VER} != 2.1
 RUN_DEPENDS+=	${RUBY_SITEARCHLIBDIR}/bdb.so:${PORTSDIR}/databases/ruby-bdb
 .endif
 
-# Need to install working script(1)
-.if ${OSVERSION} < 801000
-PLIST_SUB+=	SCRIPT=""
-MAKE_ENV+=	NEED_COMPAT_SCRIPT=yes
-.else
-PLIST_SUB+=	SCRIPT="@comment "
-.endif
-
 regression-test: patch
 	cd ${WRKSRC} && ${MAKE} test
 

Modified: head/ports-mgmt/portupgrade-devel/pkg-plist
==============================================================================
--- head/ports-mgmt/portupgrade-devel/pkg-plist	Sun May 25 15:42:52 2014	(r355251)
+++ head/ports-mgmt/portupgrade-devel/pkg-plist	Sun May 25 16:24:26 2014	(r355252)
@@ -47,15 +47,12 @@ sbin/portversion
 %%RUBY_SITELIBDIR%%/pkgtools/revision.rb
 %%RUBY_SITELIBDIR%%/pkgtools.rb
 @dirrm %%RUBY_SITELIBDIR%%/pkgtools
-%%SCRIPT%%@exec mkdir -p %D/libexec/pkgtools 2> /dev/null
-%%SCRIPT%%libexec/pkgtools/script
-%%SCRIPT%%@dirrm libexec/pkgtools
 @unexec if cmp -s %D/etc/pkgtools.conf %D/etc/pkgtools.conf.sample; then rm -f %D/etc/pkgtools.conf; fi
 etc/pkgtools.conf.sample
 @exec [ -f %B/pkgtools.conf ] || cp %B/%f %B/pkgtools.conf
 etc/pkgtools.status-pkg.sh
 share/zsh/site-functions/_pkgtools
-@unexec [ -f %D/bin/zsh ] || rmdir %D/share/zsh/site-functions 2>/dev/null || true
+@dirrmtry share/zsh/site-functions
 @dirrmtry share/zsh
 %%EXAMPLESDIR%%/bash/complete.sample
 %%EXAMPLESDIR%%/tcsh/complete.sample

Modified: head/ports-mgmt/portupgrade/Makefile
==============================================================================
--- head/ports-mgmt/portupgrade/Makefile	Sun May 25 15:42:52 2014	(r355251)
+++ head/ports-mgmt/portupgrade/Makefile	Sun May 25 16:24:26 2014	(r355252)
@@ -3,6 +3,7 @@
 
 PORTNAME=	portupgrade
 PORTVERSION=	2.4.12
+PORTREVISION=	1
 PORTEPOCH=	2
 CATEGORIES=	ports-mgmt
 MASTER_SITES=	SF/portupgrade/pkgtools/dist/ \
@@ -39,19 +40,11 @@ INSTALL_TARGET+=	install-doc
 .endif
 
 # Reported that ruby-bdb is BROKEN with 2.0
-.if ${RUBY_VER} != 2.0
+.if ${RUBY_VER} != 2.0 && ${RUBY_VER} != 2.1
 # For PKG_DBDRIVER={bdb_btree,bdb_hash}
 RUN_DEPENDS+=	${RUBY_SITEARCHLIBDIR}/bdb.so:${PORTSDIR}/databases/ruby-bdb
 .endif
 
-# Need to install working script(1)
-.if ${OSVERSION} < 801000
-PLIST_SUB+=	SCRIPT=""
-MAKE_ENV+=	NEED_COMPAT_SCRIPT=yes
-.else
-PLIST_SUB+=	SCRIPT="@comment "
-.endif
-
 post-install:
 	${MKDIR} ${STAGEDIR}${PREFIX}/lib/compat/pkg
 

Modified: head/ports-mgmt/portupgrade/pkg-plist
==============================================================================
--- head/ports-mgmt/portupgrade/pkg-plist	Sun May 25 15:42:52 2014	(r355251)
+++ head/ports-mgmt/portupgrade/pkg-plist	Sun May 25 16:24:26 2014	(r355252)
@@ -47,13 +47,10 @@ sbin/portversion
 %%RUBY_SITELIBDIR%%/pkgtools/revision.rb
 %%RUBY_SITELIBDIR%%/pkgtools.rb
 @dirrm %%RUBY_SITELIBDIR%%/pkgtools
-%%SCRIPT%%@exec mkdir -p %D/libexec/pkgtools 2> /dev/null
-%%SCRIPT%%libexec/pkgtools/script
-%%SCRIPT%%@dirrm libexec/pkgtools
 @sample etc/pkgtools.conf.sample
 etc/pkgtools.status-pkg.sh
 share/zsh/site-functions/_pkgtools
-@unexec [ -f %D/bin/zsh ] || rmdir %D/share/zsh/site-functions 2>/dev/null || true
+@dirrmtry share/zsh/site-functions
 @dirrmtry share/zsh
 %%EXAMPLESDIR%%/bash/complete.sample
 %%EXAMPLESDIR%%/tcsh/complete.sample
_______________________________________________
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 4 Bryan Drewery freebsd_committer freebsd_triage 2014-10-13 15:55:11 UTC
Dependency restored for ruby-bdb.
Comment 5 commit-hook freebsd_committer freebsd_triage 2014-10-13 15:55:29 UTC
A commit references this bug:

Author: bdrewery
Date: Mon Oct 13 15:55:00 UTC 2014
New revision: 370790
URL: https://svnweb.freebsd.org/changeset/ports/370790

Log:
  - Add dependency back for ruby-bdb for Ruby 2.0.

  PR:		188084
  PR:		185523

Changes:
  head/ports-mgmt/portupgrade/Makefile
  head/ports-mgmt/portupgrade-devel/Makefile
Comment 6 commit-hook freebsd_committer freebsd_triage 2014-10-13 17:08:43 UTC
A commit references this bug:

Author: bdrewery
Date: Mon Oct 13 17:07:45 UTC 2014
New revision: 370800
URL: https://svnweb.freebsd.org/changeset/ports/370800

Log:
  MFH: r370790

  - Add dependency back for ruby-bdb for Ruby 2.0.

  PR:		188084
  PR:		185523

Changes:
_U  branches/2014Q4/
  branches/2014Q4/ports-mgmt/portupgrade/Makefile
  branches/2014Q4/ports-mgmt/portupgrade-devel/Makefile