This is the mail archive of the cygwin-apps@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Setup: capturing postinstall output


----- Original Message -----
From: "Bradey Honsinger" <BradeyH@construx.com>
To: <cygwin-apps@cygwin.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
work
> 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 -
failed.
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)
/var/log/setup-script.err?

Cheers,
Rob

Index: script.cc
===================================================================
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
   STARTUPINFO si;
   PROCESS_INFORMATION pi;

-  sprintf (cmdline, "%s %s %s", sh, args, file);
+  sprintf (cmdline, "%s %s %s > %s", sh, args, file, cygpath
("/var/log/setup-script.output").cstr_oneuse());
   memset (&pi, 0, sizeof (pi));
   memset (&si, 0, sizeof (si));
   si.cb = sizeof (si);

Rob


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]