From 90ecbd7dbb5566b0aed5f85be70821a105de8420 Mon Sep 17 00:00:00 2001 From: Arch Librarian Date: Mon, 20 Sep 2004 16:54:46 +0000 Subject: Fixed calling of pre-dpkg script Author: jgg Date: 1999-09-10 02:40:31 GMT Fixed calling of pre-dpkg script --- apt-pkg/deb/dpkgpm.cc | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'apt-pkg/deb') diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc index e68dfdc44..874a9ba97 100644 --- a/apt-pkg/deb/dpkgpm.cc +++ b/apt-pkg/deb/dpkgpm.cc @@ -1,6 +1,6 @@ // -*- 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 @@ -175,13 +175,12 @@ bool pkgDPkgPM::RunScriptsWithPkgs(const char *Cnf) SetCloseExec(STDOUT_FILENO,false); SetCloseExec(STDIN_FILENO,false); SetCloseExec(STDERR_FILENO,false); - - const char *Args[5]; + + const char *Args[4]; Args[0] = "/bin/sh"; - 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); } @@ -189,7 +188,7 @@ bool pkgDPkgPM::RunScriptsWithPkgs(const char *Cnf) FileFd Fd(Pipes[1]); // Feed it the filenames. - for (vector::iterator I = List.begin(); I != List.end();) + for (vector::iterator I = List.begin(); I != List.end(); I++) { // Only deal with packages to be installed from .deb if (I->Op != Item::Install) @@ -207,14 +206,14 @@ bool pkgDPkgPM::RunScriptsWithPkgs(const char *Cnf) kill(Process,SIGINT); Fd.Close(); ExecWait(Process,Opts->Value.c_str(),true); - return false; - } + 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) - return false; + return _error->Error("Failure running script %s",Opts->Value.c_str()); } return true; -- cgit v1.2.3