Author: jgg
Date: 1999-09-10 02:40:31 GMT
Fixed calling of pre-dpkg script
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: dpkgpm.cc,v 1.13 1999/07/30 06:15:14 jgg Exp $
+// $Id: dpkgpm.cc,v 1.14 1999/09/10 02:40:31 jgg Exp $
/* ######################################################################
DPKG Package Manager - Provide an interface to dpkg
/* ######################################################################
DPKG Package Manager - Provide an interface to dpkg
SetCloseExec(STDOUT_FILENO,false);
SetCloseExec(STDIN_FILENO,false);
SetCloseExec(STDERR_FILENO,false);
SetCloseExec(STDOUT_FILENO,false);
SetCloseExec(STDIN_FILENO,false);
SetCloseExec(STDERR_FILENO,false);
- Args[1] = "/bin/sh";
- Args[2] = "-c";
- Args[3] = Opts->Value.c_str();
- Args[4] = 0;
+ Args[1] = "-c";
+ Args[2] = Opts->Value.c_str();
+ Args[3] = 0;
execv(Args[0],(char **)Args);
_exit(100);
}
execv(Args[0],(char **)Args);
_exit(100);
}
FileFd Fd(Pipes[1]);
// Feed it the filenames.
FileFd Fd(Pipes[1]);
// Feed it the filenames.
- for (vector<Item>::iterator I = List.begin(); I != List.end();)
+ for (vector<Item>::iterator I = List.begin(); I != List.end(); I++)
{
// Only deal with packages to be installed from .deb
if (I->Op != Item::Install)
{
// Only deal with packages to be installed from .deb
if (I->Op != Item::Install)
kill(Process,SIGINT);
Fd.Close();
ExecWait(Process,Opts->Value.c_str(),true);
kill(Process,SIGINT);
Fd.Close();
ExecWait(Process,Opts->Value.c_str(),true);
+ return _error->Error("Failure running script %s",Opts->Value.c_str());
+ }
}
Fd.Close();
// Clean up the sub process
if (ExecWait(Process,Opts->Value.c_str()) == false)
}
Fd.Close();
// Clean up the sub process
if (ExecWait(Process,Opts->Value.c_str()) == false)
+ return _error->Error("Failure running script %s",Opts->Value.c_str());