Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Get your hands dirty: Help bootstrap Ruby on Windows.

Reply
Thread Tools

Get your hands dirty: Help bootstrap Ruby on Windows.

 
 
Michal Suchanek
Guest
Posts: n/a
 
      01-04-2008
On 04/01/2008, Luis Lavena <(E-Mail Removed)> wrote:
> On 4 ene, 03:03, "M. Edward (Ed) Borasky" <(E-Mail Removed)> wrote:
> > Luis Lavena wrote:
> >
> > [snip]
> >
> > > To bootstrap and use this project, you need:
> > > - Ruby 1.8.5 or greater
> > > - Rake 0.7.3 or greater
> > > - Tar [1] and Unzip [2] binary packages from GnuWin32

> >
> > Aren't they in MSys?
> >

>
> Chicken-egg situation:
>
> They are inside the compressed tar.gz and tar.bz2 files... how I'm
> supposed to get them if I don't decompress them first?
>
> So: if someone have a pure-ruby (with aditional gem or extension) that
> allow us extract content from:
>
> - .zip (deflate) files
> - .gz (of .tar.gz) files
> - .bz2 (of .tar.bz2) files
>
> All without these dependencies, feel free to modify rake/
> extracttask
>

If youcan afford relying on ruby stdlib, there is zlib which can do
deflate and gunzip.

There is minitar hosted on rubyforge under ruwiki (does not work on
unseekable files like stdin but works on gzipped files by using zlib).
There is rubyzip (untested, uses zlib for compression). bzip2 remains
to be solved but hopefully the basic stuff can be obtained as gzipped
archives.

http://rubyforge.org/frs/?group_id=84
http://rubyforge.org/frs/?group_id=909

Thanks

Michal

 
Reply With Quote
 
 
 
 
Michal Suchanek
Guest
Posts: n/a
 
      01-04-2008
On 04/01/2008, Michal Suchanek <(E-Mail Removed)> wrote:
> On 04/01/2008, Luis Lavena <(E-Mail Removed)> wrote:
> > On 4 ene, 03:03, "M. Edward (Ed) Borasky" <(E-Mail Removed)> wrote:
> > > Luis Lavena wrote:
> > >
> > > [snip]
> > >
> > > > To bootstrap and use this project, you need:
> > > > - Ruby 1.8.5 or greater
> > > > - Rake 0.7.3 or greater
> > > > - Tar [1] and Unzip [2] binary packages from GnuWin32
> > >
> > > Aren't they in MSys?
> > >

> >
> > Chicken-egg situation:
> >
> > They are inside the compressed tar.gz and tar.bz2 files... how I'm
> > supposed to get them if I don't decompress them first?
> >
> > So: if someone have a pure-ruby (with aditional gem or extension) that
> > allow us extract content from:
> >
> > - .zip (deflate) files
> > - .gz (of .tar.gz) files
> > - .bz2 (of .tar.bz2) files
> >
> > All without these dependencies, feel free to modify rake/
> > extracttask
> >

> If youcan afford relying on ruby stdlib, there is zlib which can do
> deflate and gunzip.
>
> There is minitar hosted on rubyforge under ruwiki (does not work on
> unseekable files like stdin but works on gzipped files by using zlib).
> There is rubyzip (untested, uses zlib for compression). bzip2 remains
> to be solved but hopefully the basic stuff can be obtained as gzipped
> archives.
>
> http://rubyforge.org/frs/?group_id=84
> http://rubyforge.org/frs/?group_id=909


And you can get bzip2 at
http://www.bzip.org/1.0.4/bzip2-104-x86-win32.exe - plain win32
executable.

Thanks

Michal

 
Reply With Quote
 
 
 
 
Luis Lavena
Guest
Posts: n/a
 
      01-04-2008
On 4 ene, 09:35, Michal Suchanek <(E-Mail Removed)> wrote:
>
> If youcan afford relying on ruby stdlib, there is zlib which can do
> deflate and gunzip.
>
> There is minitar hosted on rubyforge under ruwiki (does not work on
> unseekable files like stdin but works on gzipped files by using zlib).
> There is rubyzip (untested, uses zlib for compression). bzip2 remains
> to be solved but hopefully the basic stuff can be obtained as gzipped
> archives.
>
> http://rubyforge.org/frs/?group_id=84
> http://rubyforge.org/frs/?group_id=909
>


Thank you Michal,

Since I was moving from a batch-build process to a ruby/rake build
process, a few external tools remains as requirement.

MinGW packages are distributed in tar.gz format [1] (which I guess map
perfect for Minitar project), but MSYS provides tar.bz2 files [2],
which will still need the external tool to uncompress.

In this case, tar.bz2 files can be uncompressed with bsdtar, which is
the best implementation I've tested that work with all the file
formats. (tgz, tar.gz and tar.bz2)

There is also the memory usage and speed situation, extract 8MB files
can take a bit slow using a pure-ruby implementation.

[1] http://sourceforge.net/project/showf...ease_id=237094
[2] http://sourceforge.net/project/showf...lease_id=46827

Regards,
--
Luis Lavena
 
Reply With Quote
 
