Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Add xz support for debian packages #235

Closed
santagada opened this Issue · 15 comments

4 participants

@santagada

I would love to have smaller deb files.

@jordansissel

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

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

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

@jordansissel

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

@jordansissel

% 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

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

../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:in
copy_metadata'
from ../fpm/bin/../lib/fpm/package/dir.rb:120:in copy'
from ../fpm/bin/../lib/fpm/package/dir.rb:79:in
clone'
from /usr/lib/ruby/1.8/find.rb:39:in find'
from /usr/lib/ruby/1.8/find.rb:38:in
catch'
from /usr/lib/ruby/1.8/find.rb:38:in find'
from ../fpm/bin/../lib/fpm/package/dir.rb:77:in
clone'
from ../fpm/bin/../lib/fpm/package/dir.rb:34:in input'
from ../fpm/bin/../lib/fpm/package/dir.rb:32:in
chdir'
from ../fpm/bin/../lib/fpm/package/dir.rb:32:in input'
from ../fpm/bin/../lib/fpm/command.rb:248:in
execute'
from ../fpm/bin/../lib/fpm/command.rb:247:in each'
from ../fpm/bin/../lib/fpm/command.rb:247:in
execute'
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:in
run'
from ../fpm/bin/fpm:8

@santagada

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

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

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

@jordansissel

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

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

@jordansissel

haha :)

@jordansissel
Owner

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

@jordansissel
Owner

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

@r4um r4um closed this
@prof-milki prof-milki referenced this issue from a commit in prof-milki/xpm
jls - support compression types in for data.tar in deb packages. Default
  continues to be gzip. (#235)
423448b
@prof-milki prof-milki referenced this issue from a commit in prof-milki/xpm
@jordansissel - support compression types in for data.tar in deb packages. Default
  continues to be gzip. (#235)
775235f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.