]> git.saurik.com Git - apt.git/blobdiff - ftparchive/multicompress.cc
* debian/apt.postinst:
[apt.git] / ftparchive / multicompress.cc
index fabd460f86f2905a77ecd162a57044c5e72ae0fc..16cef9769e7e36a495159874600a23e01ce6f0e0 100644 (file)
    ##################################################################### */
                                                                        /*}}}*/
 // Include Files                                                       /*{{{*/
-#ifdef __GNUG__
-#pragma implementation "multicompress.h"
-#endif
-
 #include "multicompress.h"
     
 #include <apti18n.h>
@@ -38,6 +34,7 @@ const MultiCompress::CompType MultiCompress::Compressors[] =
       {{".","",0,0,0,1},
        {"gzip",".gz","gzip","-9n","-d",2},
        {"bzip2",".bz2","bzip2","-9","-d",3},
+       {"lzma",".lzma","lzma","-9","-d",4},
        {}};
 
 // MultiCompress::MultiCompress - Constructor                          /*{{{*/
@@ -72,7 +69,7 @@ MultiCompress::MultiCompress(string Output,string Compress,
       // Hmm.. unknown.
       if (Comp->Name == 0)
       {
-        _error->Warning(_("Unknown Compresison Algorithm '%s'"),string(Start,I).c_str());
+        _error->Warning(_("Unknown compression algorithm '%s'"),string(Start,I).c_str());
         continue;
       }
       
@@ -212,7 +209,7 @@ bool MultiCompress::Die()
    
    fclose(Input);
    Input = 0;
-   bool Res = ExecWait(Outputter,_("Compress Child"),false);
+   bool Res = ExecWait(Outputter,_("Compress child"),false);
    Outputter = -1;
    return Res;
 }
@@ -235,7 +232,7 @@ bool MultiCompress::Finalize(unsigned long &OutSize)
    {
       struct stat St;
       if (stat(I->Output.c_str(),&St) != 0)
-        return  _error->Error(_("Internal Error, Failed to create %s"),
+        return  _error->Error(_("Internal error, failed to create %s"),
                               I->Output.c_str());
       
       if (I->OldMTime != St.st_mtime)
@@ -271,7 +268,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 +331,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 +353,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)
@@ -368,7 +365,7 @@ bool MultiCompress::CloseOld(int Fd,int Proc)
 // MultiCompress::Child - The writer child                             /*{{{*/
 // ---------------------------------------------------------------------
 /* The child process forks a bunch of compression children and takes 
-   input on FD and passes it to all the compressor childer. On the way it
+   input on FD and passes it to all the compressor child. On the way it
    computes the MD5 of the raw data. After this the raw data in the 
    original files is compared to see if this data is new. If the data
    is new then the temp files are renamed, otherwise they are erased. */
@@ -439,7 +436,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();