From: Michal Suchanek on
On 04/01/2008, Luis Lavena <luislavena(a)gmail.com> wrote:
> On 4 ene, 09:35, Michal Suchanek <hramr...(a)centrum.cz> 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::open("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::open(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
}

From: Michal Suchanek on
On 04/01/2008, Austin Ziegler <halostatue(a)gmail.com> wrote:
> On Jan 4, 2008 5:34 AM, Luis Lavena <luislavena(a)gmail.com> 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? :-D
> >
> > 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

From: James Tucker on
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 <halostatue(a)gmail.com> wrote:
>> On Jan 4, 2008 5:34 AM, Luis Lavena <luislavena(a)gmail.com> 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? :-D
>>>
>>> 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
>


From: Luis Lavena on
On 4 ene, 12:44, James Tucker <jftuc...(a)gmail.com> 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
From: Luis Lavena on
On Jan 4, 1:17 pm, Luis Lavena <luislav...(a)gmail.com> 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/listinfo/rubyinstaller-devel

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

Looking forward for contributors.

Regards,
--
Luis Lavena