Skip to contentSkip to conversation

setup.py: install prserv too

PATCH Applied Martin Jansa 2 participants 4 messages Jan 15, 2012 – Jan 20, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 setup.py: install prserv too

* otherwise cooker fails:
Traceback (most recent call last):
File /usr/bin/bitbake, line 39, in <module>
from bb import cooker
File /usr/lib64/python2.7/site-packages/bb/cooker.py, line 39, in <module>
import prserv.serv
ImportError: No module named prserv.serv

---
 setup.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
setup.py +2 -2
index 038dd87..7921811 100755
@@ -54,9 +54,9 @@ setup(name='bitbake',
       requires = ["ply", "progressbar"],
       package_dir = {"": "lib"},
       packages = ["bb.server", "bb.parse.parse_py", "bb.parse", "bb.fetch",
-                  "bb.fetch2", "bb.ui.crumbs", "bb.ui", "bb.pysh", "bb"],
+                  "bb.fetch2", "bb.ui.crumbs", "bb.ui", "bb.pysh", "bb", "prserv"],
       py_modules = ["codegen"],
-      scripts = ["bin/bitbake", "bin/bitbake-layers", "bin/bitbake-diffsigs"],
+      scripts = ["bin/bitbake", "bin/bitbake-layers", "bin/bitbake-diffsigs", "bin/bitbake-prserv"],
       data_files = [("share/bitbake", glob("conf/*") + glob("classes/*")),
                   ("share/doc/bitbake-%s/manual" % __version__, glob("doc/manual/html/*"))],
       cmdclass = {
Signature · 1 line
1.7.8.3
#1 lore raw

PATCH 2/2 prserv: fix import of sqlite3

* this is used in all other bitbake parts where sqlite3 is used, don't know why it wasn't used here, but it fails e.g. on Gentoo Traceback (most recent call last):
File "bin/bitbake", line 39, in <module>
from bb import cooker
File "lib/bb/cooker.py", line 39, in <module>
import prserv.serv
File "lib/prserv/serv.py", line 4, in <module>
import xmlrpclib,sqlite3
ImportError: No module named sqlite3

---
 lib/prserv/serv.py |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
lib/prserv/serv.py +6 -1
index a759fa7..fa437f9 100644
@@ -1,7 +1,12 @@
 import os,sys,logging
 import signal, time, atexit, threading
 from SimpleXMLRPCServer import SimpleXMLRPCServer, SimpleXMLRPCRequestHandler
-import xmlrpclib,sqlite3
+import xmlrpclib
+
+try:
+    import sqlite3
+except ImportError:
+    from pysqlite2 import dbapi2 as sqlite3
 
 import bb.server.xmlrpc
 import prserv
Signature · 1 line
1.7.8.3
#2 lore raw

Re: [PATCH 2/2] prserv: fix import of sqlite3

Quoted 11 lines · Martin Jansa

* this is used in all other bitbake parts where sqlite3 is used, don't know why it wasn't used here, but it fails e.g. on Gentoo Traceback (most recent call last):
File "bin/bitbake", line 39, in <module>
from bb import cooker
File "lib/bb/cooker.py", line 39, in <module>
import prserv.serv
File "lib/prserv/serv.py", line 4, in <module>
import xmlrpclib,sqlite3
ImportError: No module named sqlite3

Quoted 4 lines
---
 lib/prserv/serv.py |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

Merged to master along with 1/2.

Why this is needed I'm not sure since I thought sqlite3 was included in python 2.6 onwards. Since you're running into it and it doesn't hurt anything I've merged it though.

Cheers,

Richard

#3 lore raw

Re: [PATCH 2/2] prserv: fix import of sqlite3

Quoted 17 lines · Richard Purdie
Quoted 11 lines · Martin Jansa

* this is used in all other bitbake parts where sqlite3 is used, don't know why it wasn't used here, but it fails e.g. on Gentoo Traceback (most recent call last):
File "bin/bitbake", line 39, in <module>
from bb import cooker
File "lib/bb/cooker.py", line 39, in <module>
import prserv.serv
File "lib/prserv/serv.py", line 4, in <module>
import xmlrpclib,sqlite3
ImportError: No module named sqlite3

Quoted 4 lines
---
 lib/prserv/serv.py |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
Quoted 5 lines

Merged to master along with 1/2.

Why this is needed I'm not sure since I thought sqlite3 was included in python 2.6 onwards. Since you're running into it and it doesn't hurt anything I've merged it though.

In gentoo there is USE flag for sqlite support which is off by default, so it's easy to get even newer python like 2.7 or 3* without sqlite enabled by default and extra package dev-python/pysqlite providing alternative.

I guess correct fix would be to change bitbake .ebuild to depend on python with sqlite USE flag enabled, but as it was catched and fixed in other places in bitbake code I've added it here too.

Cheers,

Quoted 5 lines

Cheers,

Richard

Signature · 1 line
Martin 'JaMa' Jansa     jabber: [email protected]