Browse Source

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

Matt Zimmerman 21 years ago
parent
commit
3826564e07

+ 1 - 1
apt-inst/deb/dpkgdb.cc

@@ -61,7 +61,7 @@ static bool EraseDir(const char *Dir)
       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)

+ 14 - 11
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();

+ 3 - 1
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:
 

+ 2 - 2
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;

+ 2 - 2
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);

+ 1 - 1
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)

+ 1 - 1
cmdline/indexcopy.cc

@@ -83,7 +83,7 @@ bool IndexCopy::CopyPackages(string CDROM,string Name,vector<string> &List)
 	 fclose(tmp);
 	 
 	 // Fork gzip
-	 int Process = fork();
+	 pid_t Process = fork();
 	 if (Process < 0)
 	    return _error->Errno("fork","Couldn't fork gzip");
 	 

+ 11 - 1
debian/changelog

@@ -1,6 +1,16 @@
 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
 

+ 4 - 4
ftparchive/multicompress.cc

@@ -271,7 +271,7 @@ bool MultiCompress::Finalize(unsigned long &OutSize)
 /* 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;
@@ -334,7 +334,7 @@ bool MultiCompress::OpenCompress(const CompType *Prog,int &Pid,int FileFd,
 // 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)
@@ -356,7 +356,7 @@ bool MultiCompress::OpenOld(int &Fd,int &Proc)
 // 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)
@@ -439,7 +439,7 @@ bool MultiCompress::Child(int FD)
    while (Missing == false)
    {
       int CompFd = -1;
-      int Proc = -1;
+      pid_t Proc = -1;
       if (OpenOld(CompFd,Proc) == false)
       {
 	 _error->Discard();

+ 3 - 3
ftparchive/multicompress.h

@@ -55,7 +55,7 @@ class MultiCompress
    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();
@@ -68,8 +68,8 @@ class MultiCompress
    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,

+ 1 - 1
ftparchive/writer.cc

@@ -754,7 +754,7 @@ bool ContentsWriter::ReadFromPkgs(string PkgFile,string PkgCompress)
    
    // Open the package file
    int CompFd = -1;
-   int Proc = -1;
+   pid_t Proc = -1;
    if (Pkgs.OpenOld(CompFd,Proc) == false)
       return false;
    

+ 1 - 1
methods/gzip.cc

@@ -57,7 +57,7 @@ bool GzipMethod::Fetch(FetchItem *Itm)
       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]);

+ 1 - 1
methods/rsh.h

@@ -29,7 +29,7 @@ class RSHConn
 
    public:
 
-   int Process;
+   pid_t Process;
 
    // Raw connection IO
    bool WriteMsg(string &Text,bool Sync,const char *Fmt,...);

+ 3 - 3
po/apt-all.pot

@@ -2087,19 +2087,19 @@ 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 ""
 
-#: 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 ""