Ed Howland
4/4/2006 9:13:00 PM
On 4/4/06, Jim Weirich <jim@weirichhouse.org> wrote:
> Ed Howland wrote:
> Two issues:
>
> (1) Rake actually makes a copy of the directory and tars that up. That
> way the tar file will not accidently pick up non-package files that
> might be laying around. It will use hard links on Unix do keep the disk
> space usage down (Windows, however, uses a full copy). Any symbolic
> links would have to be added to that copied directory structure for the
> package task to pick it up.
The workaround I came up with does the copy, but at the time time of
Rake's copy:
require 'find'
Rake::PackageTask.new("mytarball", "3-31-2006") do |p|
p.need_tar_gz = true
Find.find('mydir') do |path|
p.package_files << path
end
end
It works on any symbolic links by just recursing down the other tree
and adding pathnames to the package's file list. So it minimizes the
disk space usage to only what Rake uses.
>
> (2) I'm considering adding support for the pure-ruby tar library to
> build the tarfile. This would allow the package to be built on windows
> machines that don't a tar program. But I'm not sure if the pure ruby
> tar library supports a -h option. That would have to be verfified.
>
> I'm open to patches for supporting the -h option given the above
> constraints.
>
That would be nice. Would using the pure-ruby tar library in Rake
avoid the need to do the copy to pkg/? My Rakefile tasks leave
everything in a final folder to be tarballed. It seems an unneccesary
step to create the pkg directory and copy everything in there. Could
an option be added to PackageTask to just tar an existing dir?
BTW, Curt Hibbs just taught us StL Rubyists how to use Rake. It is great!
> --
> -- Jim Weirich
>
Ed