[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Rake's PackageTask should have tar -h for symbolic links

Ed Howland

4/4/2006 4:05:00 PM

Hi,

I have a need to have Rake::PackageTask implement the -h option on tar
+gz and bz2. This would allow for tar to include any linked
files/folders. The workaround is to cp -r the entire contents of the
linked dir. This is klunky at best.

Any chance of this? Any other workarounds?

Thanks
Ed


3 Answers

Jim Weirich

4/4/2006 5:43:00 PM

0

Ed Howland wrote:
> Hi,
>
> I have a need to have Rake::PackageTask implement the -h option on tar
> +gz and bz2. This would allow for tar to include any linked
> files/folders. The workaround is to cp -r the entire contents of the
> linked dir. This is klunky at best.
>
> Any chance of this? Any other workarounds?

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.

(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.

--
-- Jim Weirich

--
Posted via http://www.ruby-....


Austin Ziegler

4/4/2006 6:28:00 PM

0

On 4/4/06, Jim Weirich <jim@weirichhouse.org> wrote:> (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 have been given a patch for minitar that is supposed to supportsymlinks. I have not had time to review or apply it yet.Additionally, a significant upgrade to minitar may be in the works ifsomething else I'm working on pans out.-austin--Austin Ziegler * halostatue@gmail.com * Alternate: austin@halostatue.ca

Ed Howland

4/4/2006 9:13:00 PM

0

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