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

mips and cps changes
Author: jgg
Date: 1999-10-16 19:53:18 GMT
mips and cps changes

Arch Librarian лет назад: 22
Родитель
Сommit
31a0531dde
5 измененных файлов с 21 добавлено и 52 удалено
  1. 6 14
      apt-pkg/acquire.cc
  2. 1 0
      buildlib/archtable
  3. 1 0
      buildlib/sizetable
  4. 10 37
      cmdline/apt-get.cc
  5. 3 1
      debian/changelog

+ 6 - 14
apt-pkg/acquire.cc

@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
 // Description								/*{{{*/
-// $Id: acquire.cc,v 1.38 1999/07/30 05:36:52 jgg Exp $
+// $Id: acquire.cc,v 1.39 1999/10/16 19:53:18 jgg Exp $
 /* ######################################################################
 /* ######################################################################
 
 
    Acquire - File Acquiration
    Acquire - File Acquiration
@@ -793,24 +793,16 @@ void pkgAcquireStatus::Stop()
    struct timeval NewTime;
    struct timeval NewTime;
    gettimeofday(&NewTime,0);
    gettimeofday(&NewTime,0);
    
    
-   // Compute the delta time with full accuracy
-   long usdiff = NewTime.tv_usec - StartTime.tv_usec;
-   long sdiff = NewTime.tv_sec - StartTime.tv_sec;
+   double Delta = NewTime.tv_sec - StartTime.tv_sec + 
+                  (NewTime.tv_usec - StartTime.tv_usec)/1000000.0;
    
    
-   // Borrow
-   if (usdiff < 0)
-   {	 
-      usdiff += 1000000;
-      sdiff--;
-   }
-
    // Compute the CPS value
    // Compute the CPS value
-   if (sdiff == 0 && usdiff == 0)
+   if (Delta < 0.01)
       CurrentCPS = 0;
       CurrentCPS = 0;
    else
    else
-      CurrentCPS = FetchedBytes/(sdiff + usdiff/1000000.0);
+      CurrentCPS = FetchedBytes/Delta;
    LastBytes = CurrentBytes;
    LastBytes = CurrentBytes;
-   ElapsedTime = sdiff;
+   ElapsedTime = (unsigned int)Delta;
 }
 }
 									/*}}}*/
 									/*}}}*/
 // AcquireStatus::Fetched - Called when a byte set has been fetched	/*{{{*/
 // AcquireStatus::Fetched - Called when a byte set has been fetched	/*{{{*/

+ 1 - 0
buildlib/archtable

@@ -27,3 +27,4 @@ m68k	m68k	m68k
 arm	arm	arm
 arm	arm	arm
 powerpc	powerpc	powerpc
 powerpc	powerpc	powerpc
 ppc	powerpc	powerpc
 ppc	powerpc	powerpc
+mipsel  mipsel  mipsel

+ 1 - 0
buildlib/sizetable

@@ -15,3 +15,4 @@ alpha:  little  1 4 2 8
 sparc:  big     1 4 2 4
 sparc:  big     1 4 2 4
 m68k:   big     1 4 2 4
 m68k:   big     1 4 2 4
 powerpc: big    1 4 2 4
 powerpc: big    1 4 2 4
+mipsel: little  1 4 2 4

+ 10 - 37
cmdline/apt-get.cc

@@ -1,30 +1,3 @@
-// -*- mode: cpp; mode: fold -*-
-// Description								/*{{{*/
-// $Id: apt-get.cc,v 1.77 1999/09/30 06:30:34 jgg Exp $
-/* ######################################################################
-   
-   apt-get - Cover for dpkg
-   
-   This is an allout cover for dpkg implementing a safer front end. It is
-   based largely on libapt-pkg.
-
-   The syntax is different, 
-      apt-get [opt] command [things]
-   Where command is:
-      update - Resyncronize the package files from their sources
-      upgrade - Smart-Download the newest versions of all packages
-      dselect-upgrade - Follows dselect's changes to the Status: field
-                       and installes new and removes old packages
-      dist-upgrade - Powerfull upgrader designed to handle the issues with
-                    a new distribution.
-      install - Download and install a given package (by name, not by .deb)
-      check - Update the package cache and check for broken packages
-      clean - Erase the .debs downloaded to /var/cache/apt/archives and
-              the partial dir too
-
-   ##################################################################### */
-									/*}}}*/
-// Include Files							/*{{{*/
 #include <apt-pkg/error.h>
 #include <apt-pkg/error.h>
 #include <apt-pkg/cmndline.h>
 #include <apt-pkg/cmndline.h>
 #include <apt-pkg/init.h>
 #include <apt-pkg/init.h>
