From 1069407c7f6072c2b71c39ecbfa733093c81896a Mon Sep 17 00:00:00 2001 From: Max Bowsher Date: Thu, 20 Mar 2003 10:02:51 +0000 Subject: [PATCH] 2003-03-18 Igor Pechtchanski * script.cc (run): Add file_out parameter. Redirect output of subprocess to file, creating the path if necessary. Minimize the script window. (run_script): Add optional to_log boolean parameter. If to_log, redirect output to temporary file and then import it into LOG_BABBLE. (OutputLog): New helper class. (operator<<): New operation on OutputLog. * script.h (run_script): Add optional to_log parameter. * postinstall.cc (RunFindVisitor::visitFile): Instruct run_script() to log script output. (do_postinstall): Ditto. --- ChangeLog | 15 ++++++ postinstall.cc | 4 +- script.cc | 128 +++++++++++++++++++++++++++++++++++++++++++++---- script.h | 2 +- 4 files changed, 137 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0916b6e4..797c61ff 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +2003-03-18 Igor Pechtchanski + + * script.cc (run): Add file_out parameter. + Redirect output of subprocess to file, creating the + path if necessary. Minimize the script window. + (run_script): Add optional to_log boolean parameter. + If to_log, redirect output to temporary file and then + import it into LOG_BABBLE. + (OutputLog): New helper class. + (operator<<): New operation on OutputLog. + * script.h (run_script): Add optional to_log parameter. + * postinstall.cc (RunFindVisitor::visitFile): Instruct + run_script() to log script output. + (do_postinstall): Ditto. + 2003-03-20 Robert Collins * package_meta.cc (packagemeta::set_action): The logic diff --git a/postinstall.cc b/postinstall.cc index be5f88ed..77636ce9 100644 --- a/postinstall.cc +++ b/postinstall.cc @@ -36,7 +36,7 @@ public: RunFindVisitor (){} virtual void visitFile(String const &basePath, const WIN32_FIND_DATA *theFile) { - run_script ("/etc/postinstall/", theFile->cFileName); + run_script ("/etc/postinstall/", theFile->cFileName, TRUE); } virtual ~ RunFindVisitor () {} protected: @@ -57,7 +57,7 @@ do_postinstall (HINSTANCE h, HWND owner) packagemeta & pkg = **i; if (pkg.installed) for (std::vector