]> git.saurik.com Git - apt.git/commitdiff
* Removed the more leftover #pragma interface/implementation
authorMichael Vogt <egon@bottom>
Fri, 8 Jun 2007 21:37:27 +0000 (23:37 +0200)
committerMichael Vogt <egon@bottom>
Fri, 8 Jun 2007 21:37:27 +0000 (23:37 +0200)
  closes: #306937 (thanks to Andreas Henriksson for the patch)

21 files changed:
1  2 
apt-pkg/acquire-worker.cc
apt-pkg/acquire.cc
apt-pkg/algorithms.cc
apt-pkg/cdrom.cc
apt-pkg/contrib/fileutl.cc
apt-pkg/contrib/progress.cc
apt-pkg/contrib/strutl.cc
apt-pkg/deb/debindexfile.cc
apt-pkg/deb/debmetaindex.cc
apt-pkg/deb/debrecords.cc
apt-pkg/deb/debsrcrecords.cc
apt-pkg/deb/dpkgpm.cc
apt-pkg/indexfile.cc
apt-pkg/orderlist.cc
apt-pkg/packagemanager.cc
apt-pkg/pkgcachegen.cc
apt-pkg/pkgrecords.cc
apt-pkg/policy.cc
apt-pkg/tagfile.cc
debian/changelog
ftparchive/apt-ftparchive.cc

index 8ab67778be5b8322fcbb1967bb74b253144fb494,063aa5ed7e346d627b194393433171917a0f4501..25d40ef542f82a7f8af80c75e6284b6b2c1cf7ff
@@@ -12,9 -12,6 +12,6 @@@
     ##################################################################### */
                                                                        /*}}}*/
  // Include Files                                                      /*{{{*/
- #ifdef __GNUG__
- #pragma implementation "apt-pkg/acquire-worker.h"
- #endif
  #include <apt-pkg/acquire-worker.h>
  #include <apt-pkg/acquire-item.h>
  #include <apt-pkg/configuration.h>