@@ -579,16 +552,6 @@ bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask = true,bool Saftey =
       c0out << DebBytes << ',' << Cache->DebSize() << endl;
       c0out << DebBytes << ',' << Cache->DebSize() << endl;
       c0out << "How odd.. The sizes didn't match, email apt@packages.debian.org" << endl;
       c0out << "How odd.. The sizes didn't match, email apt@packages.debian.org" << endl;
    }
    }
-
-   // Check for enough free space
-   struct statfs Buf;
-   string OutputDir = _config->FindDir("Dir::Cache::Archives");
-   if (statfs(OutputDir.c_str(),&Buf) != 0)
-      return _error->Errno("statfs","Couldn't determine free space in %s",
-			   OutputDir.c_str());
-   if (unsigned(Buf.f_bfree) < (FetchBytes - FetchPBytes)/Buf.f_bsize)
-      return _error->Error("Sorry, you don't have enough free space in %s",
-			   OutputDir.c_str());
    
    
    // Number of bytes
    // Number of bytes
    c1out << "Need to get ";
    c1out << "Need to get ";
@@ -598,6 +561,16 @@ bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask = true,bool Saftey =
       c1out << SizeToStr(DebBytes) << 'B';
       c1out << SizeToStr(DebBytes) << 'B';
       
       
    c1out << " of archives. After unpacking ";
    c1out << " of archives. After unpacking ";
+
+   // Check for enough free space
+   struct statfs Buf;
+   string OutputDir = _config->FindDir("Dir::Cache::Archives");
+   if (statfs(OutputDir.c_str(),&Buf) != 0)
+      return _error->Errno("statfs","Couldn't determine free space in %s",
+			   OutputDir.c_str());
+   if (unsigned(Buf.f_bfree) < (FetchBytes - FetchPBytes)/Buf.f_bsize)
+      return _error->Error("Sorry, you don't have enough free space in %s to hold all the .debs.",
+			   OutputDir.c_str());
    
    
    // Size delta
    // Size delta
    if (Cache->UsrSize() >= 0)
    if (Cache->UsrSize() >= 0)

+ 3 - 1
debian/changelog

@@ -1,13 +1,15 @@
 apt (0.3.13.1) unstable; urgency=low
 apt (0.3.13.1) unstable; urgency=low
 
 
   * Fix Perl or group pre-depends thing Closes: #46091, #46096, #46233, #45901
   * Fix Perl or group pre-depends thing Closes: #46091, #46096, #46233, #45901
-  * Fix handling of dpkg's conversions from < -> <= Closes: #46094
+  * Fix handling of dpkg's conversions from < -> <= Closes: #46094, #47088
   * Make unparsable priorities non-fatal Closes: #46266, #46267, #46293, #46298  
   * Make unparsable priorities non-fatal Closes: #46266, #46267, #46293, #46298  
   * Fix handling of '/' for the dist name. Closes: #43830, #45640, #45692
   * Fix handling of '/' for the dist name. Closes: #43830, #45640, #45692
   * Fixed 'Method gave a blank filename' error from IMS queries onto CDs.
   * Fixed 'Method gave a blank filename' error from IMS queries onto CDs.
     Closes: #45034, #45695, #46537
     Closes: #45034, #45695, #46537
   * Made OR group handling in the problem resolver more elaborate. Closes: #45646
   * Made OR group handling in the problem resolver more elaborate. Closes: #45646
   * Added APT::Clean-Installed option. Closes: #45973
   * Added APT::Clean-Installed option. Closes: #45973
+  * Moves the free space check to after the calculated size is printed.
+    Closes: #46639, #47498
   
   
  -- Jason Gunthorpe <jgg@debian.org>  Fri,  3 Sep 1999 09:04:28 -0700
  -- Jason Gunthorpe <jgg@debian.org>  Fri,  3 Sep 1999 09:04:28 -0700