Random fixes..
authorArch Librarian <arch@canonical.com>
Mon, 20 Sep 2004 16:54:28 +0000 (16:54 +0000)
committerArch Librarian <arch@canonical.com>
Mon, 20 Sep 2004 16:54:28 +0000 (16:54 +0000)
Author: jgg
Date: 1999-08-03 05:19:41 GMT
Random fixes..

apt-pkg/acquire-item.cc
apt-pkg/acquire-worker.cc
apt-pkg/orderlist.h
apt-pkg/packagemanager.cc

index 1f7980b..63c47f7 100644 (file)
@@ -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;
       }
index 7fdb03a..d5b4541 100644 (file)
@@ -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();
            
index 121c9a9..f15db4c 100644 (file)
@@ -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;};
index 126caef..68827f5 100644 (file)
@@ -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;