Luis Lavena
Guest
Posts: n/a
 
      01-04-2008
On 4 ene, 09:43, Michal Suchanek <(E-Mail Removed)> wrote:
>
> And you can get bzip2 athttp://www.bzip.org/1.0.4/bzip2-104-x86-win32.exe- plain win32
> executable.
>


Thank you again.

I was using bsdtar from libarchive 2.4.0 mostly because it offered a
one-step unpack procedure:

tar xzf
(.tar, tar.gz and .tgz files)

tar jxf
(.tar.bz2)

Which is similar to the commands executed under *nix.

Anyhow this could be changed, patchs are welcome

Regards,
--
Luis Lavena
 
Reply With Quote
 
Austin Ziegler
Guest
Posts: n/a
 
      01-04-2008
On Jan 4, 2008 5:34 AM, Luis Lavena <(E-Mail Removed)> wrote:
> They are inside the compressed tar.gz and tar.bz2 files... how I'm
> supposed to get them if I don't decompress them first?
>
> So: if someone have a pure-ruby (with aditional gem or extension) that
> allow us extract content from:
>
> - .zip (deflate) files
> - .gz (of .tar.gz) files
> - .bz2 (of .tar.bz2) files
>
> All without these dependencies, feel free to modify rake/
> extracttask


gz and .tar.gz files aren't hard to deal with since a working Ruby
1.8.5 is a prerequisite. Look at minitar, and the zlib library is part
of a working Ruby 1.8.5 install.

-austin
--
Austin Ziegler * http://www.velocityreviews.com/forums/(E-Mail Removed) * http://www.halostatue.ca/
* (E-Mail Removed) * http://www.halostatue.ca/feed/
* (E-Mail Removed)

 
Reply With Quote
 
Michal Suchanek
Guest
Posts: n/a
 
      01-04-2008
On 04/01/2008, Luis Lavena <(E-Mail Removed)> wrote:
> On 4 ene, 09:35, Michal Suchanek <(E-Mail Removed)> wrote:
> >
> > If youcan afford relying on ruby stdlib, there is zlib which can do
> > deflate and gunzip.
> >
> > There is minitar hosted on rubyforge under ruwiki (does not work on
> > unseekable files like stdin but works on gzipped files by using zlib).
> > There is rubyzip (untested, uses zlib for compression). bzip2 remains
> > to be solved but hopefully the basic stuff can be obtained as gzipped
> > archives.
> >
> > http://rubyforge.org/frs/?group_id=84
> > http://rubyforge.org/frs/?group_id=909
> >

>
> Thank you Michal,
>
> Since I was moving from a batch-build process to a ruby/rake build
> process, a few external tools remains as requirement.
>
> MinGW packages are distributed in tar.gz format [1] (which I guess map
> perfect for Minitar project), but MSYS provides tar.bz2 files [2],
> which will still need the external tool to uncompress.
>
> In this case, tar.bz2 files can be uncompressed with bsdtar, which is
> the best implementation I've tested that work with all the file
> formats. (tgz, tar.gz and tar.bz2)
>
> There is also the memory usage and speed situation, extract 8MB files
> can take a bit slow using a pure-ruby implementation.


The decompression is handled by zlib so this should not be that much
of an issue. Still people extracting on slow machines could see the
difference, and there should be no problem with including these unpack
tools in the archive containing the build scripts.
On the other hand, the minitar might be useful if you wanted to do
something special with symlinks (currently it does not extract them at
all). Maintaining a patched minitar might be easier than maintaining a
patched bsdtar binary.

The rubyzip implementation does not include a working command line
tool as far as I can tell. A poor man's unzip using the library is
simple but I am not sure it is of much use. Perhaps an external unzip
tool would be easier.

Thanks

Michal

#unzip.rb
# The example:
#Zip::ZipInputStream:pen("my.zip") {
# |io|
#
# while (entry = io.get_next_entry)
# puts "Contents of #{entry.name}: '#{io.read}'"
# end
# }

require 'zip/zip'

def open_wr fn
elts = fn.split("/")
dir = ""
elts[0...-1].each{|d|
raise RuntimeError, "Invalid filename '#{fn}'." if
d == "" or d == ".."
dir << d << "/"
Dir.mkdir dir unless File.directory? dir
}
raise RuntimeError, "File exists '#{fn}'." if
File.exist? fn
File.open(fn,"wb"){|f| yield f}
end

Zip::ZipInputStream:pen(ARGV[0]) { |io|
while (entry = io.get_next_entry)
STDERR.puts entry.name
# directories are of type file, they just have a trailing slash
next if entry.name[-1] == '/'[-1]
open_wr(entry.name){|out| out << io.read}
end
}

 
Reply With Quote
 
Michal Suchanek
Guest
Posts: n/a
 
      01-04-2008
On 04/01/2008, Austin Ziegler <(E-Mail Removed)> wrote:
> On Jan 4, 2008 5:34 AM, Luis Lavena <(E-Mail Removed)> wrote:
> > They are inside the compressed tar.gz and tar.bz2 files... how I'm
> > supposed to get them if I don't decompress them first?
> >
> > So: if someone have a pure-ruby (with aditional gem or extension) that
> > allow us extract content from:
> >
> > - .zip (deflate) files
> > - .gz (of .tar.gz) files
> > - .bz2 (of .tar.bz2) files
> >
> > All without these dependencies, feel free to modify rake/
> > extracttask

