maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   Packaging with py2deb - post/preinstall script woes (https://talk.maemo.org/showthread.php?t=44016)

zerojay 2010-02-10 14:15

Packaging with py2deb - post/preinstall script woes
 
I'm using py2deb for packaging and I'm running into two problems.

1) My package isn't meant to actually install anything. All it does is edit the Internet Radio database. If my src folder is empty, the package doesn't get built. As a workaround, I've added a small dummy file to be installed/removed.

2) I cannot get pre/post install or pre/post remove scripts to run whatsoever. I've tried several different forms of the line and nothing has worked out for me. So those of you that are using it, what line are you using exactly?

(qole, I checked out your build script and your solution didn't work for me either.)

Here's the error I get:
dpkg (subprocess): unable to execute new pre-installation script: Exec format error
subprocess pre-installation script returned error exit status 2

The package is in extras-devel as "digitallyimported", so you can try it yourself to see the errors generated.

The line I'm using right now, which also isn't working is:
p.preinstall = "preinst.sh"
p.preremove = "prerm.sh"

Any ideas?

mikkov 2010-02-10 14:39

Re: Packaging with py2deb - post/preinstall script woes
 
Well preinst script contains one line "preinst.sh", which obviously won't work. btw src folder isn't empty, there is /home/user/.difm file.

My idea is to forget py2deb and just write your scripts directly where they belong.

zerojay 2010-02-10 14:43

Re: Packaging with py2deb - post/preinstall script woes
 
Quote:

Originally Posted by mikkov (Post 519474)
Well preinst script contains one line "preinst.sh", which obviously won't work. btw src folder isn't empty, there is /home/user/.difm file.

My idea is to forget py2deb and just write your scripts directly where they belong.

I know that src isn't empty. I put .difm in there to avoid the issue where it wouldn't build without a file there.

Write my scripts directly where they belong? I have no idea what that even means. Where do my scripts belong then? :)

Other packages used what I did above and apparently work.

Thanks, I guess I'll just write it all directly into the build file... it's going to end up HUGE. lol

mikkov 2010-02-10 15:01

Re: Packaging with py2deb - post/preinstall script woes
 
Quote:

Originally Posted by zerojay (Post 519486)
I know that src isn't empty. I put .difm in there to avoid the issue where it wouldn't build without a file there.

Well put it at least somewhere else than user's home directory.

Quote:

Originally Posted by zerojay (Post 519486)
Write my scripts directly where they belong? I have no idea what that even means. Where do my scripts belong then? :)

There is debian/preinst and debian/prerm files in your source package. But I gues py2deb users never see the source package contents.

epage 2010-02-10 15:04

Re: Packaging with py2deb - post/preinstall script woes
 
its hard for me to comment much, I'm running a forked version of py2deb (I need to get my changes integrated upstream...).

I think py2deb supports both specifying the a file for the scripts or taking in the script body. I've not tried specifying a file but I have successfully specified the body of the script and have been doing so long before I forked py2deb.

zerojay 2010-02-10 15:16

Re: Packaging with py2deb - post/preinstall script woes
 
Quote:

Originally Posted by epage (Post 519524)
its hard for me to comment much, I'm running a forked version of py2deb (I need to get my changes integrated upstream...).

I think py2deb supports both specifying the a file for the scripts or taking in the script body. I've not tried specifying a file but I have successfully specified the body of the script and have been doing so long before I forked py2deb.

Yeah, I just decided to throw it all into the build_whatever.py script and see how it goes. What changes did you make to your forked version of py2deb?

zerojay 2010-02-10 16:07

Re: Packaging with py2deb - post/preinstall script woes
 
Quote:

Originally Posted by mikkov (Post 519516)
Well put it at least somewhere else than user's home directory.

Okay, since I now have the scripts working, where do you think I should put my little empty file to satisfy py2deb?

epage 2010-02-10 16:12

Re: Packaging with py2deb - post/preinstall script woes
 
Quote:

Originally Posted by zerojay (Post 519544)
Yeah, I just decided to throw it all into the build_whatever.py script and see how it goes. What changes did you make to your forked version of py2deb?

I can't really remember these days. I went up-upstream (generic debian version). I fixed some bugs in it, merged in the Maemo changes, made it all work on the desktop, made it all one file, added all of the maemo specific fields, added some recommends fields, etc. I don't know how many changes are now in the Maemo version of py2deb.

twaelti 2010-02-10 16:21

Re: Packaging with py2deb - post/preinstall script woes
 
@epage: Did you never get back in contact with Khertan?
(IIRC we were in contact about this some weeks ago)

twaelti 2010-02-10 16:23

Re: Packaging with py2deb - post/preinstall script woes
 
Quote:

Originally Posted by zerojay (Post 519632)
Okay, since I now have the scripts working, where do you think I should put my little empty file to satisfy py2deb?

What happens if you put a dummy file into your src/dev/null subfolder ? I know that /null is not a folder, but perhaps it works?

zerojay 2010-02-10 16:24

Re: Packaging with py2deb - post/preinstall script woes
 
Quote:

Originally Posted by twaelti (Post 519660)
What happens if you put a dummy file into your src/dev/null subfolder ?

I thought about doing that, but wouldn't that cause uninstall to fail when it can't find the file?

twaelti 2010-02-10 16:26

Re: Packaging with py2deb - post/preinstall script woes
 
No idea :-)

epage 2010-02-10 16:38

Re: Packaging with py2deb - post/preinstall script woes
 
Quote:

Originally Posted by twaelti (Post 519655)
@epage: Did you never get back in contact with Khertan?
(IIRC we were in contact about this some weeks ago)

Life got busy around that time :(

shin 2010-03-04 16:30

Re: Packaging with py2deb - post/preinstall script woes
 
hello

the issue I have with py2deb is not with the post/preinstall script, but with the package section.. I have a desktop widget for diablo in extras-devel that I am trying to promote..

while packaging with py2deb, I tried the below which resulted in errors that the 'user/desktop' section does not exist..
Code:

p.section="user/desktop"
So I ended up using
Code:

p.section="user/accessories"
With this I could succesfully upload to extras-devel.. However when I try to promote it to extras, I get a msg that
Quote:

Warning: This package is not using one of the allowed user/* sections!
Could some one pls tell me how I can select the right section here and I think the right section here would be "user/desktop"

krk969 2010-03-04 17:22

Re: Packaging with py2deb - post/preinstall script woes
 
Quote:

Originally Posted by shin (Post 555694)
Could some one pls tell me how I can select the right section here and I think the right section here would be "user/desktop"

you can find the sections for your packaging here

shin 2010-03-05 07:21

Re: Packaging with py2deb - post/preinstall script woes
 
Thank you krk969

I did refer to this section classification. But the issue was that py2deb would not allow me to use "user/desktop", so I resorted to using "user/accessories". Using accessories section resulted in a warning msg in the packages interface.

I managed to find a work around by editing the py2deb.py file to include the "user/desktop" section. but I still have some issues in the packages interface as mentioned here

Thanks anyways for your time


All times are GMT. The time now is 19:12.

vBulletin® Version 3.8.8