Kaynağa Gözat

Random fixes..
Author: jgg
Date: 1999-08-03 05:19:41 GMT
Random fixes..

Arch Librarian 22 yıl önce
ebeveyn
işleme
bdae53f1bf

+ 9 - 4
apt-pkg/acquire-item.cc

@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
-// $Id: acquire-item.cc,v 1.34 1999/07/20 05:53:32 jgg Exp $
+// $Id: acquire-item.cc,v 1.35 1999/08/03 05:19:41 jgg Exp $
 /* ######################################################################
 
    Acquire Item - Item to acquire
@@ -350,15 +350,18 @@ pkgAcqArchive::pkgAcqArchive(pkgAcquire *Owner,pkgSourceList *Sources,
    Retries = _config->FindI("Acquire::Retries",0);
 
    if (Version.Arch() == 0)
+   {
       _error->Error("I wasn't able to locate file for the %s package. "
 		    "This might mean you need to manually fix this package. (due to missing arch)",
 		    Version.ParentPkg().Name());
+      return;
+   }
    
    // Generate the final file name as: package_version_arch.deb
    StoreFilename = QuoteString(Version.ParentPkg().Name(),"_:") + '_' +
                    QuoteString(Version.VerStr(),"_:") + '_' +
                    QuoteString(Version.Arch(),"_:.") + ".deb";
-   
+
    // Select a source
    if (QueueNext() == false && _error->PendingError() == false)
       _error->Error("I wasn't able to locate file for the %s package. "
@@ -476,7 +479,8 @@ void pkgAcqArchive::Done(string Message,unsigned long Size,string Md5Hash)
    // Check the size
    if (Size != Version->Size)
    {
-      _error->Error("Size mismatch for package %s",Version.ParentPkg().Name());
+      Status = StatError;
+      ErrorText = "Size mismatch";
       return;
    }
    
@@ -485,7 +489,8 @@ void pkgAcqArchive::Done(string Message,unsigned long Size,string Md5Hash)
    {
       if (Md5Hash != MD5)
       {
-	 _error->Error("MD5Sum mismatch for package %s",Version.ParentPkg().Name());
+	 Status = StatError;
+	 ErrorText = "MD5Sum mismatch";
 	 Rename(DestFile,DestFile + ".FAILED");
 	 return;
       }

+ 3 - 4
apt-pkg/acquire-worker.cc

@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
-// $Id: acquire-worker.cc,v 1.25 1999/08/03 02:25:38 jgg Exp $
+// $Id: acquire-worker.cc,v 1.26 1999/08/03 05:19:41 jgg Exp $
 /* ######################################################################
 
    Acquire Worker 
@@ -245,7 +245,6 @@ bool pkgAcquire::Worker::RunMessages()
 	       break;
 	    }
 
-	    Pulse();	    
 	    pkgAcquire::Item *Owner = Itm->Owner;
 	    pkgAcquire::ItemDesc Desc = *Itm;
 	    OwnerQ->ItemDone(Itm);
@@ -253,8 +252,8 @@ bool pkgAcquire::Worker::RunMessages()
 		atoi(LookupTag(Message,"Size","0").c_str()) != TotalSize)
 	       _error->Warning("Bizzar Error - File size is not what the server reported %s %u",
 			       LookupTag(Message,"Size","0").c_str(),TotalSize);
-	    
-	    Owner->Done(Message,CurrentSize,
+
+	    Owner->Done(Message,atoi(LookupTag(Message,"Size","0").c_str()),
 			LookupTag(Message,"MD5-Hash"));
 	    ItemDone();
 	    

+ 2 - 2
apt-pkg/orderlist.h

@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
-// $Id: orderlist.h,v 1.5 1999/07/12 03:40:38 jgg Exp $
+// $Id: orderlist.h,v 1.6 1999/08/03 05:19:41 jgg Exp $
 /* ######################################################################
 
    Order List - Represents and Manipulates an ordered list of packages.
@@ -102,7 +102,7 @@ class pkgOrderList
    bool IsMissing(PkgIterator Pkg);
    void WipeFlags(unsigned long F);
    void SetFileList(string *FileList) {this->FileList = FileList;};
-   
+
    // Accessors
    inline iterator begin() {return List;};
    inline iterator end() {return End;};

+ 6 - 2
apt-pkg/packagemanager.cc

@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
-// $Id: packagemanager.cc,v 1.18 1999/07/10 04:58:42 jgg Exp $
+// $Id: packagemanager.cc,v 1.19 1999/08/03 05:19:41 jgg Exp $
 /* ######################################################################
 
    Package Manager - Abstacts the package manager
@@ -87,7 +87,7 @@ bool pkgPackageManager::GetArchives(pkgAcquire *Owner,pkgSourceList *Sources,
 /* This is called to correct the installation when packages could not
    be downloaded. */
 bool pkgPackageManager::FixMissing()
-{
+{   
    pkgProblemResolver Resolve(Cache);
    List->SetFileList(FileNames);
    
@@ -101,6 +101,10 @@ bool pkgPackageManager::FixMissing()
       Bad = true;
       Cache.MarkKeep(I);
    }
+ 
+   // We have to empty the list otherwise it will not have the new changes
+   delete List;
+   List = 0;
    
    if (Bad == false)
       return true;