>
> .gz and .tar.gz files aren't hard to deal with since a working Ruby
> 1.8.5 is a prerequisite. Look at minitar, and the zlib library is part
> of a working Ruby 1.8.5 install.
>

Yes, it just does not handle bzip2 which is used to compress the mingw
base that contains tar.

So you still need bzip2, and you can as well include a full
tar/gzip/bzibp2 suite then as it will probably make the decomression
somewhat faster and less memory intensive. It might waste a bit of
space as the minitar source would probably compress a few kilobytes
smaller than the tar binary. Didn't do any benchmarks, though.

Thanks

Michal

 
Reply With Quote
 
James Tucker
Guest
Posts: n/a
 
      01-04-2008
7za.exe from the 7z distribution is both open source, and really small.

Whilst it may not be a 'normal' tool, it very happily deals with all
of these issues in a single app, and common command line interface.

It's also pretty swift.

On 4 Jan 2008, at 10:30, Michal Suchanek wrote:

> On 04/01/2008, Austin Ziegler <(E-Mail Removed)> wrote:
>> On Jan 4, 2008 5:34 AM, Luis Lavena <(E-Mail Removed)> wrote:
>>> They are inside the compressed tar.gz and tar.bz2 files... how I'm
>>> supposed to get them if I don't decompress them first?
>>>
>>> So: if someone have a pure-ruby (with aditional gem or extension)
>>> that
>>> allow us extract content from:
>>>
>>> - .zip (deflate) files
>>> - .gz (of .tar.gz) files
>>> - .bz2 (of .tar.bz2) files
>>>
>>> All without these dependencies, feel free to modify rake/
>>> extracttask

>>
>> .gz and .tar.gz files aren't hard to deal with since a working Ruby
>> 1.8.5 is a prerequisite. Look at minitar, and the zlib library is
>> part
>> of a working Ruby 1.8.5 install.
>>

> Yes, it just does not handle bzip2 which is used to compress the mingw
> base that contains tar.
>
> So you still need bzip2, and you can as well include a full
> tar/gzip/bzibp2 suite then as it will probably make the decomression
> somewhat faster and less memory intensive. It might waste a bit of
> space as the minitar source would probably compress a few kilobytes
> smaller than the tar binary. Didn't do any benchmarks, though.
>
> Thanks
>
> Michal
>



 
Reply With Quote
 
Luis Lavena
Guest
Posts: n/a
 
      01-04-2008
On 4 ene, 12:44, James Tucker <(E-Mail Removed)> wrote:
> 7za.exe from the 7z distribution is both open source, and really small.
>
> Whilst it may not be a 'normal' tool, it very happily deals with all
> of these issues in a single app, and common command line interface.
>
> It's also pretty swift.
>


Until 'we' switch to other alternatives, either pure-ruby or externals
tools, I've uploaded a zip file which contains the needed files to get
you running:

http://code.mmediasys.com/installer3/deps.zip (320KB)

unzip into a new folder and put it in the PATH:

Example:

SET PATH=%PATH%;C:\installer3\dependencies

Then you can use rake without worring about how or here to get these
files.

Regards,
--
Luis Lavena
 
Reply With Quote
 
Luis Lavena
Guest
Posts: n/a
 
      01-08-2008
On Jan 4, 1:17 pm, Luis Lavena <(E-Mail Removed)> wrote:
> [...]
>
> Until 'we' switch to other alternatives, either pure-ruby or externals
> tools, I've uploaded a zip file which contains the needed files to get
> you running:
>
> [...]


No more!

(bumping this).

Thanks to Dennis Ranke Installer3 nows uses a pure-ruby solution to
download the required extracting tools using RubyZip code.

There is no need to install rubyzip gem!

You can grab exported code (revision 36) at the same URL:

http://code.mmediasys.com/installer3/latest.zip

Or checkout your own brach using bazaar:

bzr branch http://code.mmediasys.com/installer3/dev my-branch-feature

For those wanting to contribute, I'll be pushing further progress of
this project on rubyinstaller-devel mailing list:

http://rubyforge.org/mailman/listinf...nstaller-devel

Remember that the idea behind this is bootstrap the new One-Click
Installer for Windows.

Looking forward for contributors.

Regards,
--
Luis Lavena


 
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
2501 Hangs at bootstrap encoad@gmail.com Cisco 5 03-29-2007 04:22 PM
dual python / bootstrap RPM woes Python 0 07-20-2006 01:19 AM
Rubyx (linux distro created using ruby) - Bootstrap volunteers required Andrew Walrond Ruby 1 02-01-2004 11:52 PM
Cisco 2503 Bootstrap Problem Alien Brain Cisco 2 12-12-2003 12:49 AM
Bootstrap Upgrade for 2503 (12.2) Jo Knight Cisco 1 10-19-2003 06:00 PM



Advertisments