Add xz support for debian packages #235

Closed
santagada opened this Issue Jun 15, 2012 · 15 comments

Comments

Projects
None yet
4 participants
@santagada

I would love to have smaller deb files.

@jordansissel

This comment has been minimized.

Show comment
Hide comment
@jordansissel

jordansissel Jun 15, 2012

Owner

Does debian support that? (If you point me at a deb package that uses xz or the internal tarballs, that'd be easiest way for me to get started)

Owner

jordansissel commented Jun 15, 2012

Does debian support that? (If you point me at a deb package that uses xz or the internal tarballs, that'd be easiest way for me to get started)

@santagada

This comment has been minimized.

Show comment
Hide comment
@santagada

santagada Jun 15, 2012

from the manpage deb(5): "The third, last required member is named data.tar. It contains the filesystem as a tar archive, either not compressed (supported since dpkg 1.10.24), or compressed with gzip (with .gz extension), xz (with .xz extension, supported since dpkg 1.15.6), bzip2 (with .bz2 extension, supported since dpkg 1.10.24) or lzma (with .lzma extension, supported since dpkg 1.13.25)."

mine on ubuntu 12.04 is 1.16.1.2 so I think it does... dunno if anyone uses it. My packages are 71 mb in tar.gz and go down to around 50mb with .xz, I think it will save me a lot of download time.

from the manpage deb(5): "The third, last required member is named data.tar. It contains the filesystem as a tar archive, either not compressed (supported since dpkg 1.10.24), or compressed with gzip (with .gz extension), xz (with .xz extension, supported since dpkg 1.15.6), bzip2 (with .bz2 extension, supported since dpkg 1.10.24) or lzma (with .lzma extension, supported since dpkg 1.13.25)."

mine on ubuntu 12.04 is 1.16.1.2 so I think it does... dunno if anyone uses it. My packages are 71 mb in tar.gz and go down to around 50mb with .xz, I think it will save me a lot of download time.

@jordansissel

This comment has been minimized.

Show comment
Hide comment
@jordansissel

jordansissel Jun 15, 2012

Owner

awesome, thanks! This should be pretty easy to do.

Owner

jordansissel commented Jun 15, 2012

awesome, thanks! This should be pretty easy to do.

jordansissel added a commit that referenced this issue Jun 15, 2012

@jordansissel

This comment has been minimized.

Show comment
Hide comment
@jordansissel

jordansissel Jun 15, 2012

Owner

tentative support is in master, are you able to test? Will do some tests on my end as is.

Owner

jordansissel commented Jun 15, 2012

tentative support is in master, are you able to test? Will do some tests on my end as is.

@jordansissel

This comment has been minimized.

Show comment
Hide comment
@jordansissel

jordansissel Jun 15, 2012

Owner

% ruby bin/fpm -s dir -t deb -n fizzle --deb-compression xz /etc/motd

% ar t fizzle_1.0_amd64.deb | grep data
data.tar.xz

 % ar p fizzle_1.0_amd64.deb data.tar.xz | file -
/dev/stdin: xz compressed data

 % ar p fizzle_1.0_amd64.deb data.tar.xz | xz -d | file - 
/dev/stdin: POSIX tar archive (GNU)

Seems ok to me, will try to find a debian/ubuntu system to test this on.

Owner

jordansissel commented Jun 15, 2012


% ruby bin/fpm -s dir -t deb -n fizzle --deb-compression xz /etc/motd

% ar t fizzle_1.0_amd64.deb | grep data
data.tar.xz

 % ar p fizzle_1.0_amd64.deb data.tar.xz | file -
/dev/stdin: xz compressed data

 % ar p fizzle_1.0_amd64.deb data.tar.xz | xz -d | file - 
/dev/stdin: POSIX tar archive (GNU)

Seems ok to me, will try to find a debian/ubuntu system to test this on.

@santagada

This comment has been minimized.

Show comment
Hide comment
@santagada

santagada Jun 15, 2012

the code looks fine, I will test it here... why does the option you add is named --compression on the code if it is really --deb_compression?

the code looks fine, I will test it here... why does the option you add is named --compression on the code if it is really --deb_compression?

@santagada

This comment has been minimized.

Show comment
Hide comment
@santagada

santagada Jun 15, 2012

../fpm/bin/../lib/fpm/package/deb.rb:22: warning: already initialized constant COMPRESSION_TYPES
../fpm/bin/../lib/fpm/package/dir.rb:130:in utime': Operation not permitted - /tmp/package-dir-staging20120615-13194-jjq9zl/opt/venv/lib/python2.7/config (Errno::EPERM) from ../fpm/bin/../lib/fpm/package/dir.rb:130:incopy_metadata'
from ../fpm/bin/../lib/fpm/package/dir.rb:120:in copy' from ../fpm/bin/../lib/fpm/package/dir.rb:79:inclone'
from /usr/lib/ruby/1.8/find.rb:39:in find' from /usr/lib/ruby/1.8/find.rb:38:incatch'
from /usr/lib/ruby/1.8/find.rb:38:in find' from ../fpm/bin/../lib/fpm/package/dir.rb:77:inclone'
from ../fpm/bin/../lib/fpm/package/dir.rb:34:in input' from ../fpm/bin/../lib/fpm/package/dir.rb:32:inchdir'
from ../fpm/bin/../lib/fpm/package/dir.rb:32:in input' from ../fpm/bin/../lib/fpm/command.rb:248:inexecute'
from ../fpm/bin/../lib/fpm/command.rb:247:in each' from ../fpm/bin/../lib/fpm/command.rb:247:inexecute'
from /usr/lib/ruby/gems/1.8/gems/clamp-0.3.1/lib/clamp/command.rb:64:in run' from /usr/lib/ruby/gems/1.8/gems/clamp-0.3.1/lib/clamp/command.rb:126:inrun'
from ../fpm/bin/fpm:8

../fpm/bin/../lib/fpm/package/deb.rb:22: warning: already initialized constant COMPRESSION_TYPES
../fpm/bin/../lib/fpm/package/dir.rb:130:in utime': Operation not permitted - /tmp/package-dir-staging20120615-13194-jjq9zl/opt/venv/lib/python2.7/config (Errno::EPERM) from ../fpm/bin/../lib/fpm/package/dir.rb:130:incopy_metadata'
from ../fpm/bin/../lib/fpm/package/dir.rb:120:in copy' from ../fpm/bin/../lib/fpm/package/dir.rb:79:inclone'
from /usr/lib/ruby/1.8/find.rb:39:in find' from /usr/lib/ruby/1.8/find.rb:38:incatch'
from /usr/lib/ruby/1.8/find.rb:38:in find' from ../fpm/bin/../lib/fpm/package/dir.rb:77:inclone'
from ../fpm/bin/../lib/fpm/package/dir.rb:34:in input' from ../fpm/bin/../lib/fpm/package/dir.rb:32:inchdir'
from ../fpm/bin/../lib/fpm/package/dir.rb:32:in input' from ../fpm/bin/../lib/fpm/command.rb:248:inexecute'
from ../fpm/bin/../lib/fpm/command.rb:247:in each' from ../fpm/bin/../lib/fpm/command.rb:247:inexecute'
from /usr/lib/ruby/gems/1.8/gems/clamp-0.3.1/lib/clamp/command.rb:64:in run' from /usr/lib/ruby/gems/1.8/gems/clamp-0.3.1/lib/clamp/command.rb:126:inrun'
from ../fpm/bin/fpm:8

@santagada

This comment has been minimized.

Show comment
Hide comment
@santagada

santagada Jun 15, 2012

Just to be clear, the master fpm appears to be complaining about COMPRESSION_TYPES and is breaking on trying utime on Ubuntu (the same error I had on OSX when it was trying to copy and delete symbolic links).

Just to be clear, the master fpm appears to be complaining about COMPRESSION_TYPES and is breaking on trying utime on Ubuntu (the same error I had on OSX when it was trying to copy and delete symbolic links).

@jordansissel

This comment has been minimized.

Show comment
Hide comment
@jordansissel

jordansissel Aug 25, 2012

Owner

the 'utime not permitted' problem should have been fixed by now. Also the 'COMPRESSION_TYPES' thing is just a harmless warning.

Can you reproduce the utime failure on the latest fpm?

Owner

jordansissel commented Aug 25, 2012

the 'utime not permitted' problem should have been fixed by now. Also the 'COMPRESSION_TYPES' thing is just a harmless warning.

Can you reproduce the utime failure on the latest fpm?

@ampledata

This comment has been minimized.

Show comment
Hide comment
@ampledata

ampledata Sep 20, 2012

harmless warning == exit 2, not exit 0, unfortunately :(

harmless warning == exit 2, not exit 0, unfortunately :(

@jordansissel

This comment has been minimized.

Show comment
Hide comment
@jordansissel

jordansissel Sep 20, 2012

Owner

I'll rephrase. The "COMPRESSION_TYPES" warning is not a reason fpm or ruby will abort or exit.

Here's an example:

% ruby -e 'FOO = 123; FOO = 234; puts "GOT HERE"'
-e:1: warning: already initialized constant FOO
GOT HERE

% echo $?
0

Notice how 'GOT HERE' is printed and the exit code is zero :)

@ampledata - if you are having issues, please include the full error output.

Owner

jordansissel commented Sep 20, 2012

I'll rephrase. The "COMPRESSION_TYPES" warning is not a reason fpm or ruby will abort or exit.

Here's an example:

% ruby -e 'FOO = 123; FOO = 234; puts "GOT HERE"'
-e:1: warning: already initialized constant FOO
GOT HERE

% echo $?
0

Notice how 'GOT HERE' is printed and the exit code is zero :)

@ampledata - if you are having issues, please include the full error output.

@ampledata

This comment has been minimized.

Show comment
Hide comment
@ampledata

ampledata Sep 20, 2012

STOP TYPING SO FAST. Actually you're right, I was receiving a misleading exit for another reason. Comment rescinded.

STOP TYPING SO FAST. Actually you're right, I was receiving a misleading exit for another reason. Comment rescinded.

@jordansissel

This comment has been minimized.

Show comment
Hide comment
@jordansissel

jordansissel Sep 20, 2012

Owner

haha :)

Owner

jordansissel commented Sep 20, 2012

haha :)

@jordansissel

This comment has been minimized.

Show comment
Hide comment
@jordansissel

jordansissel Oct 2, 2012

Owner

Closing since --deb-compression flag has been available since fpm 0.4.11

Owner

jordansissel commented Oct 2, 2012

Closing since --deb-compression flag has been available since fpm 0.4.11

@jordansissel

This comment has been minimized.

Show comment
Hide comment
@jordansissel

jordansissel Oct 2, 2012

Owner

Closing since --deb-compression flag has been available since fpm 0.4.11

Owner

jordansissel commented Oct 2, 2012

Closing since --deb-compression flag has been available since fpm 0.4.11

@r4um r4um closed this Mar 16, 2013

prof-milki pushed a commit to prof-milki/xpm that referenced this issue Dec 18, 2014

prof-milki pushed a commit to prof-milki/xpm that referenced this issue Dec 27, 2014

jordansissel added a commit that referenced this issue Apr 24, 2015

jordansissel added a commit that referenced this issue Jun 20, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment