Windows package task, windows cannot fork

---------- Forwarded message ----------
From: Dominic S. [email protected]
Date: Nov 9, 2006 3:12 PM
Subject: windows xp package task
To: Rake Development and Discussion [email protected]

On windows, I use the GnuWin32 tar package. When I try to use the
package
task it gave me an error that windows cannot fork. Looking online, I
find
this blog post
http://blog.labnotes.org/2005/11/03/creating-zip-and-tar-packages-with-rake-on-windows/which
has the following

Creating a zip package worked on the first try, but tar complained
that it *‘Cannot
fork: Function not implemented’ *. It turns out that Cygwin’s tar can’t
run
gzip. So once again, it’s time to fix the Rake source code. This time
we’re
talking about rake/packagetask.rb, line 117 that calls tar with the z
option. I replaced that one line with a separate call to tar and gzip:

sh %{tar cvf #{package_name}.tar #{package_name}} if flag == ‘z’ sh
%{gzip #{package_name}.tar} end

You’ll need to be a bit more fancy if you want to support both .tar.gz
and
.tgz suffixes, but this little fix will allow you to create .tar.gz.

I did this and the package task worked.

Dominic S. wrote:

this blog post
talking about rake/packagetask.rb, line 117 that calls tar with the z

That’s wrong. Cygwin’s tar works fine with gzip. Trying to run
GnuWin’s tar ( which is NOT Cygwin’s tar ) via Cygwin most likely will
not work, as GnuWin’s tar has no idea what cygwin1.dll is nor how to
interface with it.

$ tar cvfz gzipped.tgz TestP*rb
TestP2.rb
TestP3.rb
cyberhome: /C/Downloads>
$ tar tvfz gzipped.tgz
-rwx------ Administrator/None 32 2006-04-02 00:35 TestP2.rb
-rwx------ Administrator/None 115 2006-04-02 00:47 TestP3.rb
$ ll tgz
-rwx------+ 1 Administrator None 4258 Feb 19 2005 tinywm-1.2.tgz

-rw-rw-rw- 1 Administrator None 287 Nov 14 21:29 gzipped.tgz

On 11/14/06, Dominic S. [email protected] wrote:

has the following

You’ll need to be a bit more fancy if you want to support both .tar.gz and
.tgz suffixes, but this little fix will allow you to create .tar.gz.

I did this and the package task worked.

If you are trying to avoid cygwin (and its path handling can be a good
reason, depending upon if you are trying to use Win32, rather than
pretend you are on Linux), but still want a functional Win32 tar check
out BsdTar:

http://gnuwin32.sourceforge.net/packages/bsdtar.htm

Install and make a copy on your path with the name tar, works like a
charm for me.

pth

On 11/14/06, Dominic S. [email protected] wrote:

---------- Forwarded message ----------
From: Dominic S. [email protected]
Date: Nov 9, 2006 3:12 PM
Subject: windows xp package task
To: Rake Development and Discussion [email protected]

On windows, I use the GnuWin32 tar package. When I try to use the package
task it gave me an error that windows cannot fork. Looking online, I find
this blog post

I have no troubly using msys on windows.

Thanks Patrick

Using bsdtar instead of tar worked for me

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs