return _error->Errno("rmdir",_("Failed to remove %s"),Dir);
// Purge it using rm
- int Pid = ExecFork();
+ pid_t Pid = ExecFork();
// Spawn the subprocess
if (Pid == 0)
/*}}}*/
// Simulate::Describe - Describe a package /*{{{*/
// ---------------------------------------------------------------------
-/* Parameter Now == true gives both current and available varsion,
- Parameter Now == false gives only the available package version */
-void pkgSimulate::Describe(PkgIterator Pkg,ostream &out,bool Now)
+/* Parameter Current == true displays the current package version,
+ Parameter Candidate == true displays the candidate package version */
+void pkgSimulate::Describe(PkgIterator Pkg,ostream &out,bool Current,bool Candidate)
{
VerIterator Ver(Sim);
out << Pkg.Name();
- if (Now == true)
+ if (Current == true)
{
Ver = Pkg.CurrentVer();
if (Ver.end() == false)
out << " [" << Ver.VerStr() << ']';
}
- Ver = Sim[Pkg].CandidateVerIter(Sim);
- if (Ver.end() == true)
- return;
+ if (Candidate == true)
+ {
+ Ver = Sim[Pkg].CandidateVerIter(Sim);
+ if (Ver.end() == true)
+ return;
- out << " (" << Ver.VerStr() << ' ' << Ver.RelStr() << ')';
+ out << " (" << Ver.VerStr() << ' ' << Ver.RelStr() << ')';
+ }
}
/*}}}*/
// Simulate::Install - Simulate unpacking of a package /*{{{*/
Flags[Pkg->ID] = 1;
cout << "Inst ";
- Describe(Pkg,cout,true);
+ Describe(Pkg,cout,true,true);
Sim.MarkInstall(Pkg,false);
// Look for broken conflicts+predepends.
else
{
cout << "Conf ";
- Describe(Pkg,cout,false);
+ Describe(Pkg,cout,false,true);
}
if (Sim.BrokenCount() != 0)
cout << "Purg ";
else
cout << "Remv ";
- Describe(Pkg,cout,false);
+ Describe(Pkg,cout,true,false);
if (Sim.BrokenCount() != 0)
ShortBreaks();
virtual bool Install(PkgIterator Pkg,string File);
virtual bool Configure(PkgIterator Pkg);
virtual bool Remove(PkgIterator Pkg,bool Purge);
+
+private:
void ShortBreaks();
- void Describe(PkgIterator iPkg,ostream &out,bool Now);
+ void Describe(PkgIterator iPkg,ostream &out,bool Current,bool Candidate);
public:
/* This is used if you want to cleanse the environment for the forked
child, it fixes up the important signals and nukes all of the fds,
otherwise acts like normal fork. */
-int ExecFork()
+pid_t ExecFork()
{
// Fork off the process
pid_t Process = fork();
/* Waits for the given sub process. If Reap is set then no errors are
generated. Otherwise a failed subprocess will generate a proper descriptive
message */
-bool ExecWait(int Pid,const char *Name,bool Reap)
+bool ExecWait(pid_t Pid,const char *Name,bool Reap)
{
if (Pid <= 1)
return true;
void SetCloseExec(int Fd,bool Close);
void SetNonBlock(int Fd,bool Block);
bool WaitFd(int Fd,bool write = false,unsigned long timeout = 0);
-int ExecFork();
-bool ExecWait(int Pid,const char *Name,bool Reap = false);
+pid_t ExecFork();
+bool ExecWait(pid_t Pid,const char *Name,bool Reap = false);
// File string manipulators
string flNotDir(string File);
# methods/makefile - FIXME
LIBRARY=apt-pkg
LIBEXT=$(GLIBC_VER)$(LIBSTDCPP_VER)
-MAJOR=3.6
+MAJOR=3.7
MINOR=0
SLIBS=$(PTHREADLIB) $(INTLLIBS)
APT_DOMAIN:=libapt-pkg$(MAJOR)
fclose(tmp);
// Fork gzip
- int Process = fork();
+ pid_t Process = fork();
if (Process < 0)
return _error->Errno("fork","Couldn't fork gzip");
apt (0.6.27) hoary; urgency=low
- * Merge apt--authentication--0 branch (gpg authentication)
+ * Merge apt--authentication--0 branch
+ - Implement gpg authentication for package repositories (Closes: #203741)
+ - Also includes Michael Vogt's fixes
+ * Merge apt--misc-abi-changes--0 branch
+ - Use pid_t throughout to hold process IDs (Closes: #226701)
+ - Import patch from Debian bug #195510: (Closes: #195510)
+ - Make Simulate::Describe and Simulate::ShortBreaks private member
+ functions
+ - Add a parameter (Candidate) to Describe to control whether the
+ candidate version is displayed
+ - Pass an appropriate value for Candidate everywhere Describe is called
-- Matt Zimmerman <mdz@canonical.com> Mon, 13 Dec 2004 01:03:11 -0800
/* This opens the compressor, either in compress mode or decompress
mode. FileFd is always the compressor input/output file,
OutFd is the created pipe, Input for Compress, Output for Decompress. */
-bool MultiCompress::OpenCompress(const CompType *Prog,int &Pid,int FileFd,
+bool MultiCompress::OpenCompress(const CompType *Prog,pid_t &Pid,int FileFd,
int &OutFd,bool Comp)
{
Pid = -1;
// MultiCompress::OpenOld - Open an old file /*{{{*/
// ---------------------------------------------------------------------
/* This opens one of the original output files, possibly decompressing it. */
-bool MultiCompress::OpenOld(int &Fd,int &Proc)
+bool MultiCompress::OpenOld(int &Fd,pid_t &Proc)
{
Files *Best = Outputs;
for (Files *I = Outputs; I != 0; I = I->Next)
// MultiCompress::CloseOld - Close the old file /*{{{*/
// ---------------------------------------------------------------------
/* */
-bool MultiCompress::CloseOld(int Fd,int Proc)
+bool MultiCompress::CloseOld(int Fd,pid_t Proc)
{
close(Fd);
if (Proc != -1)
while (Missing == false)
{
int CompFd = -1;
- int Proc = -1;
+ pid_t Proc = -1;
if (OpenOld(CompFd,Proc) == false)
{
_error->Discard();
mode_t Permissions;
static const CompType Compressors[];
- bool OpenCompress(const CompType *Prog,int &Pid,int FileFd,
+ bool OpenCompress(const CompType *Prog,pid_t &Pid,int FileFd,
int &OutFd,bool Comp);
bool Child(int Fd);
bool Start();
unsigned long UpdateMTime;
bool Finalize(unsigned long &OutSize);
- bool OpenOld(int &Fd,int &Proc);
- bool CloseOld(int Fd,int Proc);
+ bool OpenOld(int &Fd,pid_t &Proc);
+ bool CloseOld(int Fd,pid_t Proc);
static bool GetStat(string Output,string Compress,struct stat &St);
MultiCompress(string Output,string Compress,mode_t Permissions,
// Open the package file
int CompFd = -1;
- int Proc = -1;
+ pid_t Proc = -1;
if (Pkgs.OpenOld(CompFd,Proc) == false)
return false;
return _error->Errno("pipe",_("Couldn't open pipe for %s"),Prog);
// Fork gzip
- int Process = ExecFork();
+ pid_t Process = ExecFork();
if (Process == 0)
{
close(GzOut[0]);
public:
- int Process;
+ pid_t Process;
// Raw connection IO
bool WriteMsg(string &Text,bool Sync,const char *Fmt,...);
msgid "Index file type '%s' is not supported"
msgstr ""
-#: apt-pkg/algorithms.cc:238
+#: apt-pkg/algorithms.cc:241
#, c-format
msgid ""
"The package %s needs to be reinstalled, but I can't find an archive for it."
msgstr ""
-#: apt-pkg/algorithms.cc:1056
+#: apt-pkg/algorithms.cc:1059
msgid ""
"Error, pkgProblemResolver::Resolve generated breaks, this may be caused by "
"held packages."
msgstr ""
-#: apt-pkg/algorithms.cc:1058
+#: apt-pkg/algorithms.cc:1061
msgid "Unable to correct problems, you have held broken packages."
msgstr ""