Gentoo emerge conflicts: SQLite and dev-perl/DBD-SQLite

February 13th, 2010 by Sjan Evardsson

I was having issues with my regular update schedule on my Gentoo server where I kept getting the following message:
('ebuild', '/', 'dev-db/sqlite-3.6.22-r2', 'merge') conflicts with
=dev-db/sqlite-3.6.22[extensions] required by ('installed', '/', 'dev-perl/DBD-SQLite-1.29-r2', 'nomerge')

Since I use SQLite fairly regularly and I like to keep it up to date I figured I would focus on getting that updated, then worry about the Perl SQLite. (Had I known that spamassassin relies on the Perl SQLite I may have been a little more hesitant, but it all worked out ok anyway.)

Here is how I managed to update both SQLite and the Perl SQLite. I first unmerged dev-perl/DBD-SQLite with:
emerge --unmerge dev-perl/DBD-SQLite

I then updated SQLite with:
emerge -u sqlite

Which changed the USE settings to “-extensions” which meant that when I tried to emerge DBD-SQLite it failed due to the missing USE requirements. So I took a stab at it and did:
USE="extensions" emerge sqlite
Which built cleanly without any problems, and after which a quick
emerge dev-perl/DBD-SQLite worked great.

So, in a quick and easy cut and paste format the work-around is:
emerge --unmerge DBD-SQLite
emerge -u sqlite
USE="extensions" emerge sqlite
emerge DBD-SQLite

Why the work-around is required I don’t know at the moment as I don’t have the time to dig through the ebuild files and figure out where the issue is, although I am sure if I had waited a bit updated ebuild files will come down the pipeline to correct the issue. (Patience is a virtue, but I have never been all that virtuous.)

Post to Twitter Post to Yahoo Buzz Buzz This Post Post to Delicious Delicious Post to Digg Digg This Post Post to Ping.fm Ping This Post Post to Reddit Reddit Post to StumbleUpon Stumble This Post

New Project: SPDO

January 28th, 2009 by Sjan Evardsson

I have just posted the (embarrassingly empty) page for my new pet project: SPDO (Sjan’s PDO) – in two flavors: PHP and Python.

There are only about a thousand PDOs out there, and perhaps a dozen or so of them are really functional and (in a few cases) very polished pieces of work. So why am I messing with writing my own? A couple of reasons:

  1. I like to have coding signatures that are consistent, whether I am working with PostgreSQL, MySQL or (heaven help us all) SQLite.
  2. I like to have coding signatures that are (reasonably) consistent across different languages – in this case Python and PHP.
  3. I wanted to take advantage of Prepared Statements where I could, even though the PHP implementations of those are pretty weak (especially in the case of MySQL).

Currently implemented in

  • Python:
    • PostgreSQL (with prepared statements)
    • SQLite (no prepared statements).
  • PHP
    • PostgreSQL (with prepared statements)
    • MySQL (with prepared statements)
    • SQLite (no prepared statements)

Here’s an example of how they work (in most simplistic terms):

Python [Show Plain Code]:
  1. #in Python
  2. from pyDB import *
  3. db = pyDB(‘mysite’)
  4. newid = db.insert(‘INSERT INTO test (name, value) VALUES (?,?)’,[‘foo’,‘bar’])
  5. update_count = db.update(‘UPDATE test SET value=? WHERE id=?’,[‘baz’,newid])
  6. results = db.select(‘SELECT * FROM test’)
  7. for row in results:
  8.     for i in row:
  9.         print "\t", i,"\t", row[i]
  10. delete_count = db.delete(‘DELETE FROM test WHERE id=?’,[newid])
  1. //in PHP
  2. require_once(‘phpdb.php’);
  3. $db = new phpDB(‘test’);
  4. $newid = $db->insert(‘INSERT INTO test (name, value) VALUES (?,?)’,array(‘foo’,‘bar’));
  5. $update_count = $db->update(‘UPDATE test SET value=? WHERE id=?’,array(‘baz’,newid));
  6. $results = db->select(‘SELECT * FROM test’);
  7. foreach($results as $row)
  8. {
  9.     foreach ($row as $key=>$val)
  10.     {
  11.         print "\t$key\t$val";
  12.     }
  13. }
  14. $delete_count = $db->delete(‘DELETE FROM test WHERE id=?’,array($newid));

The page with links to the code is in the list up top, and everything is MIT license. Enjoy.

Post to Twitter Post to Yahoo Buzz Buzz This Post Post to Delicious Delicious Post to Digg Digg This Post Post to Ping.fm Ping This Post Post to Reddit Reddit Post to StumbleUpon Stumble This Post