@@@ -307,13 -304,6 +304,13 @@@ bool pkgAcquire::Worker::RunMessages(
            pkgAcquire::Item *Owner = Itm->Owner;
            pkgAcquire::ItemDesc Desc = *Itm;
            OwnerQ->ItemDone(Itm);
 +
 +          // set some status
 +          if(LookupTag(Message,"FailReason") == "Timeout" || 
 +             LookupTag(Message,"FailReason") == "TmpResolveFailure" ||
 +             LookupTag(Message,"FailReason") == "ConnectionRefused") 
 +             Owner->Status = pkgAcquire::Item::StatTransientNetworkError;
 +
            Owner->Failed(Message,Config);
            ItemDone();
  
diff --combined apt-pkg/acquire.cc
index e1dccf25ab1372b347b004f313403691c7dfbb8a,ed78ec9715c112e4e0a18a12e6a2870be509959a..cbd67055d952a37de89027a85804764869f9a5b8
@@@ -13,9 -13,6 +13,6 @@@
     ##################################################################### */
                                                                        /*}}}*/
  // Include Files                                                      /*{{{*/
- #ifdef __GNUG__
- #pragma implementation "apt-pkg/acquire.h"
- #endif       
  #include <apt-pkg/acquire.h>
  #include <apt-pkg/acquire-item.h>
  #include <apt-pkg/acquire-worker.h>
@@@ -193,9 -190,9 +190,9 @@@ void pkgAcquire::Enqueue(ItemDesc &Item
     Item.Owner->Status = Item::StatIdle;
     
     // Queue it into the named queue
 -   I->Enqueue(Item);
 -   ToFetch++;
 -         
 +   if(I->Enqueue(Item)) 
 +      ToFetch++;
 +            
     // Some trace stuff
     if (Debug == true)
     {
@@@ -549,17 -546,11 +546,17 @@@ pkgAcquire::Queue::~Queue(
  // Queue::Enqueue - Queue an item to the queue                                /*{{{*/
  // ---------------------------------------------------------------------
  /* */
 -void pkgAcquire::Queue::Enqueue(ItemDesc &Item)
 +bool pkgAcquire::Queue::Enqueue(ItemDesc &Item)
  {
     QItem **I = &Items;
 -   for (; *I != 0; I = &(*I)->Next);
 -   
 +   // move to the end of the queue and check for duplicates here
 +   for (; *I != 0; I = &(*I)->Next)
 +      if (Item.URI == (*I)->URI) 
 +      {
 +       Item.Owner->Status = Item::StatDone;
 +       return false;
 +      }
 +
     // Create a new item
     QItem *Itm = new QItem;
     *Itm = Item;
     Item.Owner->QueueCounter++;   
     if (Items->Next == 0)
        Cycle();
 +   return true;
  }
                                                                        /*}}}*/
  // Queue::Dequeue - Remove an item from the queue                     /*{{{*/
diff --combined apt-pkg/algorithms.cc
index 93e26c7c6145abdaa34a27e460bd3b33dd314aab,3ac98216bfbcb13632f086735949ebcc50de42fb..b21fcbb2f9b4e9a8d51553b5877bd3b45cc90054
     ##################################################################### */
                                                                        /*}}}*/
  // Include Files                                                      /*{{{*/
- #ifdef __GNUG__
- #pragma implementation "apt-pkg/algorithms.h"
- #endif 
  #include <apt-pkg/algorithms.h>
  #include <apt-pkg/error.h>
  #include <apt-pkg/configuration.h>
 +#include <apt-pkg/version.h>
  #include <apt-pkg/sptr.h>
 +
      
  #include <apti18n.h>
 -    
 +#include <sys/types.h>
 +#include <cstdlib>
 +#include <algorithm>
  #include <iostream>
                                                                        /*}}}*/
  using namespace std;
@@@ -104,7 -97,6 +101,7 @@@ bool pkgSimulate::Install(PkgIterator i
         DepIterator End;
         D.GlobOr(Start,End);
         if (Start->Type == pkgCache::Dep::Conflicts ||
 +           Start->Type == pkgCache::Dep::DpkgBreaks ||
             Start->Type == pkgCache::Dep::Obsoletes ||
             End->Type == pkgCache::Dep::PreDepends)
           {
@@@ -154,8 -146,6 +151,8 @@@ bool pkgSimulate::Configure(PkgIterato
            cout << " Obsoletes:" << D.TargetPkg().Name();
         else if (D->Type == pkgCache::Dep::Conflicts)
            cout << " Conflicts:" << D.TargetPkg().Name();
 +       else if (D->Type == pkgCache::Dep::DpkgBreaks)
 +          cout << " Breaks:" << D.TargetPkg().Name();
         else
            cout << " Depends:" << D.TargetPkg().Name();
        }           
@@@ -227,8 -217,6 +224,8 @@@ void pkgSimulate::ShortBreaks(
     the necessary calculations to deal with the problems. */
  bool pkgApplyStatus(pkgDepCache &Cache)
  {
 +   pkgDepCache::ActionGroup group(Cache);
 +
     for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; I++)
     {
        if (I->VersionList == 0)
          I->InstState == pkgCache::State::HoldReInstReq)
        {
         if (I->CurrentVer != 0 && I.CurrentVer().Downloadable() == true)
 -          Cache.MarkKeep(I);
 +          Cache.MarkKeep(I, false, false);
         else
         {
            // Is this right? Will dpkg choke on an upgrade?
            if (Cache[I].CandidateVer != 0 &&
                 Cache[I].CandidateVerIter(Cache).Downloadable() == true)
 -             Cache.MarkInstall(I);
 +             Cache.MarkInstall(I, false, 0, false);
            else
               return _error->Error(_("The package %s needs to be reinstalled, "
                                    "but I can't find an archive for it."),I.Name());
         case pkgCache::State::HalfConfigured:
         if ((I->CurrentVer != 0 && I.CurrentVer().Downloadable() == true) ||
             I.State() != pkgCache::PkgIterator::NeedsUnpack)
 -          Cache.MarkKeep(I);
 +          Cache.MarkKeep(I, false, false);
         else
         {
            if (Cache[I].CandidateVer != 0 &&
                 Cache[I].CandidateVerIter(Cache).Downloadable() == true)
 -             Cache.MarkInstall(I);
 +             Cache.MarkInstall(I, true, 0, false);
            else
               Cache.MarkDelete(I);
         }
     on the result. */
  bool pkgFixBroken(pkgDepCache &Cache)
  {
 +   pkgDepCache::ActionGroup group(Cache);
 +
     // Auto upgrade all broken packages
     for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; I++)
        if (Cache[I].NowBroken() == true)
 -       Cache.MarkInstall(I,true);
 +       Cache.MarkInstall(I, true, 0, false);
     
     /* Fix packages that are in a NeedArchive state but don't have a
        downloadable install version */
        if (Cache[I].InstVerIter(Cache).Downloadable() == false)
         continue;
  
 -      Cache.MarkInstall(I,true);      
 +      Cache.MarkInstall(I, true, 0, false);
     }
     
     pkgProblemResolver Fix(&Cache);
   */
  bool pkgDistUpgrade(pkgDepCache &Cache)
  {
 +   pkgDepCache::ActionGroup group(Cache);
 +
     /* Auto upgrade all installed packages, this provides the basis 
        for the installation */
     for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; I++)
        if (I->CurrentVer != 0)
 -       Cache.MarkInstall(I,true);
 +       Cache.MarkInstall(I, true, 0, false);
  
     /* Now, auto upgrade all essential packages - this ensures that
        the essential packages are present and working */
     for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; I++)
        if ((I->Flags & pkgCache::Flag::Essential) == pkgCache::Flag::Essential)
 -       Cache.MarkInstall(I,true);
 +       Cache.MarkInstall(I, true, 0, false);
     
     /* We do it again over all previously installed packages to force 
        conflict resolution on them all. */
     for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; I++)
        if (I->CurrentVer != 0)
 -       Cache.MarkInstall(I,false);
 +       Cache.MarkInstall(I, false, 0, false);
  
     pkgProblemResolver Fix(&Cache);
  
         if (I->SelectedState == pkgCache::State::Hold)
         {
            Fix.Protect(I);
 -          Cache.MarkKeep(I);
 +          Cache.MarkKeep(I, false, false);
         }
        }
     }
     to install packages not marked for install */
  bool pkgAllUpgrade(pkgDepCache &Cache)
  {
 +   pkgDepCache::ActionGroup group(Cache);
 +
     pkgProblemResolver Fix(&Cache);
  
     if (Cache.BrokenCount() != 0)
            continue;
        
        if (I->CurrentVer != 0 && Cache[I].InstallVer != 0)
 -       Cache.MarkInstall(I,false);
 +       Cache.MarkInstall(I, false, 0, false);
     }
        
     return Fix.ResolveByKeep();
     the package is restored. */
  bool pkgMinimizeUpgrade(pkgDepCache &Cache)
  {   
 +   pkgDepCache::ActionGroup group(Cache);
 +
     if (Cache.BrokenCount() != 0)
        return false;
     
            continue;
  
         // Keep it and see if that is OK
 -       Cache.MarkKeep(I);
 +       Cache.MarkKeep(I, false, false);
         if (Cache.BrokenCount() != 0)
 -          Cache.MarkInstall(I,false);
 +          Cache.MarkInstall(I, false, 0, false);
         else
         {
            // If keep didnt actually do anything then there was no change..
@@@ -511,10 -491,8 +508,10 @@@ void pkgProblemResolver::MakeScores(
         Score += PrioMap[Cache[I].InstVerIter(Cache)->Priority];
        
        /* This helps to fix oddball problems with conflicting packages
 -         on the same level. We enhance the score of installed packages */
 -      if (I->CurrentVer != 0)
 +         on the same level. We enhance the score of installed packages 
 +       if those are not obsolete
 +      */
 +      if (I->CurrentVer != 0 && Cache[I].CandidateVer != 0 && Cache[I].CandidateVerIter(Cache).Downloadable())
         Score += 1;
     }
  
     installable */
  bool pkgProblemResolver::DoUpgrade(pkgCache::PkgIterator Pkg)
  {
 +   pkgDepCache::ActionGroup group(Cache);
 +
     if ((Flags[Pkg->ID] & Upgradable) == 0 || Cache[Pkg].Upgradable() == false)
        return false;
     if ((Flags[Pkg->ID] & Protected) == Protected)
     Flags[Pkg->ID] &= ~Upgradable;
     
     bool WasKept = Cache[Pkg].Keep();
 -   Cache.MarkInstall(Pkg,false);
 +   Cache.MarkInstall(Pkg, false, 0, false);
  
     // This must be a virtual package or something like that.
     if (Cache[Pkg].InstVerIter(Cache).end() == true)
               /* We let the algorithm deal with conflicts on its next iteration,
                it is much smarter than us */
               if (Start->Type == pkgCache::Dep::Conflicts || 
 +                 Start->Type == pkgCache::Dep::DpkgBreaks || 
                   Start->Type == pkgCache::Dep::Obsoletes)
                   break;
               
     if (Fail == true)
     {
        if (WasKept == true)
 -       Cache.MarkKeep(Pkg);
 +       Cache.MarkKeep(Pkg, false, false);
        else
         Cache.MarkDelete(Pkg);
        return false;
     upgrade packages to advoid problems. */
  bool pkgProblemResolver::Resolve(bool BrokenFix)
  {
 +   pkgDepCache::ActionGroup group(Cache);
 +
     unsigned long Size = Cache.Head().PackageCount;
  
     // Record which packages are marked for install
         {
            if (Cache[I].InstBroken() == true && BrokenFix == true)
            {
 -             Cache.MarkInstall(I,false);
 +             Cache.MarkInstall(I, false, 0, false);
               if (Cache[I].Install() == true)
                  Again = true;
            }
            pkgCache::Version *OldVer = Cache[I].InstallVer;
            Flags[I->ID] &= ReInstateTried;
            
 -          Cache.MarkInstall(I,false);
 +          Cache.MarkInstall(I, false, 0, false);
            if (Cache[I].InstBroken() == true || 
                OldBreaks < Cache.BrokenCount())
            {
               if (OldVer == 0)
                  Cache.MarkDelete(I);
               else
 -                Cache.MarkKeep(I);
 +                Cache.MarkKeep(I, false, false);
            }       
            else
               if (Debug == true)
            continue;
         
         if (Debug == true)
 -          cout << "Investigating " << I.Name() << endl;
 +          clog << "Investigating " << I.Name() << endl;
         
         // Isolate the problem dependency
         PackageKill KillList[100];
                  {
                     if (Debug == true)
                        clog << "  Or group keep for " << I.Name() << endl;
 -                   Cache.MarkKeep(I);
 +                   Cache.MarkKeep(I, false, false);
                     Change = true;
                  }
               }
               OldEnd = LEnd;
            }
            else
 +            {
               Start++;
 +             // We only worry about critical deps.
 +             if (Start.IsCritical() != true)
 +                  continue;
 +            }
  
            // Dep is ok
            if ((Cache[End] & pkgDepCache::DepGInstall) == pkgDepCache::DepGInstall)
            SPtrArray<pkgCache::Version *> VList = Start.AllTargets();
            if (*VList == 0 && (Flags[I->ID] & Protected) != Protected &&
                Start->Type != pkgCache::Dep::Conflicts &&
 +              Start->Type != pkgCache::Dep::DpkgBreaks &&
                Start->Type != pkgCache::Dep::Obsoletes &&
                Cache[I].NowBroken() == false)
            {          
               }
               
               Change = true;
 -             Cache.MarkKeep(I);                 
 +             Cache.MarkKeep(I, false, false);
               break;
            }
            
               if (Scores[I->ID] <= Scores[Pkg->ID] ||
                   ((Cache[Start] & pkgDepCache::DepNow) == 0 &&
                    End->Type != pkgCache::Dep::Conflicts &&
 +                  End->Type != pkgCache::Dep::DpkgBreaks &&
                    End->Type != pkgCache::Dep::Obsoletes))
               {
                  // Try a little harder to fix protected packages..
                  /* See if a keep will do, unless the package is protected,
                     then installing it will be necessary */
                  bool Installed = Cache[I].Install();
 -                Cache.MarkKeep(I);
 +                Cache.MarkKeep(I, false, false);
                  if (Cache[I].InstBroken() == false)
                  {
                     // Unwind operation will be keep now
                     
                     // Restore
                     if (InOr == true && Installed == true)
 -                      Cache.MarkInstall(I,false);
 +                      Cache.MarkInstall(I, false, 0, false);
                     
                     if (Debug == true)
                        clog << "  Holding Back " << I.Name() << " rather than change " << Start.TargetPkg().Name() << endl;
                      (Start->Type == pkgCache::Dep::Conflicts ||
                       Start->Type == pkgCache::Dep::Obsoletes))
                     continue;
 -                
 +
 +                if (Start->Type == pkgCache::Dep::DpkgBreaks)
 +                {
 +                   /* Would it help if we upgraded? */
 +                   if (Cache[End] & pkgDepCache::DepGCVer) {
 +                      if (Debug)
 +                         clog << "  Upgrading " << Pkg.Name() << " due to Breaks field in " << I.Name() << endl;
 +                      Cache.MarkInstall(Pkg, false, 0, false);
 +                      continue;
 +                   }
 +                   if (Debug)
 +                      clog << "  Will not break " << Pkg.Name() << " as stated in Breaks field in " << I.Name() <<endl;
 +                   Cache.MarkKeep(I, false, false);
 +                   continue;
 +                }
 +
                  // Skip adding to the kill list if it is protected
                  if ((Flags[Pkg->ID] & Protected) != 0)
                     continue;
            // Hm, nothing can possibly satisify this dep. Nuke it.
            if (VList[0] == 0 && 
                Start->Type != pkgCache::Dep::Conflicts &&
 +              Start->Type != pkgCache::Dep::DpkgBreaks &&
                Start->Type != pkgCache::Dep::Obsoletes &&
                (Flags[I->ID] & Protected) != Protected)
            {
                  
                  // Restore
                  if (InOr == true && Installed == true)
 -                   Cache.MarkInstall(I,false);
 +                   Cache.MarkInstall(I, false, 0, false);
                  
                  if (Debug == true)
                     clog << "  Holding Back " << I.Name() << " because I can't find " << Start.TargetPkg().Name() << endl;
               {
                  if (Debug == true)
                     clog << "  Fixing " << I.Name() << " via keep of " << J->Pkg.Name() << endl;
 -                Cache.MarkKeep(J->Pkg);
 +                Cache.MarkKeep(J->Pkg, false, false);
               }
  
               if (Counter > 1)
        return _error->Error(_("Unable to correct problems, you have held broken packages."));
     }
     
 +   // set the auto-flags (mvo: I'm not sure if we _really_ need this, but
 +   // I didn't managed 
 +   pkgCache::PkgIterator I = Cache.PkgBegin();
 +   for (;I.end() != true; I++) {
 +      if (Cache[I].NewInstall() && !(Flags[I->ID] & PreInstalled)) {
 +       if(_config->FindI("Debug::pkgAutoRemove",false)) {
 +          std::clog << "Resolve installed new pkg: " << I.Name() 
 +                    << " (now marking it as auto)" << std::endl;
 +       }
 +       Cache[I].Flags |= pkgCache::Flag::Auto;
 +      }
 +   }
 +
 +
     return true;
  }
                                                                        /*}}}*/
     system was non-broken previously. */
  bool pkgProblemResolver::ResolveByKeep()
  {
 +   pkgDepCache::ActionGroup group(Cache);
 +
     unsigned long Size = Cache.Head().PackageCount;
  
     if (Debug == true)      
        {
         if (Debug == true)
            clog << "Keeping package " << I.Name() << endl;
 -       Cache.MarkKeep(I);
 +       Cache.MarkKeep(I, false, false);
         if (Cache[I].InstBroken() == false)
         {
            K = PList - 1;
               {
                  if (Debug == true)
                     clog << "  Keeping Package " << Pkg.Name() << " due to dep" << endl;
 -                Cache.MarkKeep(Pkg);
 +                Cache.MarkKeep(Pkg, false, false);
               }
               
               if (Cache[I].InstBroken() == false)
  /* This is used to make sure protected packages are installed */
  void pkgProblemResolver::InstallProtect()
  {
 +   pkgDepCache::ActionGroup group(Cache);
 +
     for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; I++)
     {
        if ((Flags[I->ID] & Protected) == Protected)
        {
         if ((Flags[I->ID] & ToRemove) == ToRemove)
            Cache.MarkDelete(I);
 -       else
 -          Cache.MarkInstall(I,false);
 +       else 
 +       {
 +          // preserver the information if the package was auto
 +          // or manual installed
 +          bool autoInst = (Cache[I].Flags & pkgCache::Flag::Auto);
 +          Cache.MarkInstall(I, false, 0, !autoInst);
 +       }
        }
     }   
  }
@@@ -1302,4 -1229,3 +1299,4 @@@ void pkgPrioSortList(pkgCache &Cache,pk
     qsort(List,Count,sizeof(*List),PrioComp);
  }
                                                                        /*}}}*/
 +
diff --combined apt-pkg/cdrom.cc
index afa99bc7332008573603aeafe82918ec1ea10576,9b0568d8f04c179e1904cee5c03ba0d323a25730..4a688a5e1c1a1545383e16f7d04bd8d5be2c462e
@@@ -1,9 -1,6 +1,6 @@@
  /*
   */
  
- #ifdef __GNUG__
- #pragma implementation "apt-pkg/cdrom.h"
- #endif
  #include<apt-pkg/init.h>
  #include<apt-pkg/error.h>
  #include<apt-pkg/cdromutl.h>
@@@ -18,7 -15,6 +15,7 @@@
  #include <dirent.h>
  #include <unistd.h>
  #include <stdio.h>
 +#include <algorithm>
  
  
  #include "indexcopy.h"
@@@ -31,16 -27,12 +28,16 @@@ using namespace std
     search that short circuits when it his a package file in the dir.
     This speeds it up greatly as the majority of the size is in the
     binary-* sub dirs. */
 -bool pkgCdrom::FindPackages(string CD,vector<string> &List,
 -                          vector<string> &SList, vector<string> &SigList,
 +bool pkgCdrom::FindPackages(string CD,
 +                          vector<string> &List,
 +                          vector<string> &SList, 
 +                          vector<string> &SigList,
 +                          vector<string> &TransList,
                            string &InfoDir, pkgCdromStatus *log,
                            unsigned int Depth)
  {
     static ino_t Inodes[9];
 +   DIR *D;
  
     // if we have a look we "pulse" now
     if(log)
        if (_config->FindB("APT::CDROM::Thorough",false) == false)
         return true;
     }
 +
 +   // see if we find translatin indexes
 +   if (stat("i18n",&Buf) == 0)
 +   {
 +      D = opendir("i18n");
 +      for (struct dirent *Dir = readdir(D); Dir != 0; Dir = readdir(D))
 +      {
 +       if(strstr(Dir->d_name,"Translation") != NULL) 
 +       {
 +          if (_config->FindB("Debug::aptcdrom",false) == true)
 +             std::clog << "found translations: " << Dir->d_name << "\n";
 +          string file = Dir->d_name;
 +          if(file.substr(file.size()-3,file.size()) == ".gz")
 +             file = file.substr(0,file.size()-3);
 +          TransList.push_back(CD+"i18n/"+ file);
 +       }
 +      }
 +      closedir(D);
 +   }
 +
     
 -   DIR *D = opendir(".");
 +   D = opendir(".");
     if (D == 0)
        return _error->Errno("opendir","Unable to read %s",CD.c_str());
     
        Inodes[Depth] = Buf.st_ino;
  
        // Descend
 -      if (FindPackages(CD + Dir->d_name,List,SList,SigList,InfoDir,log,Depth+1) == false)
 +      if (FindPackages(CD + Dir->d_name,List,SList,SigList,TransList,InfoDir,log,Depth+1) == false)
         break;
  
        if (chdir(CD.c_str()) != 0)
@@@ -637,10 -609,9 +634,10 @@@ bool pkgCdrom::Add(pkgCdromStatus *log
     vector<string> List;
     vector<string> SourceList;
     vector<string> SigList;
 +   vector<string> TransList;
     string StartDir = SafeGetCWD();
     string InfoDir;
 -   if (FindPackages(CDROM,List,SourceList, SigList,InfoDir,log) == false)
 +   if (FindPackages(CDROM,List,SourceList, SigList,TransList,InfoDir,log) == false)
     {
        log->Update("\n");
        return false;
     DropRepeats(List,"Packages");
     DropRepeats(SourceList,"Sources");
     DropRepeats(SigList,"Release.gpg");
 +   DropRepeats(TransList,"");
     if(log) {
        msg.str("");
 -      ioprintf(msg, _("Found %i package indexes, %i source indexes and "
 -                    "%i signatures\n"), 
 -             List.size(), SourceList.size(), SigList.size());
 +      ioprintf(msg, _("Found %i package indexes, %i source indexes, "
 +                    "%i translation indexes and %i signatures\n"), 
 +             List.size(), SourceList.size(), TransList.size(),
 +             SigList.size());
        log->Update(msg.str(), STEP_SCAN);
     }
  
     if (List.size() == 0 && SourceList.size() == 0) 
     {
 -      UnmountCdrom(CDROM);
 +      if (_config->FindB("APT::CDROM::NoMount",false) == false) 
 +       UnmountCdrom(CDROM);
        return _error->Error("Unable to locate any package files, perhaps this is not a Debian Disc");
     }
  
            
            if(log) {
               msg.str("");
 -             ioprintf(msg, "Found label '%s'\n", Name.c_str());
 +             ioprintf(msg, _("Found label '%s'\n"), Name.c_str());
               log->Update(msg.str());
            }
            Database.Set("CD::" + ID + "::Label",Name);
        {
         if(!log) 
           {
 -          UnmountCdrom(CDROM);
 +          if (_config->FindB("APT::CDROM::NoMount",false) == false) 
 +             UnmountCdrom(CDROM);
            return _error->Error("No disc name found and no way to ask for it");
         }
  
     // Copy the package files to the state directory
     PackageCopy Copy;
     SourceCopy SrcCopy;
 +   TranslationsCopy TransCopy;
     if (Copy.CopyPackages(CDROM,Name,List, log) == false ||
 -       SrcCopy.CopyPackages(CDROM,Name,SourceList, log) == false)
 +       SrcCopy.CopyPackages(CDROM,Name,SourceList, log) == false ||
 +       TransCopy.CopyTranslations(CDROM,Name,TransList, log) == false)
        return false;
  
     // reduce the List so that it takes less space in sources.list
        string::size_type Space = (*I).find(' ');
        if (Space == string::npos)
        {
 -       UnmountCdrom(CDROM);
 +       if (_config->FindB("APT::CDROM::NoMount",false) == false) 
 +          UnmountCdrom(CDROM);
         return _error->Error("Internal error");
        }
  
        string::size_type Space = (*I).find(' ');
        if (Space == string::npos)
        {
 -       UnmountCdrom(CDROM);
 +       if (_config->FindB("APT::CDROM::NoMount",false) == false) 
 +          UnmountCdrom(CDROM);
         return _error->Error("Internal error");
        }
  
  
     // Unmount and finish
     if (_config->FindB("APT::CDROM::NoMount",false) == false) {
 -      log->Update(_("Unmounting CD-ROM..."), STEP_LAST);
 +      log->Update(_("Unmounting CD-ROM...\n"), STEP_LAST);
        UnmountCdrom(CDROM);
     }
  
index 5d294c36a99076ac2e1435d95e84cfe3f8cda5df,70ac52e3013e92f04c065ea352518394a1a0359a..d19a92e62cc107b44bb1e103dca047cba0dd74af
@@@ -14,9 -14,6 +14,6 @@@
     ##################################################################### */
                                                                        /*}}}*/
  // Include Files                                                      /*{{{*/
- #ifdef __GNUG__
- #pragma implementation "apt-pkg/fileutl.h"
- #endif 
  #include <apt-pkg/fileutl.h>
  #include <apt-pkg/error.h>
  #include <apt-pkg/sptr.h>
@@@ -24,7 -21,6 +21,7 @@@
  
  #include <apti18n.h>
  
 +#include <cstdlib>
  #include <iostream>
  #include <unistd.h>
  #include <fcntl.h>
index e3db9a45aa1720c1d791caca362139142d474461,ffd1191e52c4e608950d2c84f20b46fd49909eac..6ce6e950a788a90d603ac693ac215113c8b43cb6
@@@ -8,9 -8,6 +8,6 @@@
     ##################################################################### */
                                                                        /*}}}*/
  // Include Files                                                      /*{{{*/
- #ifdef __GNUG__
- #pragma implementation "apt-pkg/progress.h"
- #endif 
  #include <apt-pkg/progress.h>
  #include <apt-pkg/error.h>
  #include <apt-pkg/configuration.h>
@@@ -115,8 -112,6 +112,8 @@@ bool OpProgress::CheckChange(float Inte
     
     if ((int)LastPercent == (int)Percent)
        return false;
 +
 +   LastPercent = Percent;
     
     if (Interval == 0)
        return false;
     if (Diff < Interval)
        return false;
     LastTime = Now;   
 -   LastPercent = Percent;
     return true;
  }
                                                                        /*}}}*/
index 14ead61e16b66a8e555283bae4c0c6ff4b844940,aa37a099a55a4f3fa1d5b22028d3313d11020c43..006452af4888e786401c956c63b852a865508c1e
     ##################################################################### */
                                                                        /*}}}*/
  // Includes                                                           /*{{{*/
- #ifdef __GNUG__
- #pragma implementation "apt-pkg/strutl.h"
- #endif
  #include <apt-pkg/strutl.h>
  #include <apt-pkg/fileutl.h>
  #include <apt-pkg/error.h>
  #include <ctype.h>
  #include <string.h>
  #include <stdio.h>
 +#include <algorithm>
  #include <unistd.h>
  #include <regex.h>
  #include <errno.h>
  #include <stdarg.h>
 +#include <iconv.h>
  
  #include "config.h"
  
  using namespace std;
                                                                        /*}}}*/
  
 +// UTF8ToCodeset - Convert some UTF-8 string for some codeset         /*{{{*/
 +// ---------------------------------------------------------------------
 +/* This is handy to use before display some information for enduser  */
 +bool UTF8ToCodeset(const char *codeset, const string &orig, string *dest)
 +{
 +  iconv_t cd;
 +  const char *inbuf;
 +  char *inptr, *outbuf, *outptr;
 +  size_t insize, outsize;
 +  
 +  cd = iconv_open(codeset, "UTF-8");
 +  if (cd == (iconv_t)(-1)) {
 +     // Something went wrong
 +     if (errno == EINVAL)
 +      _error->Error("conversion from 'UTF-8' to '%s' not available",
 +               codeset);
 +     else
 +      perror("iconv_open");
 +     
 +     // Clean the destination string
 +     *dest = "";
 +     
 +     return false;
 +  }
 +
 +  insize = outsize = orig.size();
 +  inbuf = orig.data();
 +  inptr = (char *)inbuf;
 +  outbuf = new char[insize+1];
 +  outptr = outbuf;
 +
 +  iconv(cd, &inptr, &insize, &outptr, &outsize);
 +  *outptr = '\0';
 +
 +  *dest = outbuf;
 +  delete[] outbuf;
 +  
 +  iconv_close(cd);
 +
 +  return true;
 +}
 +                                                                      /*}}}*/
  // strstrip - Remove white space from the front and back of a string  /*{{{*/
  // ---------------------------------------------------------------------
  /* This is handy to use when parsing a file. It also removes \n's left 
index 9f435bba55dc4df5da75afa718e6f9149aeab6a3,2d52f7c45837c5f1ec88bda895341b310be970ae..ed76338032fb46659825b2e0da838cc2dfd90b29
@@@ -9,10 -9,6 +9,6 @@@
     ##################################################################### */
                                                                        /*}}}*/
  // Include Files                                                      /*{{{*/
- #ifdef __GNUG__
- #pragma implementation "apt-pkg/debindexfile.h"
- #endif
  #include <apt-pkg/debindexfile.h>
  #include <apt-pkg/debsrcrecords.h>
  #include <apt-pkg/deblistparser.h>
@@@ -305,7 -301,7 +301,7 @@@ pkgCache::PkgFileIterator debPackagesIn
     pkgCache::PkgFileIterator File = Cache.FileBegin();
     for (; File.end() == false; File++)
     {
 -      if (FileName != File.FileName())
 +       if (File.FileName() == NULL || FileName != File.FileName())
         continue;
        
        struct stat St;
  }
                                                                        /*}}}*/
  
 +// TranslationsIndex::debTranslationsIndex - Contructor                       /*{{{*/
 +// ---------------------------------------------------------------------
 +/* */
 +debTranslationsIndex::debTranslationsIndex(string URI,string Dist,string Section) : 
 +                  pkgIndexFile(true), URI(URI), Dist(Dist), Section(Section)
 +{
 +}
 +                                                                      /*}}}*/
 +// TranslationIndex::Trans* - Return the URI to the translation files /*{{{*/
 +// ---------------------------------------------------------------------
 +/* */
 +inline string debTranslationsIndex::IndexFile(const char *Type) const
 +{
 +   return _config->FindDir("Dir::State::lists") + URItoFileName(IndexURI(Type));
 +}
 +string debTranslationsIndex::IndexURI(const char *Type) const
 +{
 +   string Res;
 +   if (Dist[Dist.size() - 1] == '/')
 +   {
 +      if (Dist != "/")
 +       Res = URI + Dist;
 +      else 
 +       Res = URI;
 +   }
 +   else
 +      Res = URI + "dists/" + Dist + '/' + Section +
 +      "/i18n/Translation-";
 +   
 +   Res += Type;
 +   return Res;
 +}
 +                                                                      /*}}}*/
 +// TranslationsIndex::GetIndexes - Fetch the index files              /*{{{*/
 +// ---------------------------------------------------------------------
 +/* */
 +bool debTranslationsIndex::GetIndexes(pkgAcquire *Owner) const
 +{
 +   if (TranslationsAvailable()) {
 +     string TranslationFile = "Translation-" + LanguageCode();
 +     new pkgAcqIndexTrans(Owner, IndexURI(LanguageCode().c_str()),
 +                        Info(TranslationFile.c_str()),
 +                        TranslationFile);
 +   }
 +
 +   return true;
 +}
 +                                                                      /*}}}*/
 +// TranslationsIndex::Describe - Give a descriptive path to the index /*{{{*/
 +// ---------------------------------------------------------------------
 +/* This should help the user find the index in the sources.list and
 +   in the filesystem for problem solving */
 +string debTranslationsIndex::Describe(bool Short) const
 +{   
 +   char S[300];
 +   if (Short == true)
 +      snprintf(S,sizeof(S),"%s",Info(TranslationFile().c_str()).c_str());
 +   else
 +      snprintf(S,sizeof(S),"%s (%s)",Info(TranslationFile().c_str()).c_str(),
 +             IndexFile(LanguageCode().c_str()).c_str());
 +   return S;
 +}
 +                                                                      /*}}}*/
 +// TranslationsIndex::Info - One liner describing the index URI               /*{{{*/
 +// ---------------------------------------------------------------------
 +/* */
 +string debTranslationsIndex::Info(const char *Type) const 
 +{
 +   string Info = ::URI::SiteOnly(URI) + ' ';
 +   if (Dist[Dist.size() - 1] == '/')
 +   {
 +      if (Dist != "/")
 +       Info += Dist;
 +   }
 +   else
 +      Info += Dist + '/' + Section;   
 +   Info += " ";
 +   Info += Type;
 +   return Info;
 +}
 +                                                                      /*}}}*/
 +bool debTranslationsIndex::HasPackages() const
 +{
 +   if(!TranslationsAvailable())
 +      return false;
 +   
 +   return FileExists(IndexFile(LanguageCode().c_str()));
 +}
 +
 +// TranslationsIndex::Exists - Check if the index is available                /*{{{*/
 +// ---------------------------------------------------------------------
 +/* */
 +bool debTranslationsIndex::Exists() const
 +{
 +   return FileExists(IndexFile(LanguageCode().c_str()));
 +}
 +                                                                      /*}}}*/
 +// TranslationsIndex::Size - Return the size of the index             /*{{{*/
 +// ---------------------------------------------------------------------
 +/* This is really only used for progress reporting. */
 +unsigned long debTranslationsIndex::Size() const
 +{
 +   struct stat S;
 +   if (stat(IndexFile(LanguageCode().c_str()).c_str(),&S) != 0)
 +      return 0;
 +   return S.st_size;
 +}
 +                                                                      /*}}}*/
 +// TranslationsIndex::Merge - Load the index file into a cache                /*{{{*/
 +// ---------------------------------------------------------------------
 +/* */
 +bool debTranslationsIndex::Merge(pkgCacheGenerator &Gen,OpProgress &Prog) const
 +{
 +   // Check the translation file, if in use
 +   string TranslationFile = IndexFile(LanguageCode().c_str());
 +   if (TranslationsAvailable() && FileExists(TranslationFile))
 +   {
 +     FileFd Trans(TranslationFile,FileFd::ReadOnly);
 +     debListParser TransParser(&Trans);
 +     if (_error->PendingError() == true)
 +       return false;
 +     
 +     Prog.SubProgress(0, Info(TranslationFile.c_str()));
 +     if (Gen.SelectFile(TranslationFile,string(),*this) == false)
 +       return _error->Error("Problem with SelectFile %s",TranslationFile.c_str());
 +
 +     // Store the IMS information
 +     pkgCache::PkgFileIterator TransFile = Gen.GetCurFile();
 +     struct stat TransSt;
 +     if (fstat(Trans.Fd(),&TransSt) != 0)
 +       return _error->Errno("fstat","Failed to stat");
 +     TransFile->Size = TransSt.st_size;
 +     TransFile->mtime = TransSt.st_mtime;
 +   
 +     if (Gen.MergeList(TransParser) == false)
 +       return _error->Error("Problem with MergeList %s",TranslationFile.c_str());
 +   }
 +
 +   return true;
 +}
 +                                                                      /*}}}*/
 +// TranslationsIndex::FindInCache - Find this index                           /*{{{*/
 +// ---------------------------------------------------------------------
 +/* */
 +pkgCache::PkgFileIterator debTranslationsIndex::FindInCache(pkgCache &Cache) const
 +{
 +   string FileName = IndexFile(LanguageCode().c_str());
 +   
 +   pkgCache::PkgFileIterator File = Cache.FileBegin();
 +   for (; File.end() == false; File++)
 +   {
 +      if (FileName != File.FileName())
 +       continue;
 +
 +      struct stat St;
 +      if (stat(File.FileName(),&St) != 0)
 +       return pkgCache::PkgFileIterator(Cache);
 +      if ((unsigned)St.st_size != File->Size || St.st_mtime != File->mtime)
 +       return pkgCache::PkgFileIterator(Cache);
 +      return File;
 +   }   
 +   return File;
 +}
 +                                                                      /*}}}*/
  // StatusIndex::debStatusIndex - Constructor                          /*{{{*/
  // ---------------------------------------------------------------------
  /* */
@@@ -580,11 -412,6 +576,11 @@@ class debIFTypePkg : public pkgIndexFil
     };
     debIFTypePkg() {Label = "Debian Package Index";};
  };
 +class debIFTypeTrans : public debIFTypePkg
 +{
 +   public:
 +   debIFTypeTrans() {Label = "Debian Translation Index";};
 +};
  class debIFTypeStatus : public pkgIndexFile::Type
  {
     public:
  };
  static debIFTypeSrc _apt_Src;
  static debIFTypePkg _apt_Pkg;
 +static debIFTypeTrans _apt_Trans;
  static debIFTypeStatus _apt_Status;
  
  const pkgIndexFile::Type *debSourcesIndex::GetType() const
@@@ -608,10 -434,6 +604,10 @@@ const pkgIndexFile::Type *debPackagesIn
  {
     return &_apt_Pkg;
  }
 +const pkgIndexFile::Type *debTranslationsIndex::GetType() const
 +{
 +   return &_apt_Trans;
 +}
  const pkgIndexFile::Type *debStatusIndex::GetType() const
  {
     return &_apt_Status;
index 8cf31b3260446d385c44ef35ecfd66da08b6e186,6830f9e835a772a1d6b9c0536d1032b395b275d7..73b2dda498c53b59462a90b923fb7a5b80cefae0
@@@ -1,9 -1,5 +1,5 @@@
  // ijones, walters
  
- #ifdef __GNUG__
- #pragma implementation "apt-pkg/debmetaindex.h"
- #endif
  #include <apt-pkg/debmetaindex.h>
  #include <apt-pkg/debindexfile.h>
  #include <apt-pkg/strutl.h>
@@@ -157,16 -153,6 +153,16 @@@ bool debReleaseIndex::GetIndexes(pkgAcq
                     ComputeIndexTargets(),
                     new indexRecords (Dist));
  
 +   // Queue the translations
 +   for (vector<const debSectionEntry *>::const_iterator I = SectionEntries.begin(); 
 +      I != SectionEntries.end(); I++) {
 +
 +      if((*I)->IsSrc)
 +       continue;
 +      debTranslationsIndex i = debTranslationsIndex(URI,Dist,(*I)->Section);
 +      i.GetIndexes(Owner);
 +   }
 +
     return true;
  }
  
@@@ -191,16 -177,11 +187,16 @@@ vector <pkgIndexFile *> *debReleaseInde
  
     Indexes = new vector <pkgIndexFile*>;
     for (vector<const debSectionEntry *>::const_iterator I = SectionEntries.begin(); 
 -      I != SectionEntries.end(); I++)
 +      I != SectionEntries.end(); I++) {
        if ((*I)->IsSrc)
           Indexes->push_back(new debSourcesIndex (URI, Dist, (*I)->Section, IsTrusted()));
        else 
 +      {
           Indexes->push_back(new debPackagesIndex (URI, Dist, (*I)->Section, IsTrusted()));
 +       Indexes->push_back(new debTranslationsIndex(URI, Dist, (*I)->Section));
 +      }
 +   }
 +
     return Indexes;
  }
  
index 2aa47e3436ed9346f331d97609e8bfa387544f01,6ecbd15d62695e1b1b174fc972dee5206340d9af..8a5b6e21589e3e9743c91d3b83b72a66e5c5ae1f
@@@ -8,13 -8,8 +8,10 @@@
     ##################################################################### */
                                                                        /*}}}*/
  // Include Files                                                      /*{{{*/
- #ifdef __GNUG__
- #pragma implementation "apt-pkg/debrecords.h"
- #endif
  #include <apt-pkg/debrecords.h>
 +#include <apt-pkg/strutl.h>
  #include <apt-pkg/error.h>
 +#include <langinfo.h>
                                                                        /*}}}*/
  
  // RecordParser::debRecordParser - Constructor                                /*{{{*/
@@@ -32,10 -27,6 +29,10 @@@ debRecordParser::debRecordParser(strin
  bool debRecordParser::Jump(pkgCache::VerFileIterator const &Ver)
  {
     return Tags.Jump(Section,Ver->Offset);
 +}
 +bool debRecordParser::Jump(pkgCache::DescFileIterator const &Desc)
 +{
 +   return Tags.Jump(Section,Desc->Offset);
  }
                                                                        /*}}}*/
  // RecordParser::FileName - Return the archive filename on the site   /*{{{*/
@@@ -67,7 -58,7 +64,7 @@@ string debRecordParser::MD5Hash(
  /* */
  string debRecordParser::SHA1Hash()
  {
 -   return Section.FindS("SHA1Sum");
 +   return Section.FindS("SHA1");
  }
                                                                        /*}}}*/
  // RecordParser::Maintainer - Return the maintainer email             /*{{{*/
@@@ -83,7 -74,7 +80,7 @@@ string debRecordParser::Maintainer(
  /* */
  string debRecordParser::ShortDesc()
  {
 -   string Res = Section.FindS("Description");
 +   string Res = LongDesc();
     string::size_type Pos = Res.find('\n');
     if (Pos == string::npos)
        return Res;
  /* */
  string debRecordParser::LongDesc()
  {
 -   return Section.FindS("Description");
 +  string orig, dest;
 +  char *codeset = nl_langinfo(CODESET);
 +
 +  if (!Section.FindS("Description").empty())
 +     orig = Section.FindS("Description").c_str();
 +  else 
 +     orig = Section.FindS(("Description-" + pkgIndexFile::LanguageCode()).c_str()).c_str();
 +
 +  if (strcmp(codeset,"UTF-8") != 0) {
 +     UTF8ToCodeset(codeset, orig, &dest);
 +     orig = dest;
 +   }    
 +  
 +   return orig;
  }
                                                                        /*}}}*/
 +
 +static const char *SourceVerSeparators = " ()";
 +
  // RecordParser::SourcePkg - Return the source package name if any    /*{{{*/
  // ---------------------------------------------------------------------
  /* */
  string debRecordParser::SourcePkg()
  {
     string Res = Section.FindS("Source");
 -   string::size_type Pos = Res.find(' ');
 +   string::size_type Pos = Res.find_first_of(SourceVerSeparators);
     if (Pos == string::npos)
        return Res;
     return string(Res,0,Pos);
  }
                                                                        /*}}}*/
 +// RecordParser::SourceVer - Return the source version number if present      /*{{{*/
 +// ---------------------------------------------------------------------
 +/* */
 +string debRecordParser::SourceVer()
 +{
 +   string Pkg = Section.FindS("Source");
 +   string::size_type Pos = Pkg.find_first_of(SourceVerSeparators);
 +   if (Pos == string::npos)
 +      return "";
 +
 +   string::size_type VerStart = Pkg.find_first_not_of(SourceVerSeparators, Pos);
 +   if(VerStart == string::npos)
 +     return "";
 +
 +   string::size_type VerEnd = Pkg.find_first_of(SourceVerSeparators, VerStart);
 +   if(VerEnd == string::npos)
 +     // Corresponds to the case of, e.g., "foo (1.2" without a closing
 +     // paren.  Be liberal and guess what it means.
 +     return string(Pkg, VerStart);
 +   else
 +     return string(Pkg, VerStart, VerEnd - VerStart);
 +}
 +                                                                      /*}}}*/
  // RecordParser::GetRec - Return the whole record                     /*{{{*/
  // ---------------------------------------------------------------------
  /* */
index 7d5dab747b992e3c14b2a1401d1f019826cdd8f0,21d7392a0da6c726095b0ad03f16d392c22128b6..fcd9bb9018f3f9d9fd42d75be973aa46a6b73b8f
@@@ -9,17 -9,11 +9,13 @@@
     ##################################################################### */
                                                                        /*}}}*/
  // Include Files                                                      /*{{{*/
- #ifdef __GNUG__
- #pragma implementation "apt-pkg/debsrcrecords.h"
- #endif 
  #include <apt-pkg/deblistparser.h>
  #include <apt-pkg/debsrcrecords.h>
  #include <apt-pkg/error.h>
  #include <apt-pkg/strutl.h>
  #include <apt-pkg/configuration.h>
 +
 +using std::max;
                                                                        /*}}}*/
  
  // SrcRecordParser::Binaries - Return the binaries field              /*{{{*/
@@@ -36,19 -30,31 +32,19 @@@ const char **debSrcRecordParser::Binari
     if (Bins.empty() == true || Bins.length() >= 102400)
        return 0;
     
 -   // Workaround for #236688.  Only allocate a new buffer if the field
 -   // is large, to avoid a performance penalty
 -   char *BigBuf = NULL;
 -   char *Buf;
 -   if (Bins.length() > sizeof(Buffer))
 -   {
 -      BigBuf = new char[Bins.length()];
 -      Buf = BigBuf;
 -   }
 -   else
 +   if (Bins.length() >= BufSize)
     {
 -      Buf = Buffer;
 +      delete [] Buffer;
 +      // allocate new size based on buffer (but never smaller than 4000)
 +      BufSize = max((unsigned int)4000, max((unsigned int)Bins.length()+1,2*BufSize));
 +      Buffer = new char[BufSize];
     }
  
 -   strcpy(Buf,Bins.c_str());
 -   if (TokSplitString(',',Buf,StaticBinList,
 +   strcpy(Buffer,Bins.c_str());
 +   if (TokSplitString(',',Buffer,StaticBinList,
                      sizeof(StaticBinList)/sizeof(StaticBinList[0])) == false)
 -   {
 -      if (BigBuf != NULL)
 -         delete BigBuf;
        return 0;
 -   }
  
 -   if (BigBuf != NULL)
 -      delete BigBuf;
     return (const char **)StaticBinList;
  }
                                                                        /*}}}*/
diff --combined apt-pkg/deb/dpkgpm.cc
index cebdafe7deecba82237eae18a8bb9ea2d5838ff0,905ac93c4f1c654db5c82a82c5edbe23de7af5cb..e5506d3bfd08ccafecad6b14307439aec3ad088e
@@@ -8,9 -8,6 +8,6 @@@
     ##################################################################### */
                                                                        /*}}}*/
  // Includes                                                           /*{{{*/
- #ifdef __GNUG__
- #pragma implementation "apt-pkg/dpkgpm.h"
- #endif
  #include <apt-pkg/dpkgpm.h>
  #include <apt-pkg/error.h>
  #include <apt-pkg/configuration.h>
@@@ -474,8 -471,6 +471,8 @@@ bool pkgDPkgPM::Go(int OutStatusFd
         case Item::Install:
         Args[n++] = "--unpack";
         Size += strlen(Args[n-1]);
 +       Args[n++] = "--auto-deconfigure";
 +       Size += strlen(Args[n-1]);
         break;
        }
        
            
         */
         char* list[5];
 -       if(!TokSplitString(':', line, list, sizeof(list)/sizeof(list[0])))
 -          // FIXME: dpkg sends multiline error messages sometimes (see
 -          //        #374195 for a example. we should support this by
 -          //        either patching dpkg to not send multiline over the
 -          //        statusfd or by rewriting the code here to deal with
 -          //        it. for now we just ignore it and not crash
 -          continue;
 +       //        dpkg sends multiline error messages sometimes (see
 +       //        #374195 for a example. we should support this by
 +       //        either patching dpkg to not send multiline over the
 +       //        statusfd or by rewriting the code here to deal with
 +       //        it. for now we just ignore it and not crash
 +       TokSplitString(':', line, list, sizeof(list)/sizeof(list[0]));
         char *pkg = list[1];
         char *action = _strstrip(list[2]);
 +       if( pkg == NULL || action == NULL) 
 +       {
 +          if (_config->FindB("Debug::pkgDPkgProgressReporting",false) == true)
 +             std::clog << "ignoring line: not enough ':'" << std::endl;
 +          // reset the line buffer
 +          line[0]=0;
 +          continue;
 +       }
  
         if(strncmp(action,"error",strlen("error")) == 0)
         {
        // Check for an error code.
        if (WIFEXITED(Status) == 0 || WEXITSTATUS(Status) != 0)
        {
 -       RunScripts("DPkg::Post-Invoke");
 -       if (WIFSIGNALED(Status) != 0 && WTERMSIG(Status) == SIGSEGV)
 -          return _error->Error("Sub-process %s received a segmentation fault.",Args[0]);
 -
 -       if (WIFEXITED(Status) != 0)
 -          return _error->Error("Sub-process %s returned an error code (%u)",Args[0],WEXITSTATUS(Status));
 +       // if it was set to "keep-dpkg-runing" then we won't return
 +       // here but keep the loop going and just report it as a error
 +       // for later
 +       bool stopOnError = _config->FindB("Dpkg::StopOnError",true);
         
 -       return _error->Error("Sub-process %s exited unexpectedly",Args[0]);
 +       if(stopOnError)
 +          RunScripts("DPkg::Post-Invoke");
 +
 +       if (WIFSIGNALED(Status) != 0 && WTERMSIG(Status) == SIGSEGV) 
 +          _error->Error("Sub-process %s received a segmentation fault.",Args[0]);
 +       else if (WIFEXITED(Status) != 0)
 +          _error->Error("Sub-process %s returned an error code (%u)",Args[0],WEXITSTATUS(Status));
 +       else 
 +          _error->Error("Sub-process %s exited unexpectedly",Args[0]);
 +
 +       if(stopOnError)
 +          return false;
        }      
     }
  
diff --combined apt-pkg/indexfile.cc
index bb2210bf677cebcaf64516fa86bd0ce1b9d1c62c,63f692c1d5397a93f5fcecab83f53a43c8530029..ca11fc11143e97ac2fed8324042800a839ba5aab
@@@ -8,15 -8,8 +8,11 @@@
     ##################################################################### */
                                                                        /*}}}*/
  // Include Files                                                      /*{{{*/
- #ifdef __GNUG__
- #pragma implementation "apt-pkg/indexfile.h"
- #endif
 +#include <apt-pkg/configuration.h>
  #include <apt-pkg/indexfile.h>
  #include <apt-pkg/error.h>
 +
 +#include <clocale>
                                                                        /*}}}*/
  
  // Global list of Item supported
@@@ -70,63 -63,3 +66,63 @@@ string pkgIndexFile::SourceInfo(pkgSrcR
     return string();
  }
                                                                        /*}}}*/
 +// IndexFile::TranslationsAvailable - Check if will use Translation    /*{{{*/
 +// ---------------------------------------------------------------------
 +/* */
 +bool pkgIndexFile::TranslationsAvailable()
 +{
 +  const string Translation = _config->Find("APT::Acquire::Translation");
 +  
 +  if (Translation.compare("none") != 0)
 +    return CheckLanguageCode(LanguageCode().c_str());
 +  else
 +    return false;
 +}
 +                                                                      /*}}}*/
 +// IndexFile::CheckLanguageCode - Check the Language Code             /*{{{*/
 +// ---------------------------------------------------------------------
 +/* */
 +/* common cases: de_DE, de_DE@euro, de_DE.UTF-8, de_DE.UTF-8@euro,
 +                 de_DE.ISO8859-1, tig_ER
 +                 more in /etc/gdm/locale.conf 
 +*/
 +
 +bool pkgIndexFile::CheckLanguageCode(const char *Lang)
 +{
 +  if (strlen(Lang) == 2 || (strlen(Lang) == 5 && Lang[2] == '_'))
 +    return true;
 +
 +  if (strcmp(Lang,"C") != 0)
 +    _error->Warning("Wrong language code %s", Lang);
 +
 +  return false;
 +}
 +                                                                      /*}}}*/
 +// IndexFile::LanguageCode - Return the Language Code                 /*{{{*/
 +// ---------------------------------------------------------------------
 +/* return the language code */
 +string pkgIndexFile::LanguageCode()
 +{
 +  const string Translation = _config->Find("APT::Acquire::Translation");
 +
 +  if (Translation.compare("environment") == 0) 
 +  {
 +     string lang = std::setlocale(LC_MESSAGES,NULL);
 +
 +     // we have a mapping of the language codes that contains all the language
 +     // codes that need the country code as well 
 +     // (like pt_BR, pt_PT, sv_SE, zh_*, en_*)
 +     char *need_full_langcode[] = { "pt","sv","zh","en", NULL };
 +     for(char **s = need_full_langcode;*s != NULL; s++)
 +      if(lang.find(*s) == 0)
 +         return lang.substr(0,5);
 +     
 +     if(lang.size() > 2)
 +      return lang.substr(0,2);
 +     else
 +      return lang;
 +  }
 +  else 
 +     return Translation;
 +}
 +                                                                      /*}}}*/
diff --combined apt-pkg/orderlist.cc
index 61d8d914e43b3bf6a52fc54c29b251b86dfc3402,7302f02b60ffe7582ac15e4335197391df98b969..616714e2927f4cb4a674be6e9cfdba802b3f5b37
@@@ -63,9 -63,6 +63,6 @@@
     ##################################################################### */
                                                                        /*}}}*/
  // Include Files                                                      /*{{{*/
- #ifdef __GNUG__
- #pragma implementation "apt-pkg/orderlist.h"
- #endif 
  #include <apt-pkg/orderlist.h>
  #include <apt-pkg/depcache.h>
  #include <apt-pkg/error.h>
@@@ -491,13 -488,11 +488,13 @@@ bool pkgOrderList::VisitProvides(DepIte
         continue;
        
        if (D->Type != pkgCache::Dep::Conflicts &&
 +        D->Type != pkgCache::Dep::DpkgBreaks &&
          D->Type != pkgCache::Dep::Obsoletes &&
          Cache[Pkg].InstallVer != *I)
         continue;
        
        if ((D->Type == pkgCache::Dep::Conflicts ||
 +         D->Type == pkgCache::Dep::DpkgBreaks ||
           D->Type == pkgCache::Dep::Obsoletes) &&
          (Version *)Pkg.CurrentVer() != *I)
         continue;
@@@ -632,7 -627,6 +629,7 @@@ bool pkgOrderList::DepUnPackCrit(DepIte
         /* Forward critical dependencies MUST be correct before the 
            package can be unpacked. */
         if (D->Type != pkgCache::Dep::Conflicts &&
 +           D->Type != pkgCache::Dep::DpkgBreaks &&
             D->Type != pkgCache::Dep::Obsoletes &&
             D->Type != pkgCache::Dep::PreDepends)
            continue;
     }   
     return true;
  }
 -                                                                      /*}}}*/
 +
  // OrderList::DepUnPackPreD - Critical UnPacking ordering with depends        /*{{{*/
  // ---------------------------------------------------------------------
  /* Critical PreDepends (also configure immediate and essential) strives to
@@@ -806,20 -800,9 +803,20 @@@ bool pkgOrderList::DepUnPackDep(DepIter
               return false;
         }
         else
 +       {
            if (D->Type == pkgCache::Dep::Depends)
               if (VisitProvides(D,false) == false)
                  return false;
 +
 +          if (D->Type == pkgCache::Dep::DpkgBreaks)
 +          {
 +             if (CheckDep(D) == true)
 +               continue;
 +
 +             if (VisitNode(D.TargetPkg()) == false)
 +               return false;
 +          }
 +       }
        }
     return true;
  }
@@@ -967,7 -950,6 +964,7 @@@ bool pkgOrderList::CheckDep(DepIterato
        /* Conflicts requires that all versions are not present, depends
           just needs one */
        if (D->Type != pkgCache::Dep::Conflicts && 
 +        D->Type != pkgCache::Dep::DpkgBreaks && 
          D->Type != pkgCache::Dep::Obsoletes)
        {
         /* Try to find something that does not have the after flag set
index 1e57d645561db47fd6afef95a2cb5757e4135c9e,8b94e120679e918743f3c80a88e141ecd2108d95..10e2858ed9f081671f1411bcfd6a43b049141448
     ##################################################################### */
                                                                        /*}}}*/
  // Include Files                                                      /*{{{*/
- #ifdef __GNUG__
- #pragma implementation "apt-pkg/packagemanager.h"
- #endif
  #include <apt-pkg/packagemanager.h>
  #include <apt-pkg/orderlist.h>
  #include <apt-pkg/depcache.h>
@@@ -95,10 -91,9 +91,10 @@@ bool pkgPackageManager::GetArchives(pkg
     be downloaded. */
  bool pkgPackageManager::FixMissing()
  {   
 +   pkgDepCache::ActionGroup group(Cache);
     pkgProblemResolver Resolve(&Cache);
     List->SetFileList(FileNames);
 -   
 +
     bool Bad = false;
     for (PkgIterator I = Cache.PkgBegin(); I.end() == false; I++)
     {
     
        // Okay, this file is missing and we need it. Mark it for keep 
        Bad = true;
 -      Cache.MarkKeep(I);
 +      Cache.MarkKeep(I, false, false);
     }
   
     // We have to empty the list otherwise it will not have the new changes
@@@ -632,11 -627,14 +628,11 @@@ pkgPackageManager::OrderResult pkgPacka
  // ---------------------------------------------------------------------
  /* This uses the filenames in FileNames and the information in the
     DepCache to perform the installation of packages.*/
 -pkgPackageManager::OrderResult pkgPackageManager::DoInstall(int status_fd)
 +pkgPackageManager::OrderResult pkgPackageManager::DoInstall(int statusFd)
  {
 -   OrderResult Res = OrderInstall();
 -   if(Debug)
 -      std::clog << "OrderInstall() returned: " << Res << std::endl;
 -   if (Res != Failed)
 -      if (Go(status_fd) == false)
 -       return Failed;
 -   return Res;
 +   if(DoInstallPreFork() == Failed)
 +      return Failed;
 +   
 +   return DoInstallPostFork(statusFd);
  }
                                                                        /*}}}*/
diff --combined apt-pkg/pkgcachegen.cc
index 8ec6a171975ce1a28e7eee26beadbcc1a32adf38,1c93b32a35eb6b5b09ad2bac03718587d2f34233..ce9b96980c3792b16a244843510b64c9408207a8
     ##################################################################### */
                                                                        /*}}}*/
  // Include Files                                                      /*{{{*/
- #ifdef __GNUG__
- #pragma implementation "apt-pkg/pkgcachegen.h"
- #endif
  #define APT_COMPATIBILITY 986
  
  #include <apt-pkg/pkgcachegen.h>
@@@ -26,8 -22,6 +22,8 @@@
  #include <apt-pkg/sptr.h>
  #include <apt-pkg/pkgsystem.h>
  
 +#include <apt-pkg/tagfile.h>
 +
  #include <apti18n.h>
  
  #include <vector>
@@@ -127,46 -121,16 +123,46 @@@ bool pkgCacheGenerator::MergeList(ListP
        string Version = List.Version();
        if (Version.empty() == true)
        {
 +       // we first process the package, then the descriptions
 +       // (this has the bonus that we get MMap error when we run out
 +       //  of MMap space)
         if (List.UsePackage(Pkg,pkgCache::VerIterator(Cache)) == false)
            return _error->Error(_("Error occurred while processing %s (UsePackage1)"),
                                 PackageName.c_str());
 +
 +       // Find the right version to write the description
 +       MD5SumValue CurMd5 = List.Description_md5();
 +       pkgCache::VerIterator Ver = Pkg.VersionList();
 +       map_ptrloc *LastVer = &Pkg->VersionList;
 +
 +       for (; Ver.end() == false; LastVer = &Ver->NextVer, Ver++) 
 +       {
 +          pkgCache::DescIterator Desc = Ver.DescriptionList();
 +          map_ptrloc *LastDesc = &Ver->DescriptionList;
 +
 +          for (; Desc.end() == false; LastDesc = &Desc->NextDesc, Desc++)
 +          {
 +
 +             if (MD5SumValue(Desc.md5()) == CurMd5) 
 +               {
 +                // Add new description
 +                *LastDesc = NewDescription(Desc, List.DescriptionLanguage(), CurMd5, *LastDesc);
 +                Desc->ParentPkg = Pkg.Index();
 +                
 +                if (NewFileDesc(Desc,List) == false)
 +                   return _error->Error(_("Error occured while processing %s (NewFileDesc1)"),PackageName.c_str());
 +                break;
 +             }
 +          }
 +       }
 +
         continue;
        }
  
        pkgCache::VerIterator Ver = Pkg.VersionList();
 -      map_ptrloc *Last = &Pkg->VersionList;
 +      map_ptrloc *LastVer = &Pkg->VersionList;
        int Res = 1;
 -      for (; Ver.end() == false; Last = &Ver->NextVer, Ver++)
 +      for (; Ver.end() == false; LastVer = &Ver->NextVer, Ver++)
        {
         Res = Cache.VS->CmpVersion(Version,Ver.VerStr());
         if (Res >= 0)
        // Skip to the end of the same version set.
        if (Res == 0)
        {
 -       for (; Ver.end() == false; Last = &Ver->NextVer, Ver++)
 +       for (; Ver.end() == false; LastVer = &Ver->NextVer, Ver++)
         {
            Res = Cache.VS->CmpVersion(Version,Ver.VerStr());
            if (Res != 0)
        }
  
        // Add a new version
 -      *Last = NewVersion(Ver,Version,*Last);
 +      *LastVer = NewVersion(Ver,Version,*LastVer);
        Ver->ParentPkg = Pkg.Index();
        Ver->Hash = Hash;
 +
        if (List.NewVersion(Ver) == false)
         return _error->Error(_("Error occurred while processing %s (NewVersion1)"),
                              PackageName.c_str());
         FoundFileDeps |= List.HasFileDeps();
         return true;
        }      
 +
 +      /* Record the Description data. Description data always exist in
 +       Packages and Translation-* files. */
 +      pkgCache::DescIterator Desc = Ver.DescriptionList();
 +      map_ptrloc *LastDesc = &Ver->DescriptionList;
 +      
 +      // Skip to the end of description set
 +      for (; Desc.end() == false; LastDesc = &Desc->NextDesc, Desc++);
 +
 +      // Add new description
 +      *LastDesc = NewDescription(Desc, List.DescriptionLanguage(), List.Description_md5(), *LastDesc);
 +      Desc->ParentPkg = Pkg.Index();
 +
 +      if (NewFileDesc(Desc,List) == false)
 +       return _error->Error(_("Error occured while processing %s (NewFileDesc2)"),PackageName.c_str());
     }
  
     FoundFileDeps |= List.HasFileDeps();
     if (Cache.HeaderP->VersionCount >= (1ULL<<(sizeof(Cache.VerP->ID)*8))-1)
        return _error->Error(_("Wow, you exceeded the number of versions "
                             "this APT is capable of."));
 +   if (Cache.HeaderP->DescriptionCount >= (1ULL<<(sizeof(Cache.DescP->ID)*8))-1)
 +      return _error->Error(_("Wow, you exceeded the number of descriptions "
 +                           "this APT is capable of."));
     if (Cache.HeaderP->DependsCount >= (1ULL<<(sizeof(Cache.DepP->ID)*8))-1ULL)
        return _error->Error(_("Wow, you exceeded the number of dependencies "
                             "this APT is capable of."));
@@@ -322,7 -267,7 +318,7 @@@ bool pkgCacheGenerator::NewPackage(pkgC
     Pkg = Cache.FindPkg(Name);
     if (Pkg.end() == false)
        return true;
 -       
 +
     // Get a structure
     unsigned long Package = Map.Allocate(sizeof(pkgCache::Package));
     if (Package == 0)
@@@ -400,62 -345,6 +396,62 @@@ unsigned long pkgCacheGenerator::NewVer
     return Version;
  }
                                                                        /*}}}*/
 +// CacheGenerator::NewFileDesc - Create a new File<->Desc association /*{{{*/
 +// ---------------------------------------------------------------------
 +/* */
 +bool pkgCacheGenerator::NewFileDesc(pkgCache::DescIterator &Desc,
 +                                 ListParser &List)
 +{
 +   if (CurrentFile == 0)
 +      return true;
 +   
 +   // Get a structure
 +   unsigned long DescFile = Map.Allocate(sizeof(pkgCache::DescFile));
 +   if (DescFile == 0)
 +      return 0;
 +
 +   pkgCache::DescFileIterator DF(Cache,Cache.DescFileP + DescFile);
 +   DF->File = CurrentFile - Cache.PkgFileP;
 +
 +   // Link it to the end of the list
 +   map_ptrloc *Last = &Desc->FileList;
 +   for (pkgCache::DescFileIterator D = Desc.FileList(); D.end() == false; D++)
 +      Last = &D->NextFile;
 +
 +   DF->NextFile = *Last;
 +   *Last = DF.Index();
 +   
 +   DF->Offset = List.Offset();
 +   DF->Size = List.Size();
 +   if (Cache.HeaderP->MaxDescFileSize < DF->Size)
 +      Cache.HeaderP->MaxDescFileSize = DF->Size;
 +   Cache.HeaderP->DescFileCount++;
 +   
 +   return true;
 +}
 +                                                                      /*}}}*/
 +// CacheGenerator::NewDescription - Create a new Description          /*{{{*/
 +// ---------------------------------------------------------------------
 +/* This puts a description structure in the linked list */
 +map_ptrloc pkgCacheGenerator::NewDescription(pkgCache::DescIterator &Desc,
 +                                          const string &Lang, const MD5SumValue &md5sum,
 +                                          map_ptrloc Next)
 +{
 +   // Get a structure
 +   map_ptrloc Description = Map.Allocate(sizeof(pkgCache::Description));
 +   if (Description == 0)
 +      return 0;
 +
 +   // Fill it in
 +   Desc = pkgCache::DescIterator(Cache,Cache.DescP + Description);
 +   Desc->NextDesc = Next;
 +   Desc->ID = Cache.HeaderP->DescriptionCount++;
 +   Desc->language_code = Map.WriteString(Lang);
 +   Desc->md5sum = Map.WriteString(md5sum.Value());
 +
 +   return Description;
 +}
 +                                                                      /*}}}*/
  // ListParser::NewDepends - Create a dependency element                       /*{{{*/
  // ---------------------------------------------------------------------
  /* This creates a dependency element in the tree. It is linked to the
@@@ -678,10 -567,8 +674,10 @@@ static bool CheckValidity(const string 
      
        if ((*Start)->Exists() == false)
        {
 +#if 0 // mvo: we no longer give a message here (Default Sources spec)
         _error->WarningE("stat",_("Couldn't stat source package list %s"),
                          (*Start)->Describe().c_str());
 +#endif
         continue;
        }
  
        pkgCache::PkgFileIterator File = (*Start)->FindInCache(Cache);
        if (File.end() == true)
         return false;
 -      
 +
        Visited[File->ID] = true;
     }
     
@@@ -785,7 -672,7 +781,7 @@@ static bool BuildCache(pkgCacheGenerato
  bool pkgMakeStatusCache(pkgSourceList &List,OpProgress &Progress,
                        MMap **OutMap,bool AllowMem)
  {
 -   unsigned long MapSize = _config->FindI("APT::Cache-Limit",12*1024*1024);
 +   unsigned long MapSize = _config->FindI("APT::Cache-Limit",16*1024*1024);
     
     vector<pkgIndexFile *> Files;
     for (vector<metaIndex *>::const_iterator i = List.begin();
  /* */
  bool pkgMakeOnlyStatusCache(OpProgress &Progress,DynamicMMap **OutMap)
  {
 -   unsigned long MapSize = _config->FindI("APT::Cache-Limit",8*1024*1024);
 +   unsigned long MapSize = _config->FindI("APT::Cache-Limit",12*1024*1024);
     vector<pkgIndexFile *> Files;
     unsigned long EndOfSource = Files.size();
     if (_system->AddStatusFiles(Files) == false)
diff --combined apt-pkg/pkgrecords.cc
index b22f3e73fc80ccf6ffe2943529f17aaa30561102,dc43735a6f58628f24444f301ea42035ea1475cc..0aaa2096a16df72d0a0395e89b82c0bc2b0e0cee
@@@ -9,9 -9,6 +9,6 @@@
     ##################################################################### */
                                                                        /*}}}*/
  // Include Files                                                      /*{{{*/
- #ifdef __GNUG__
- #pragma implementation "apt-pkg/pkgrecords.h"
- #endif
  #include <apt-pkg/pkgrecords.h>
  #include <apt-pkg/indexfile.h>
  #include <apt-pkg/error.h>
@@@ -63,12 -60,3 +60,12 @@@ pkgRecords::Parser &pkgRecords::Lookup(
     return *Files[Ver.File()->ID];
  }
                                                                        /*}}}*/
 +// Records::Lookup - Get a parser for the package description file    /*{{{*/
 +// ---------------------------------------------------------------------
 +/* */
 +pkgRecords::Parser &pkgRecords::Lookup(pkgCache::DescFileIterator const &Desc)
 +{
 +   Files[Desc.File()->ID]->Jump(Desc);
 +   return *Files[Desc.File()->ID];
 +}
 +                                                                      /*}}}*/
diff --combined apt-pkg/policy.cc
index 35a50425b7a45017cc8144aca76e25d6a1bdd014,795f1d7878822cdc0f3c132cfe7e0197e6fcd661..8b083fd444aa80e8d8b9c4314a12a7802c879470
@@@ -23,9 -23,6 +23,6 @@@
     ##################################################################### */
                                                                        /*}}}*/
  // Include Files                                                      /*{{{*/
- #ifdef __GNUG__
- #pragma implementation "apt-pkg/policy.h"
- #endif
  #include <apt-pkg/policy.h>
  #include <apt-pkg/configuration.h>
  #include <apt-pkg/tagfile.h>
@@@ -36,7 -33,6 +33,7 @@@
  #include <apti18n.h>
  
  #include <iostream>
 +#include <sstream>
                                                                        /*}}}*/
  
  using namespace std;
@@@ -301,13 -297,7 +298,13 @@@ bool ReadPinFile(pkgPolicy &Plcy,strin
           continue;
        }
  
 -      Plcy.CreatePin(Type,Name,string(Word,End),priority);
 +      istringstream s(Name);
 +      string pkg;
 +      while(!s.eof())
 +      {
 +       s >> pkg;
 +         Plcy.CreatePin(Type, pkg, string(Word,End),priority);
 +      };
     }
  
     Plcy.InitDefaults();
diff --combined apt-pkg/tagfile.cc
index 649c93aeede7100e449f34caef2c1a3c8a5da429,85e6abfd77463eaf58681a7949d51ae0ed18ebf4..893cb8ee7700ae2055a70517a9c6753143b397f6
     ##################################################################### */
                                                                        /*}}}*/
  // Include Files                                                      /*{{{*/
- #ifdef __GNUG__
- #pragma implementation "apt-pkg/tagfile.h"
- #endif
  #include <apt-pkg/tagfile.h>
  #include <apt-pkg/error.h>
  #include <apt-pkg/strutl.h>
@@@ -423,7 -419,6 +419,7 @@@ static const char *iTFRewritePackageOrd
                            "Recommends",
                            "Suggests",
                            "Conflicts",
 +                          "Breaks",
                            "Conffiles",
                            "Filename",
                            "Size",
diff --combined debian/changelog
index 05e3b58ef48121a35bcd6c18b2715359f4dc9fc5,6aaa473d9ecd506d7f65904d835820bbb0d053ec..41609bd743fae69e48c1296197873df0a4e5bae4
 +apt (0.7.2) unstable; urgency=low
 +  
 +  * merged the debian/experimental changes back
 +    into the debian/sid branch
 +  * merged from Christian Perrier:
 +    * mr.po: New Marathi translation  Closes: #416806
 +    * zh_CN.po: Updated by Eric Pareja  Closes: #416822
 +    * tl.po: Updated by Eric Pareja   Closes: #416638
 +    * gl.po: Updated by Jacobo Tarrio
 +           Closes: #412828
 +    * da.po: Updated by Claus Hindsgaul
 +           Closes: #409483
 +    * fr.po: Remove a non-breakable space for usability
 +           issues. Closes: #408877
 +    * ru.po: Updated Russian translation. Closes: #405476
 +    * *.po: Unfuzzy after upstream typo corrections
 +  * buildlib/archtable:
 +    - added support for sh3/sh4 (closes: #424870)
 +    - added support for m32r (closes: #394096)
 +  * buildlib/systemtable:
 +    - added support for lpia
 +  * configure.in:
 +    - check systemtable for architecture mapping too
 +  * fix error in AutocleanInterval, closes: #319339
 +    (thanks to Israel G. Lugo for the patch)
 +  * add "purge" commandline argument, closes: #133421)
 +    (thanks to Julien Danjou for the patch)
 +  * add "purge" commandline argument, closes: #133421)
 +    (thanks to Julien Danjou for the patch)
 +  * fix FTBFS with gcc 4.3, closes: #417090
 +    (thanks to Martin Michlmayr for the patch)
 +  * add --dsc-only option, thanks to K. Richard Pixley
++  * Removed the more leftover #pragma interface/implementation
++    closes: #306937 (thanks to Andreas Henriksson for the patch)
 +  
 + -- Michael Vogt <mvo@debian.org>  Wed, 06 Jun 2007 23:19:50 +0200
 +
 +apt (0.7.1) experimental; urgency=low
 +
 +  * ABI library name change because its build against
 +    new glibc
 +  * implement SourceVer() in pkgRecords 
 +     (thanks to Daniel Burrows for the patch!)
 +  * apt-pkg/algorithm.cc:
 +    - use clog for all debugging
 +    - only increase the score of installed applications if they 
 +      are not obsolete 
 +    - fix resolver bug on removal triggered by weak-dependencies 
 +      with or-groups
 +  * methods/http.cc:
 +    - send apt version in User-Agent
 +  * apt-pkg/deb/debrecords.cc:
 +    - fix SHA1Hash() return value
 +  * apt-pkg/cdrom.cc:
 +    - only unmount if APT::CDROM::NoMount is false
 +  * methods/cdrom.cc:  
 +    - only umount if it was mounted by the method before
 +  * po/gl.po:
 +    - fix error translation that causes trouble to lsb_release
 +  * apt-pkg/acquire-item.cc:
 +    - if decompression of a index fails, delete the index 
 +  * apt-pkg/acquire.{cc,h}:
 +    - deal better with duplicated sources.list entries (avoid
 +      double queuing of  URLs) - this fixes hangs in bzip/gzip
 +  * merged from Christian Perrier:
 +    * mr.po: New Marathi translation  Closes: #416806
 +    * zh_CN.po: Updated by Eric Pareja  Closes: #416822
 +    * tl.po: Updated by Eric Pareja   Closes: #416638
 +    * gl.po: Updated by Jacobo Tarrio
 +             Closes: #412828
 +    * da.po: Updated by Claus Hindsgaul
 +             Closes: #409483
 +    * fr.po: Remove a non-breakable space for usability
 +             issues. Closes: #408877
 +    * ru.po: Updated Russian translation. Closes: #405476
 +    * *.po: Unfuzzy after upstream typo corrections
 +    * vi.po: Updated to 515t. Closes: #426976
 +    * eu.po: Updated to 515t. Closes: #423766
 +    * pt.po: 515t. Closes: #423111
 +    * fr.po: Updated by Christian Perrier
 +    * Update all PO and the POT. Gives 513t2f for formerly
 +      complete translations
 +  * apt-pkg/policy.cc:
 +    - allow multiple packages (thanks to David Foerster)
 +
 + -- Michael Vogt <mvo@debian.org>  Wed,  2 May 2007 13:43:44 +0200
 +
 +apt (0.7.0) experimental; urgency=low
 +
 +  * Package that contains tall the new features
 +  * Removed all #pragma interface/implementation
 +  * Branch that contains tall the new features:
 +  * translated package descriptions
 +  * task install support
 +  * automatic dependency removal (thanks to Daniel Burrows)
 +  * merged support for the new dpkg "Breaks" field 
 +    (thanks to Ian Jackson)
 +  * handle network failures more gracefully on "update"
 +  * support for unattended-upgrades (via unattended-upgrades
 +    package)
 +  * added apt-transport-https method
 +
 + -- Michael Vogt <mvo@debian.org>  Fri, 12 Jan 2007 20:48:07 +0100
 +
 +apt (0.6.46.4-0.1) unstable; urgency=emergency
 +  
 +  * NMU
 +  * Fix broken use of awk in apt-key that caused removal of the wrong keys
 +    from the keyring. Closes: #412572
 +
 + -- Joey Hess <joeyh@debian.org>  Mon, 26 Feb 2007 16:00:22 -0500
 +
 +apt (0.6.46.4) unstable; urgency=high
 +
 +  * ack NMU (closes: #401017)
 +  * added apt-secure.8 to "See also" section
 +  * apt-pkg/deb/dpkgpm.cc:
 +    - added "Dpkg::StopOnError" variable that controls if apt
 +      will abort on errors from dpkg
 +  * apt-pkg/deb/debsrcrecords.{cc,h}:
 +    - make the Buffer grow dynmaically (closes: #400874)
 +  * Merged from Christian Perrier bzr branch:
 +    - uk.po: New Ukrainian translation: 483t28f3u
 +    - el.po: Update to 503t9f2u
 +    - de.po: Updates and corrections.
 +  * apt-pkg/contrib/progress.cc:
 +    - OpProgress::CheckChange optimized, thanks to Paul Brook
 +      (closes: #398381)
 +  * apt-pkg/contrib/sha256.cc:
 +    - fix building with noopt
 +
 + -- Michael Vogt <mvo@debian.org>  Thu,  7 Dec 2006 10:49:50 +0100
 +
 +apt (0.6.46.3-0.2) unstable; urgency=high
 +
 +  * Non-maintainer upload with permission of Michael Vogt.
 +  * Fix FTBFS on most arches (regression from the fix of #400874)
 +
 + -- Andreas Barth <aba@not.so.argh.org>  Tue,  5 Dec 2006 15:51:22 +0000 
 +  
 +apt (0.6.46.3-0.1) unstable; urgency=high
 +
 +  * Non-maintainer upload with permission of Michael Vogt.
 +  * Fix segfault at apt-get source. Closes: #400874
 +  * Add apt-key update in postinst, so that debian-archive-keyring doesn't
 +    need to depend on apt >= 0.6. Closes: #401114
 +  * Don't double-queue pdiff files. Closes: #401017
 +  
 + -- Andreas Barth <aba@not.so.argh.org>  Tue,  5 Dec 2006 10:34:56 +0000
 +
 +apt (0.6.46.3) unstable; urgency=low
 +
 +  * apt-pkg/deb/dpkgpm.cc:
 +    - make progress reporting robust against multiline error
 +      messages 
 +
 +  * Merged from Christian Perrier bzr branch:
 +    - ca.po: Updated to 514t
 +    - be.po: Updated to 514t
 +    - it.po: Updated to 514t
 +    - hu.po: Updated to 514t
 +    - zh_TW.po: Updated to 514t
 +    - ar.po: Updated to 293t221u.
 +    - ru.po: Updated to 514t. Closes: #392466
 +    - nb.po: Updated to 514t. Closes: #392466
 +    - pt.po: Updated to 514t. Closes: #393199
 +    - fr.po: One spelling error corrected: s/accèder/accéder
 +    - km.po: Updated to 514t.
 +    - ko.po: Updated to 514t.
 +    - bg.po: Updated to 514t.
 +    - de.po: Updated to 514t.
 +    - en_GB.po: Updated to 514t.
 +
 + -- Michael Vogt <mvo@debian.org>  Thu,  2 Nov 2006 11:37:58 +0100
 +
 +apt (0.6.46.2) unstable; urgency=low
 +
 +  * debian/control:
 +    - depend on debian-archive-keyring to offer clean upgrade path 
 +      (closes: #386800)
 +  * Merged from Christian Perrier bzr branch:
 +    - es.po: Updated to 514t. Closes: #391661
 +    - da.po: Updated to 514t. Closes: #391424
 +    - cs.po: Updated. Closes: #391064
 +    - es.po: Updated to 514t. Closes: #391661
 +    - da.po: Updated to 514t. Closes: #391424
 +
 + -- Michael Vogt <mvo@debian.org>  Wed, 11 Oct 2006 09:03:15 +0200
 +
  apt (0.6.46.1) unstable; urgency=low
  
 +  * merged "install-recommends" branch (ABI break): 
 +    - new "--install-recommends"
 +    - install new recommends on "upgrade" if --install-recommends is 
 +      given
 +    - new "--fix-policy" option to install all packages with unmet
 +      important dependencies (usefull with --install-recommends to
 +      see what not-installed recommends are on the system)
 +    - fix of recommended packages display (only show CandidateVersion
 +      fix or-group handling)
 +  * merged "install-task" branch (use with "apt-get install taskname^")
    * methods/gzip.cc:
      - deal with empty files 
 -  * Applied patch from Daniel Schepler to make apt bin-NMU able.  
 +  * Applied patch from Daniel Schepler to make apt bin-NMU able.
      (closes: bug#359634)
    * rebuild against current g++ because of:
      http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29289
    * make the internal buffer in pkgTagFile grow dynamically
      (closes: #388708)
    
 - -- Michael Vogt <michael.vogt@ubuntu.com>  Mon,  2 Oct 2006 16:02:30 +0200
 + -- Michael Vogt <mvo@debian.org>  Mon,  2 Oct 2006 20:42:20 +0200
  
  apt (0.6.46) unstable; urgency=low
  
@@@ -287,42 -90,26 +289,42 @@@ apt (0.6.45) unstable; urgency=lo
      * dz.po: New Dzongkha translation: 512t
      * ro.po: Updated to 512t
      * eu.po: Updated
 +    * eu.po: Updated
 +  * fix apt-get dist-upgrade
 +  * fix warning if no /var/lib/apt/extended_states is present
 +  * don't download Translations for deb-src sources.list lines
 +  * apt-pkg/tagfile.cc:
 +    - support not-mmapable files again
  
 - -- Michael Vogt <mvo@debian.org>  Thu, 27 Jul 2006 00:52:05 +0200
 + -- Michael Vogt <michael.vogt@ubuntu.com>  Tue, 25 Jul 2006 11:55:22 +0200
  
 -apt  (0.6.44.2) unstable; urgency=low 
 -  
 -   * apt-pkg/depcache.cc:
 -     - added Debug::pkgDepCache::AutoInstall (thanks to infinity)
 -   * apt-pkg/acquire-item.cc:
 -     - fix missing chmod() in the new aquire code
 -       (thanks to Bastian Blank, Closes: #367425)
 -   * merged from
 -     http://www.perrier.eu.org/debian/packages/d-i/level4/apt-main:
 -     * sk.po: Completed to 512t
 -     * eu.po: Completed to 512t
 -     * fr.po: Completed to 512t
 -     * sv.po: Completed to 512t
 -     * Update all PO and the POT. Gives 506t6f for formerly
 -       complete translations
 -
 - -- Michael Vogt <mvo@debian.org>  Wed, 14 Jun 2006 12:00:57 +0200 
 +apt (0.6.44.2exp1) experimental; urgency=low
 +
 +  * added support for i18n of the package descriptions
 +  * added support for aptitude like auto-install tracking (a HUGE
 +    HUGE thanks to Daniel Burrows who made this possible) 
 +  * synced with the http://people.debian.org/~mvo/bzr/apt/debian-sid branch
 +  * build from http://people.debian.org/~mvo/bzr/apt/debian-experimental
 +
 + -- Michael Vogt <mvo@debian.org>  Mon,  3 Jul 2006 21:50:31 +0200
 +
 +apt (0.6.44.2) unstable; urgency=low
 +
 +  * apt-pkg/depcache.cc:
 +    - added Debug::pkgDepCache::AutoInstall (thanks to infinity)
 +  * apt-pkg/acquire-item.cc:
 +    - fix missing chmod() in the new aquire code 
 +      (thanks to Bastian Blank, Closes: #367425)
 +  * merged from 
 +    http://www.perrier.eu.org/debian/packages/d-i/level4/apt-main:
 +    * sk.po: Completed to 512t
 +    * eu.po: Completed to 512t
 +    * fr.po: Completed to 512t
 +    * sv.po: Completed to 512t
 +    * Update all PO and the POT. Gives 506t6f for formerly
 +      complete translations
 +
 + -- Michael Vogt <mvo@debian.org>  Wed, 14 Jun 2006 12:00:57 +0200
  
  apt (0.6.44.1-0.1) unstable; urgency=low
  
  
  apt (0.6.44.1) unstable; urgency=low
  
 +  * apt-pkg/acquire-item.cc:
 +    - fix reversed logic of the "Acquire::PDiffs" option
    * merged from 
      http://www.perrier.eu.org/debian/packages/d-i/level4/apt-main:
      - po/LINGUAS: added "bg" Closes: #360262
      - po/gl.po: Galician translation update. Closes: #366849
      - po/hu.po: Hungarian translation update. Closes: #365448
      - po/cs.po: Czech translation updated. Closes: #367244
 +  * apt-pkg/contrib/sha256.cc:
 +    - applied patch to fix unaligned access problem. Closes: #367417
 +      (thanks to David Mosberger)
  
   -- Michael Vogt <mvo@debian.org>  Tue, 16 May 2006 21:51:16 +0200
  
  apt (0.6.44) unstable; urgency=low
  
    * apt-pkg/acquire.cc: don't show ETA if it is 0 or absurdely large
 +  * apt-pkg/contrib/sha256.{cc,h},hashes.{cc,h}: support for sha256 
 +    (thanks to Anthony Towns)
 +  * ftparchive/cachedb.{cc,h},writer.{cc,h}: optimizations 
 +    (thanks to Anthony Towns)
 +  * apt pdiff support from experimental merged
 +  * apt-pkg/deb/dpkgpm.cc: wording fixes (thanks to Matt Zimmerman)
    * apt-pkg/deb/dpkgpm.cc: 
      - wording fixes (thanks to Matt Zimmerman)
 -    - fix error in dpkg interaction (closes: #364513, 
 -      thanks to Martin Dickopp)
 +    - fix error in dpkg interaction (closes: #364513, thanks to Martin Dickopp)
    * apt-pkg/tagfile.{cc,h}:
      - use MMap to read the entries (thanks to Zephaniah E. Hull for the
        patch) Closes: #350025
@@@ -554,7 -331,7 +556,7 @@@ apt (0.6.42) unstable; urgency=lo
    * cmdline/apt-cdrom.cc: 
      - fix some missing gettext() calls (closes: #334539)
    * doc/apt-cache.8.xml: fix typo (closes: #334714)
 -  
 +
   -- Michael Vogt <mvo@debian.org>  Wed, 19 Oct 2005 22:02:09 +0200
  
  apt (0.6.41) unstable; urgency=low
@@@ -654,7 -431,6 +656,7 @@@ apt (0.6.37) breezy; urgency=lo
    * Add Welsh translation from Dafydd Harries
      (daf@muse.19inch.net--2005/apt--main--0--patch-1)
    * Change debian/bugscript to use #!/bin/bash (Closes: #313402)
 +  * Fix a incorrect example in the man-page (closes: #282918)
  
   -- Matt Zimmerman <mdz@ubuntu.com>  Tue, 24 May 2005 14:38:25 -0700
  
index 4fbea13e149618d83f7887d2df5ae445876f9122,d514ea16e42b68f29857343e77669a2dbeebf23f..290326ec31cf1cadd6a36d91eeefae8976b30caf
     ##################################################################### */
                                                                        /*}}}*/
  // Include Files                                                      /*{{{*/
- #ifdef __GNUG__
- #pragma implementation "apt-ftparchive.h"
- #endif
  #include "apt-ftparchive.h"
      
  #include <apt-pkg/error.h>
@@@ -24,7 -20,6 +20,7 @@@
  #include <apti18n.h>
  #include <algorithm>
  
 +#include <climits>
  #include <sys/time.h>
  #include <regex.h>