[Rubygems-developers] Handling of tar files....

Hugh Sasse hgs at dmu.ac.uk
Wed Jul 27 07:25:51 EDT 2005

AFAICS rubygems assumes that tar is gnu tar.

         [need_tar, tgz_file, "z"],
         [need_tar_gz, tar_gz_file, "z"],
         [need_tar_bz2, tar_bz2_file, "j"]
       ].each do |(need, file, flag)|
         if need
           task :package => ["#{package_dir}/#{file}"]
           file "#{package_dir}/#{file}" => [package_dir_path] + package_files do
             chdir(package_dir) do
               sh %{tar #{flag}cvf #{file} #{package_name}}

from ./lib/rake/packagetask.rb  in 0.5.4

We have Suns here, and I'm not really in a position to know if Sun
does anything unusual with their tar when they distribute things.
Therefore I tend to keep the sun binaries in place and first on the
path and have GNU tar as /usr/local/bin/tar symlinked to

I'm wondering what the correct fix for this is. I could try to
remember to fix this everytime I update the gem, but it would be
nice if it worked for other people in my position out of the box.

I've seen GNU configure check tar to see if it is gnuish, but I've
not looked at the details to see how this is done.  I do know that
the j flag is only supported by recent versions of GNU tar though,
versions that I can't build on a Solaris 2.5.1 system.


More information about the Rubygems-developers mailing list