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
14 files changed:
return _error->Errno("rmdir",_("Failed to remove %s"),Dir);
// Purge it using rm
return _error->Errno("rmdir",_("Failed to remove %s"),Dir);
// Purge it using rm
+ pid_t Pid = ExecFork();
// Spawn the subprocess
if (Pid == 0)
// Spawn the subprocess
if (Pid == 0)
/*}}}*/
// Simulate::Describe - Describe a package /*{{{*/
// ---------------------------------------------------------------------
/*}}}*/
// 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();
{
VerIterator Ver(Sim);
out << Pkg.Name();
{
Ver = Pkg.CurrentVer();
if (Ver.end() == false)
out << " [" << Ver.VerStr() << ']';
}
{
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 /*{{{*/
}
/*}}}*/
// Simulate::Install - Simulate unpacking of a package /*{{{*/
Flags[Pkg->ID] = 1;
cout << "Inst ";
Flags[Pkg->ID] = 1;
cout << "Inst ";
- Describe(Pkg,cout,true);
+ Describe(Pkg,cout,true,true);
Sim.MarkInstall(Pkg,false);
// Look for broken conflicts+predepends.
Sim.MarkInstall(Pkg,false);
// Look for broken conflicts+predepends.
- Describe(Pkg,cout,false);
+ Describe(Pkg,cout,false,true);
}
if (Sim.BrokenCount() != 0)
}
if (Sim.BrokenCount() != 0)
cout << "Purg ";
else
cout << "Remv ";
cout << "Purg ";
else
cout << "Remv ";
- Describe(Pkg,cout,false);
+ Describe(Pkg,cout,true,false);
if (Sim.BrokenCount() != 0)
ShortBreaks();
if (Sim.BrokenCount() != 0)
ShortBreaks();
virtual bool Install(PkgIterator Pkg,string File);
virtual bool Configure(PkgIterator Pkg);
virtual bool Remove(PkgIterator Pkg,bool Purge);
virtual bool Install(PkgIterator Pkg,string File);
virtual bool Configure(PkgIterator Pkg);
virtual bool Remove(PkgIterator Pkg,bool Purge);
- void Describe(PkgIterator iPkg,ostream &out,bool Now);
+ void Describe(PkgIterator iPkg,ostream &out,bool Current,bool Candidate);
/* 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. */
/* 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. */
{
// Fork off the process
pid_t Process = fork();
{
// 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 */
/* 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;
{
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);
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);
// File string manipulators
string flNotDir(string File);
# methods/makefile - FIXME
LIBRARY=apt-pkg
LIBEXT=$(GLIBC_VER)$(LIBSTDCPP_VER)
# methods/makefile - FIXME
LIBRARY=apt-pkg
LIBEXT=$(GLIBC_VER)$(LIBSTDCPP_VER)
MINOR=0
SLIBS=$(PTHREADLIB) $(INTLLIBS)
APT_DOMAIN:=libapt-pkg$(MAJOR)
MINOR=0
SLIBS=$(PTHREADLIB) $(INTLLIBS)
APT_DOMAIN:=libapt-pkg$(MAJOR)
fclose(tmp);
// Fork gzip
fclose(tmp);
// Fork gzip
+ pid_t Process = fork();
if (Process < 0)
return _error->Errno("fork","Couldn't fork gzip");
if (Process < 0)
return _error->Errno("fork","Couldn't fork gzip");
apt (0.6.27) hoary; urgency=low
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
-- 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. */
/* 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;
int &OutFd,bool Comp)
{
Pid = -1;
// MultiCompress::OpenOld - Open an old file /*{{{*/
// ---------------------------------------------------------------------
/* This opens one of the original output files, possibly decompressing it. */
// 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)
{
Files *Best = Outputs;
for (Files *I = Outputs; I != 0; I = I->Next)
// MultiCompress::CloseOld - Close the old file /*{{{*/
// ---------------------------------------------------------------------
/* */
// 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)
{
close(Fd);
if (Proc != -1)
while (Missing == false)
{
int CompFd = -1;
while (Missing == false)
{
int CompFd = -1;
if (OpenOld(CompFd,Proc) == false)
{
_error->Discard();
if (OpenOld(CompFd,Proc) == false)
{
_error->Discard();
mode_t Permissions;
static const CompType Compressors[];
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();
int &OutFd,bool Comp);
bool Child(int Fd);
bool Start();
unsigned long UpdateMTime;
bool Finalize(unsigned long &OutSize);
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,
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;
// Open the package file
int CompFd = -1;
if (Pkgs.OpenOld(CompFd,Proc) == false)
return false;
if (Pkgs.OpenOld(CompFd,Proc) == false)
return false;
return _error->Errno("pipe",_("Couldn't open pipe for %s"),Prog);
// Fork gzip
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]);
if (Process == 0)
{
close(GzOut[0]);
// Raw connection IO
bool WriteMsg(string &Text,bool Sync,const char *Fmt,...);
// Raw connection IO
bool WriteMsg(string &Text,bool Sync,const char *Fmt,...);
msgid "Index file type '%s' is not supported"
msgstr ""
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 ""
#, 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 ""
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 ""
msgid "Unable to correct problems, you have held broken packages."
msgstr ""