Просмотр исходного кода

add Debug::acquire::progress debug option and fixme for index file loading with the correct extension

Michael Vogt лет назад: 12
Родитель
Сommit
c62f7898b6
2 измененных файлов с 9 добавлено и 0 удалено
  1. 1 0
      apt-pkg/acquire-item.cc
  2. 8 0
      apt-pkg/acquire.cc

+ 1 - 0
apt-pkg/acquire-item.cc

@@ -963,6 +963,7 @@ pkgAcqIndex::pkgAcqIndex(pkgAcquire *Owner, IndexTarget const *Target,
    else
    else
      Verify = true;
      Verify = true;
 
 
+   // FIXME: use the appropriate compression Extension
    // load the filesize
    // load the filesize
    indexRecords::checkSum *Record = MetaIndexParser->Lookup(string(Target->MetaKey));
    indexRecords::checkSum *Record = MetaIndexParser->Lookup(string(Target->MetaKey));
    if(Record)
    if(Record)

+ 8 - 0
apt-pkg/acquire.cc

@@ -846,6 +846,7 @@ bool pkgAcquireStatus::Pulse(pkgAcquire *Owner)
    unsigned long long ResumeSize = 0;
    unsigned long long ResumeSize = 0;
    for (pkgAcquire::Worker *I = Owner->WorkersBegin(); I != 0;
    for (pkgAcquire::Worker *I = Owner->WorkersBegin(); I != 0;
 	I = Owner->WorkerStep(I))
 	I = Owner->WorkerStep(I))
+   {
       if (I->CurrentItem != 0 && I->CurrentItem->Owner->Complete == false)
       if (I->CurrentItem != 0 && I->CurrentItem->Owner->Complete == false)
       {
       {
 	 CurrentBytes += I->CurrentSize;
 	 CurrentBytes += I->CurrentSize;
@@ -856,7 +857,14 @@ bool pkgAcquireStatus::Pulse(pkgAcquire *Owner)
 	     I->CurrentItem->Owner->Complete == false)
 	     I->CurrentItem->Owner->Complete == false)
 	    TotalBytes += I->CurrentSize;
 	    TotalBytes += I->CurrentSize;
       }
       }
+   }
    
    
+   // debug
+   if (_config->FindB("Debug::acquire::progress", false) == true)
+      std::clog << " Bytes: " 
+                << SizeToStr(CurrentBytes) << " / " << SizeToStr(TotalBytes) 
+                << std::endl;
+
    // Normalize the figures and account for unknown size downloads
    // Normalize the figures and account for unknown size downloads
    if (TotalBytes <= 0)
    if (TotalBytes <= 0)
       TotalBytes = 1;
       TotalBytes = 1;