[Rubygems-developers] [ rubygems-Bugs-29069 ] When repackaging gems, `gzip data.tar' yields bad gem file

noreply at rubyforge.org noreply at rubyforge.org
Mon Mar 7 22:00:45 EST 2011


Bugs item #29069, was opened at 2011-03-07 16:55
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=575&aid=29069&group_id=126

Category: `gem install` command
Group: v1.6.x
Status: Closed
Resolution: Rejected
Priority: 3
Submitted By: Jos Backus (josb)
Assigned to: Nobody (None)
Summary: When repackaging gems, `gzip data.tar' yields bad gem file

Initial Comment:
In the example below, gzip data.tar creates a broken gem file. One has to use gzip < data.tar > data.tar.gz instead. Is this an issue with zlib or how Rubygems uses zlib?

/tmp% mkdir am 
/tmp% cd am
/tmp/am% tar xf /home/josb/.rvm/gems/ruby-1.9.2-head/cache/amalgalite-1.0.0.gem
tar: metadata.gz: implausibly old time stamp 1969-12-31 16:00:00
/tmp/am% ls -l
total 1324
-rw-r--r-- 1 josb wheel 1348246 Mar  7 13:34 data.tar.gz
-rw-r--r-- 1 josb wheel    1726 Dec 31  1969 metadata.gz
/tmp/am% gunzip data.tar.gz
/tmp/am% ls -l
total 5084
-rw-r--r-- 1 josb wheel 5198336 Mar  7 13:34 data.tar
-rw-r--r-- 1 josb wheel    1726 Dec 31  1969 metadata.gz
/tmp/am% gzip data.tar 
/tmp/am% ls -l
total 1324
-rw-r--r-- 1 josb wheel 1348255 Mar  7 13:34 data.tar.gz
-rw-r--r-- 1 josb wheel    1726 Dec 31  1969 metadata.gz
/tmp/am% tar cvf amalgalite-1.0.0.gem data.tar.gz metadata.gz
data.tar.gz
metadata.gz
/tmp/am% gem install $PWD/amalgalite-1.0.0.gem
ERROR:  While executing gem ... (Zlib::DataError)
    invalid code lengths set
/tmp/am% ls -l
total 2656
-rw-r--r-- 1 josb wheel 1361920 Mar  7 13:45 amalgalite-1.0.0.gem
-rw-r--r-- 1 josb wheel 1348255 Mar  7 13:34 data.tar.gz
-rw-r--r-- 1 josb wheel    1726 Dec 31  1969 metadata.gz
/tmp/am% rm amalgalite-1.0.0.gem
/tmp/am% gunzip data.tar.gz
/tmp/am% ls -l
total 5084
-rw-r--r-- 1 josb wheel 5198336 Mar  7 13:34 data.tar
-rw-r--r-- 1 josb wheel    1726 Dec 31  1969 metadata.gz
/tmp/am% gzip < data.tar > data.tar.gz
/tmp/am% tar cvf amalgalite-1.0.0.gem data.tar.gz metadata.gz
data.tar.gz
metadata.gz
/tmp/am% gem install $PWD/amalgalite-1.0.0.gem                        
Building native extensions.  This could take a while...
Successfully installed amalgalite-1.0.0
1 gem installed
Installing ri documentation for amalgalite-1.0.0...
Building YARD (yri) index for amalgalite-1.0.0...
Installing RDoc documentation for amalgalite-1.0.0...                       
/tmp/am%


----------------------------------------------------------------------

>Comment By: Jos Backus (josb)
Date: 2011-03-07 19:00

Message:
`gem package` doesn't appear to exist in Rubygems 1.6.1:

/tmp/am% gem --version
1.6.1
/tmp/am% gem package  
ERROR:  While executing gem ... (RuntimeError)
    Unknown command package
/tmp/am% 


----------------------------------------------------------------------

Comment By: Ryan Davis (zenspider)
Date: 2011-03-07 18:08

Message:
This isn't a supported usecase.

`gzip` != Zlib::GzipWriter.

Use `gem package`.

----------------------------------------------------------------------

You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=575&aid=29069&group_id=126


More information about the Rubygems-developers mailing list