Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Rake's PackageTask should have tar -h for symbolic links

Reply
Thread Tools

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

 
 
Ed Howland
Guest
Posts: n/a
 
      04-04-2006
Hi,

I have a need to have Rake:ackageTask 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


 
Reply With Quote
 
 
 
 
Jim Weirich
Guest
Posts: n/a
 
      04-04-2006
Ed Howland wrote:
> Hi,
>
> I have a need to have Rake:ackageTask 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-forum.com/.


 
Reply With Quote
 
 
 
 
Austin Ziegler
Guest
Posts: n/a
 
      04-04-2006
T24gNC80LzA2LCBKaW0gV2VpcmljaCA8amltQHdlaXJpY2hob3 VzZS5vcmc+IHdyb3RlOgo+ICgy
KSBJJ20gY29uc2lkZXJpbmcgYWRkaW5nIHN1cHBvcnQgZm9yIH RoZSBwdXJlLXJ1YnkgdGFyIGxp
YnJhcnkgdG8KPiBidWlsZCB0aGUgdGFyZmlsZS4gIFRoaXMgd2 91bGQgYWxsb3cgdGhlIHBhY2th
Z2UgdG8gYmUgYnVpbHQgb24gd2luZG93cwo+IG1hY2hpbmVzIH RoYXQgZG9uJ3QgYSB0YXIgcHJv
Z3JhbS4gIEJ1dCBJJ20gbm90IHN1cmUgaWYgdGhlIHB1cmUgcn VieQo+IHRhciBsaWJyYXJ5IHN1
cHBvcnRzIGEgLWggb3B0aW9uLiAgVGhhdCB3b3VsZCBoYXZlIH RvIGJlIHZlcmZpZmllZC4KCkkg
aGF2ZSBiZWVuIGdpdmVuIGEgcGF0Y2ggZm9yIG1pbml0YXIgdG hhdCBpcyBzdXBwb3NlZCB0byBz
dXBwb3J0CnN5bWxpbmtzLiBJIGhhdmUgbm90IGhhZCB0aW1lIH RvIHJldmlldyBvciBhcHBseSBp
dCB5ZXQuCgpBZGRpdGlvbmFsbHksIGEgc2lnbmlmaWNhbnQgdX BncmFkZSB0byBtaW5pdGFyIG1h
eSBiZSBpbiB0aGUgd29ya3MgaWYKc29tZXRoaW5nIGVsc2UgSS dtIHdvcmtpbmcgb24gcGFucyBv
dXQuCgotYXVzdGluCi0tCkF1c3RpbiBaaWVnbGVyICogaGFsb3 N0YXR1ZUBnbWFpbC5jb20KICAg
ICAgICAgICAgICAgKiBBbHRlcm5hdGU6IGF1c3RpbkBoYWxvc3 RhdHVlLmNhCg==


 
Reply With Quote
 
Ed Howland
Guest
Posts: n/a
 
      04-04-2006
On 4/4/06, Jim Weirich <> 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:ackageTask.new("mytarball", "3-31-2006") do |p|
p.need_tar_gz =3D 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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Pipelining tar create and tar extract the "Python" way... Ray Van Dolson Python 0 09-25-2009 03:48 PM
Pipelining tar create and tar extract the "Python" way... Ray Van Dolson Python 0 09-23-2009 10:52 PM
os.system('tar -c * | tar -C dst') ##Any other suggestions... list.repository@gmail.com Python 2 04-24-2007 10:29 PM
Version of TAR in tarfile module? TAR 1.14 or 1.15 port to Windows? Claudio Grondi Python 4 08-20-2005 08:01 PM
trouble with Archive::Tar : Can not read compressed format in tar-mode benoit Guyon Perl Misc 2 07-26-2005 01:53 PM



Advertisments