maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   packaging with py2deb (https://talk.maemo.org/showthread.php?t=39646)

nux 2010-01-07 21:10

packaging with py2deb
 
Tried to package a python program directly in N900 but got an error.

traceback (most recent call last):
File "build_fSchedule.py", line 54, in <module>
p[real_dir] = fake_file
File "/usr/lib/python2.5/site-packages/py2deb.py", line 90, in __setitem__
raise Py2debException("key path '%s' malformed (don't start with '/')"%path)
py2deb.Py2debException: key path '' malformed (don't start with '/')

Did everything that was written here: http://wiki.maemo.org/Py2deb
Is that information valid for fremantle?
Or is there something more to to?

convulted 2010-01-07 21:16

Re: packaging with py2deb
 
It would help if you could post build_fSchedule.py. Without further information, though, it seems you have some path specified that starts with a "/" when it shouldn't; most probably dir_name, given where the error occured. In my case, I have quite simply:

dir_name = "src"

HTH,
André

nux 2010-01-07 21:24

Re: packaging with py2deb
 
1 Attachment(s)
Quote:

Originally Posted by convulted (Post 458108)
It would help if you could post build_fSchedule.py. Without further information, though, it seems you have some path specified that starts with a "/" when it shouldn't; most probably dir_name, given where the error occured. In my case, I have quite simply:

dir_name = "src"

HTH,
André

attached :)

convulted 2010-01-07 21:31

Re: packaging with py2deb
 
Hmm I can't see the problem; I have successfully used py2deb on Fremantle several times. Are you running it in the correct directory?

nux 2010-01-07 21:45

Re: packaging with py2deb
 
Quote:

Originally Posted by convulted (Post 458156)
Hmm I can't see the problem; I have successfully used py2deb on Fremantle several times. Are you running it in the correct directory?

Yes I'm running it from directory where build_fSchedule.py is.
and in that dir there is src dir where source file and png is.
tryed 3 different ways:
run-standalone.sh python2.5 /home/user/MyDocs/Python/fschedule/build_fSchedule.py
run-standalone.sh python2.5 ./build_fSchedule.py
run-standalone.sh python2.5 build_fSchedule.py

DO I need desktop and service file also?
And I don't understand that http://wiki.maemo.org/Py2deb#Example...lder_structure, do I need to create all these files in that locations?

convulted 2010-01-07 21:47

Re: packaging with py2deb
 
What I did was to SSH into the phone and execute:

python build.py

That seemed to work for me.

nux 2010-01-07 21:55

Re: packaging with py2deb
 
Program is running just fine with python fschedule.py.
But I want to package it and upload to garage and then to extras-devel and just can't package it :)

convulted 2010-01-07 22:02

Re: packaging with py2deb
 
Quote:

Originally Posted by nux (Post 458205)
Program is running just fine with python fschedule.py.
But I want to package it and upload to garage and then to extras-devel and just can't package it :)

I can't understand why you are running the py2deb script via run-standalone.sh. I run THAT script (not the program) directly from python on the device.

nux 2010-01-07 22:28

Re: packaging with py2deb
 
Quote:

Originally Posted by convulted (Post 458220)
I can't understand why you are running the py2deb script via run-standalone.sh. I run THAT script (not the program) directly from python on the device.

I got it from there: http://wiki.maemo.org/Py2deb#Run_you..._myapp.py_code

But now we are getting somewhere.
first sudo gainroot, because got same error as before when running as normal user

And now I'm getting that when running "python build_fSchedule.py":
Process 4383: arguments to dbus_connection_get_data() were incorrect, assertion "connection != NULL" failed in file dbus-connection.c line 5757.
This is normally a bug in some application using the D-Bus library.
process 4383: arguments to dbus_connection_set_data() were incorrect, assertion "connection != NULL" failed in file dbus-connection.c line 5721.
This is normally a bug in some application using the D-Bus library.
Aborted

THavoc 2010-01-09 21:30

Re: packaging with py2deb
 
Quote:

Originally Posted by nux (Post 458182)
DO I need desktop and service file also?
And I don't understand that http://wiki.maemo.org/Py2deb#Example...lder_structure, do I need to create all these files in that locations?

Yes, you need the whole structure (under your src folder) and all the files in that list (desktop, service, icons, etc)

THavoc 2010-01-09 21:32

Re: packaging with py2deb
 
Quote:

Originally Posted by nux (Post 458283)
And now I'm getting that when running "python build_fSchedule.py":

try it like this:

run-standalone.sh python build_fSchedule.py

dwould 2010-01-24 15:44

Re: packaging with py2deb
 
hmm, I've used py2deb many times to package witter, and today I'm seeing the same error as mentioned in this thread. I suspect something may have changed in the underlying py2deb package that has regressed function. Not exactly sure what is wrong, will see if I can figure it out

dwould 2010-01-24 15:53

Re: packaging with py2deb
 
ok, so the problem seems to be there is aline in py2deb line 90 which is a new check to see if the path it's been passed starts with a /
the problem here is that the py2deb script given in the devel pages which were linked to earlier says to set the dir to "src"
where src is a subfolder of the current folder holding your project.

the check is wrong because the text says DON'T start with a / but the it actually checks you MUST start with a /

so I reversed the logic, but it then immediately falls over with the subfolders of src which it gets pass with the leading /

so I just commented out the whole check and everything appears to run fine. I'm not sure what this was trying to protect against, but it's broken.

mwerle 2010-01-24 19:04

Re: packaging with py2deb
 
JFYI, I just moved my packaging script from py2deb to the current version of pypackager.

EDIT: The following note concerned py2deb, and not the current version of pypackager, which works great without any hacks. I got confused by playing with both packagers simultaneously.

On my n900 environment, it complained about an 'import *' in the script, but after commenting that out it works great - generates the source tarball as well as a finished deb package to try out before uploading to the autobuilder.

/usr/lib/python2.5/site-packages/py2deb.py - comment out line #635:
Code:

          #from subprocess import *


All times are GMT. The time now is 02:10.

vBulletin® Version 3.8.8