From 3826564e07eaffb05eca5af34a0e76f6f161b89c Mon Sep 17 00:00:00 2001 From: Matt Zimmerman Date: Mon, 13 Dec 2004 10:59:20 +0000 Subject: Merge misc-abi-changes Patches applied: * apt@packages.debian.org/apt--misc-abi-changes--0--base-0 tag of apt@packages.debian.org/apt--main--0--patch-16 * apt@packages.debian.org/apt--misc-abi-changes--0--patch-1 Fix apt-get -s remove to not display the candidate version * apt@packages.debian.org/apt--misc-abi-changes--0--patch-2 Merge from main * apt@packages.debian.org/apt--misc-abi-changes--0--patch-3 Use pid_t throughout to hold process IDs --- apt-pkg/algorithms.cc | 25 ++++++++++++++----------- apt-pkg/algorithms.h | 4 +++- apt-pkg/contrib/fileutl.cc | 4 ++-- apt-pkg/contrib/fileutl.h | 4 ++-- apt-pkg/makefile | 2 +- 5 files changed, 22 insertions(+), 17 deletions(-) (limited to 'apt-pkg') diff --git a/apt-pkg/algorithms.cc b/apt-pkg/algorithms.cc index 9b37385bf..479927d65 100644 --- a/apt-pkg/algorithms.cc +++ b/apt-pkg/algorithms.cc @@ -50,26 +50,29 @@ pkgSimulate::pkgSimulate(pkgDepCache *Cache) : pkgPackageManager(Cache), /*}}}*/ // 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 /*{{{*/ @@ -82,7 +85,7 @@ bool pkgSimulate::Install(PkgIterator iPkg,string /*File*/) Flags[Pkg->ID] = 1; cout << "Inst "; - Describe(Pkg,cout,true); + Describe(Pkg,cout,true,true); Sim.MarkInstall(Pkg,false); // Look for broken conflicts+predepends. @@ -156,7 +159,7 @@ bool pkgSimulate::Configure(PkgIterator iPkg) else { cout << "Conf "; - Describe(Pkg,cout,false); + Describe(Pkg,cout,false,true); } if (Sim.BrokenCount() != 0) @@ -181,7 +184,7 @@ bool pkgSimulate::Remove(PkgIterator iPkg,bool Purge) cout << "Purg "; else cout << "Remv "; - Describe(Pkg,cout,false); + Describe(Pkg,cout,true,false); if (Sim.BrokenCount() != 0) ShortBreaks(); diff --git a/apt-pkg/algorithms.h b/apt-pkg/algorithms.h index 0b38e4244..174a7f58d 100644 --- a/apt-pkg/algorithms.h +++ b/apt-pkg/algorithms.h @@ -67,8 +67,10 @@ class pkgSimulate : public pkgPackageManager 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: diff --git a/apt-pkg/contrib/fileutl.cc b/apt-pkg/contrib/fileutl.cc index 4ba8ab05a..7c9f5c0dd 100644 --- a/apt-pkg/contrib/fileutl.cc +++ b/apt-pkg/contrib/fileutl.cc @@ -306,7 +306,7 @@ bool WaitFd(int Fd,bool write,unsigned long timeout) /* 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(); @@ -340,7 +340,7 @@ int ExecFork() /* 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; diff --git a/apt-pkg/contrib/fileutl.h b/apt-pkg/contrib/fileutl.h index b6b9cae83..041aa3309 100644 --- a/apt-pkg/contrib/fileutl.h +++ b/apt-pkg/contrib/fileutl.h @@ -87,8 +87,8 @@ string SafeGetCWD(); 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); diff --git a/apt-pkg/makefile b/apt-pkg/makefile index ec2013b04..e62a7efd5 100644 --- a/apt-pkg/makefile +++ b/apt-pkg/makefile @@ -13,7 +13,7 @@ include ../buildlib/defaults.mak # 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) -- cgit v1.2.3