Hi,

actually, this bug is a bit different from what you've written.
opensync-plugin-moto is written in python, having a private library
motosync which is installed to /usr/lib/opensync/python-plugins.
As this dir is not in the default python path, the follwoing code in
mototool gets executed (the except part):

try:
    import motosync
except ImportError:
    # motosync wasn't in our standard import path
    # try looking in the opensync python plugin dir for it
    child = popen2.Popen3('pkg-config opensync-1.0 --variable=libdir')
    libdir = child.fromchild.readline().rstrip('\n')
    if child.wait() != 0 or not os.path.isdir(libdir):
        sys.stderr.write("Error: couldn't locate OpenSync library directory\n")
        sys.exit(1)
    sys.path.append(os.path.join(libdir, 'opensync', 'python-plugins'))
    import motosync

Of course, when libopensync0-dev isn't installed, 
`pkg-config opensync-1.0 --variable=libdir` fails and you get this nice error.

For quick-fixing this issue, I'd patch mototool to not call pkg-config
(which is neither in its depends btw!) but set libdir to /usr/lib (which allways
will be the output of pkg-config anyway).
The propper fix would be to use python-support or similar, but I do not know 
enough
about this and the change would be too big for a quick rc-fix.

Attached you'll find a quick-quick-fix for the issue.
(I've never worked with cdbs and simple-patchsys.)

Regards
Evgeni
diff -u libopensync-plugin-moto-0.22/debian/changelog libopensync-plugin-moto-0.22/debian/changelog
--- libopensync-plugin-moto-0.22/debian/changelog
+++ libopensync-plugin-moto-0.22/debian/changelog
@@ -1,3 +1,11 @@
+libopensync-plugin-moto (0.22-1.1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * Don't call pkg-config to find out, that Debian ships its libs in
+    /usr/lib. (Closes: #504866)
+
+ -- Evgeni Golov <[EMAIL PROTECTED]>  Fri, 07 Nov 2008 23:30:27 +0100
+
 libopensync-plugin-moto (0.22-1) unstable; urgency=low
 
   * New upstream release.
only in patch2:
unchanged:
--- libopensync-plugin-moto-0.22.orig/mototool
+++ libopensync-plugin-moto-0.22/mototool
@@ -12,11 +12,8 @@
 except ImportError:
     # motosync wasn't in our standard import path
     # try looking in the opensync python plugin dir for it
-    child = popen2.Popen3('pkg-config opensync-1.0 --variable=libdir')
-    libdir = child.fromchild.readline().rstrip('\n')
-    if child.wait() != 0 or not os.path.isdir(libdir):
-        sys.stderr.write("Error: couldn't locate OpenSync library directory\n")
-        sys.exit(1)
+    # hardcode libdir to /usr/lib as a workaround for #504866
+    libdir = '/usr/lib'
     sys.path.append(os.path.join(libdir, 'opensync', 'python-plugins'))
     import motosync
 

Reply via email to