This is the mail archive of the
mailing list for the Cygwin project.
Re: Setup: capturing postinstall output
- From: "Robert Collins" <robert dot collins at syncretize dot net>
- To: "Bradey Honsinger" <BradeyH at construx dot com>,<cygwin-apps at cygwin dot com>
- Date: Thu, 4 Jul 2002 08:31:17 +1000
- Subject: Re: Setup: capturing postinstall output
- References: <2A53F00A2DBBDA479B7E84DA2023A4EBC83EC0@gypsy.construx.com>
----- Original Message -----
From: "Bradey Honsinger" <BradeyH@construx.com>
Sent: Thursday, July 04, 2002 5:55 AM
Subject: RE: Setup: capturing postinstall output
> Does this seem like a good (or bad) way to go to anyone else (particularly
> Robert)? I didn't expect my hacked-up patch to get accepted right off the
> bat, but this was a bit of a problem for me, so I'm willing to put more
> into it if I get some feedback.
Whoops, sorry. I thought about my reply, just didn't get it into type.
I think this is the wrong way to go. Redirecting std in and std out (and std
err) is done by cygwin all the time, surely we can grab code from there
without -too- much difficulty?
Or, and I think this is a much easier grab, we could call each script in
turn, redirecting them on the called command line. The patch below needs a
little tweaking to have different redirect commands for different shells
(i.e. to grab stderr as well and put it in a different file).
What I didn't like about your patch:
1) The need for the wrapper script file -for each- type of script
(preinstall, postinstall, preremove, postremove).
2) The inability to distinguish which script - and thus which package -
3) The inability to run .bat files.
However, I really appreciate the thought you had put into your patch!
Perhaps you could take the patch below and tweak it to use the appropriate
redirect for bash to enable stderr redirection to (say)
RCS file: /cvs/cygwin-apps/setup/script.cc,v
retrieving revision 2.4
diff -u -p -r2.4 script.cc
--- script.cc 18 Feb 2002 13:53:07 -0000 2.4
+++ script.cc 3 Jul 2002 22:26:42 -0000
@@ -86,7 +86,7 @@ run (const char *sh, const char *args, c
- sprintf (cmdline, "%s %s %s", sh, args, file);
+ sprintf (cmdline, "%s %s %s > %s", sh, args, file, cygpath
memset (&pi, 0, sizeof (pi));
memset (&si, 0, sizeof (si));
si.cb = sizeof (si);