maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   Debian package: postrm script causes errors (https://talk.maemo.org/showthread.php?t=56700)

direx 2010-06-20 19:52

Debian package: postrm script causes errors
 
Hi there,

I'd like to add a postrm script to my Debian package. The script ony contains a few lines:
Code:

#!/bin/sh
set -e
update-sudoers
#DEBHELPER#
exit 0

Unfortunately, the N900 does not seem to like the Debian package after adding this script:

Code:

Nokia-N900:/home/user# dpkg -i package_0.1-1_armel.deb
tar: short read
dpkg-deb: subprocess tar returned error exit status 1
dpkg: error processing package_0.1-1_armel.deb (--install):
 subprocess dpkg-deb --control returned error exit status 2
Errors were encountered while processing:
 qcpufreq_0.1-1_armel.deb
Nokia-N900:/home/user#

When I remove the postrm script and rebuild the Debian package, the N900 is able to install the app again.

Can anybody explain what could cause this behaviour?

juise- 2010-06-21 15:00

Re: Debian package: postrm script causes errors
 
This:

Code:

tar: short read
dpkg-deb: subprocess tar returned error exit status 1

hints that the actual package file might have been somehow damaged. Try re-building the package, and re-transferring it to your phone.

Or, it might be you're overclocking too much and that is causing random errors on the N900. (noted the app you are working on ;))

direx 2010-06-21 15:34

Re: Debian package: postrm script causes errors
 
Quote:

Originally Posted by juise- (Post 723713)
Try re-building the package, and re-transferring it to your phone.

I did that many times. I can even extract the package on the N900, but when I try to install it I always get this error.

Quote:

Originally Posted by juise- (Post 723713)
Or, it might be you're overclocking too much and that is causing random errors on the N900

I don't do any overclocking (and probaly never will) ;)

Thanks for the hints, though.

Joorin 2010-06-21 17:29

Re: Debian package: postrm script causes errors
 
Might it be the case that the tar archive gets created with a marker for the file but it's not actually added to it?

If tar fails to extract the files in the archive, you should start by finding out why. Perhaps you can play around with deb2tar and see what kind of tar file you get. If it looks broken, check how you create your package.

What tools are you using? Have you tried building the package with dpkg-deb --build <name of staging directory> ?

gri 2010-06-21 18:08

Re: Debian package: postrm script causes errors
 
I also had this error once. You might want to open the postrm script via "vi" on your device. If you see crippled line endings like "^M" or something, you have your errors (This happens especially when using Windows). If not, it's something different :)

direx 2010-06-21 18:26

Re: Debian package: postrm script causes errors
 
Quote:

Originally Posted by Joorin (Post 723881)
If tar fails to extract the files in the archive, you should start by finding out why. Perhaps you can play around with deb2tar and see what kind of tar file you get. If it looks broken, check how you create your package.

deb2tar works fine in both cases (with postrm and without it).

Quote:

Originally Posted by Joorin (Post 723881)
What tools are you using? Have you tried building the package with dpkg-deb --build <name of staging directory> ?

I'm using the latest Nokia Qt SDK. To build a package I simply use "mad dpkg-buildpackage" (mad is in my $PATH). I can only use mad, as I am not on a Debian-based distro (Gentoo).

Quote:

Originally Posted by gri
If you see crippled line endings like "^M" or something, you have your errors.

My postrm script looks fine. No fancy line endings.

Maybe somebody could take a look at the package. I have uploaded both versions:
http://www-user.tu-chemnitz.de/~klad....1-1_armel.deb
http://www-user.tu-chemnitz.de/~klad....1-1_armel.deb

Thanks for your help!

- Dan

qwerty12 2010-06-21 18:56

Re: Debian package: postrm script causes errors
 
Quote:

Originally Posted by direx (Post 722887)
Can anybody explain what could cause this behaviour?

I can only presume it's a MADDE problem as your package (cloned from your Git repo) built in Scratchbox - with the postrm script included - installed fine.

direx 2010-06-21 19:08

Re: Debian package: postrm script causes errors
 
Quote:

Originally Posted by qwerty12 (Post 723981)
I can only presume it's a MADDE problem as your package (cloned from your Git repo) built in Scratchbox - with the postrm script included - installed fine.

Thanks for the info. Did you add the postrm script after cloning the repo (postrm is not included, as it causes problems for me)?

If you did I'll file a bug about this and I'll give the extras-autobuilder a try for the next release.

qwerty12 2010-06-21 19:16

Re: Debian package: postrm script causes errors
 
1 Attachment(s)
Quote:

Originally Posted by direx (Post 723988)
Thanks for the info. Did you add the postrm script after cloning the repo (postrm is not included, as it causes problems for me)?

If you did I'll file a bug about this and I'll give the extras-autobuilder a try for the next release.

Yep. Cloned, copied your postrm script as debian/postrm and ran a dpkg-buildpackage.

FWIW, I've attached the deb that was built in Scratchbox.

too 2010-06-23 15:01

Re: Debian package: postrm script causes errors
 
Indeed, it fails to install on N900

when extracting on linux desktop pc (the components using ar)
everything works ok (tar's are on right size etc).

but... when copying control.tar (10240 bytes) to n900 and then
running

tar tvf control.tar, at the end it outputs:

-rwxr-xr-x 65534/65534 40 2010-06-21 21:04:57 postrm
tar: short read

Strange. I'll have to check this out...


All times are GMT. The time now is 04:59.

vBulletin® Version 3.8.8