Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 198555

Summary: database useflags should be in dev-ruby/activerecord, not dev-ruby/rails
Product: Gentoo Linux Reporter: Alexandre Perrin <makoto.kaworu>
Component: New packagesAssignee: Gentoo Ruby Team <ruby>
Status: RESOLVED FIXED    
Severity: minor    
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 202013    
Attachments: patch for activerecord ebuild to add db uses flags
patch for rails ebuild that remove db uses flags

Description Alexandre Perrin 2007-11-09 13:43:00 UTC
Rails has db uses flags "mysql postgres sqlite sqlite3" but actually
rails has nothing to do with db. It's activerecord that "need" an
db adapter to work.

I installed rails with the postgres useflags, then I wanted to play
a little bit with camping and sqlite3, but camping has no db use flags
(then sqlite3-ruby was not installed) nor activerecord. The only solution was
to emerge sqlite3-ruby by hand.

I thought that the "thing to do" was to add some db uses flags to camping,
but I realized that some other packages that depends on activerecord might
have the same "problem". Here is the list of the packages I founded 
(poor grep in dev-ruby portage tree) that depends on activerecord :

rails
camping
ruby-activeldap
actionwebservice
adhearsion

Only rails have db use flags, and add db uses flags to all these packages is
probably not a good idea since someone can emerge only activerecord and then
still having no db adapter, and it's a lot of work to maintain (if activerecord 
add support for another db, you have to modify all ebuilds that
depends on activerecord, it's weird).

The best may be to move the db use flags from rails ebuild to activerecord
ebuild, here are two patches : one for activerecord (current stable version)
and one for rails (current stable version). Patches just move the uses flags
and db adapter dependencies from rails to activerecord.

thanks for reading and have a nice day :)

Reproducible: Always
Comment 1 Alexandre Perrin 2007-11-09 13:44:32 UTC
Created attachment 135585 [details, diff]
patch for activerecord ebuild to add db uses flags
Comment 2 Alexandre Perrin 2007-11-09 13:45:26 UTC
Created attachment 135586 [details, diff]
patch for rails ebuild that remove db uses flags
Comment 3 Hans de Graaff gentoo-dev Security 2007-11-10 07:42:13 UTC
This makes sense to me. Thanks for digging around and providing patches, Alexandre.

Richard, Joshua, any comments from your side on this? Will this break anything already in the tree?
Comment 4 Josh Nichols (RETIRED) gentoo-dev 2007-11-16 17:15:44 UTC
This seems pretty reasonable to me. Two points though:

 * There should be revision bumps for both packages.
 * Rails should have a post-install message about the use flags moving.
Comment 5 Alexandre Perrin 2007-12-18 11:53:11 UTC
fixed in rails 2.0.2
Comment 6 Hans de Graaff gentoo-dev Security 2007-12-18 17:17:00 UTC
Re-opening. The issue is not yet fixed for Rails 1.2.x, and furthermore packages depending on activerecord should be properly notified.
Comment 7 Hans de Graaff gentoo-dev Security 2008-11-30 15:36:43 UTC
Closing this as all new versions of activerecord now carry the USE flags. All packages that depend on activerecord have no database-related USE flags, which is correct.

The only exception is metasploit, but that is strongly linked to Rails 1.2, which does not have these USE flags yet.