Fixed ftp resume
authorArch Librarian <arch@canonical.com>
Mon, 20 Sep 2004 16:55:37 +0000 (16:55 +0000)
committerArch Librarian <arch@canonical.com>
Mon, 20 Sep 2004 16:55:37 +0000 (16:55 +0000)
Author: jgg
Date: 2000-01-10 03:44:54 GMT
Fixed ftp resume

apt-pkg/contrib/strutl.cc
apt-pkg/pkgcachegen.cc
debian/changelog
doc/apt.conf.5.yo
methods/ftp.cc

index 8e80c5e..6b22cfe 100644 (file)
@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description                                                         /*{{{*/
-// $Id: strutl.cc,v 1.31 1999/12/10 07:21:52 jgg Exp $
+// $Id: strutl.cc,v 1.32 2000/01/10 03:44:54 jgg Exp $
 /* ######################################################################
 
    String Util - Some usefull string functions.
@@ -660,7 +660,7 @@ bool StrToTime(string Val,time_t &Result)
                    &Tm.tm_hour,&Tm.tm_min,&Tm.tm_sec,&Tm.tm_year) != 6)
         {
            // 'ftp' time
-           if (sscanf(I,"%4d%2d%2d%2d%2d%2d",&Tm.tm_year,&Tm.tm_mon,
+           if (sscanf(Val.c_str(),"%4d%2d%2d%2d%2d%2d",&Tm.tm_year,&Tm.tm_mon,
                       &Tm.tm_mday,&Tm.tm_hour,&Tm.tm_min,&Tm.tm_sec) != 6)
               return false;
            Tm.tm_mon--;
index 4033dc5..404ef65 100644 (file)
@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description                                                         /*{{{*/
-// $Id: pkgcachegen.cc,v 1.43 1999/12/10 23:40:29 jgg Exp $
+// $Id: pkgcachegen.cc,v 1.44 2000/01/10 03:44:54 jgg Exp $
 /* ######################################################################
    
    Package Cache Generator - Generator for the cache structure.
@@ -26,7 +26,7 @@
 #include <sys/stat.h>
 #include <unistd.h>
 #include <errno.h>
-
+#include <stdio.h>
 #include <system.h>
                                                                        /*}}}*/
 
@@ -470,6 +470,15 @@ bool pkgSrcCacheCheck(pkgSourceList &List)
       struct stat Buf;
       if (stat(File.c_str(),&Buf) != 0)
       {
+        // Old format file name.. rename it
+        if (File[0] == '_' && stat(File.c_str()+1,&Buf) == 0)
+        {
+           if (rename(File.c_str()+1,File.c_str()) != 0)
+              return _error->Errno("rename","Failed to rename %s to %s",
+                                   File.c_str()+1,File.c_str());
+           continue;
+        }       
+        
         _error->WarningE("stat","Couldn't stat source package list '%s' (%s)",
                          I->PackagesInfo().c_str(),File.c_str());       
         Missing++;
index d2b433d..d9f6cb2 100644 (file)
@@ -1,8 +1,12 @@
 apt (0.3.15.1) unstable; urgency=low
  
-  * Made --no-download work.
+  * Made --no-download work. Closes: #52993
   * Now compiles on OpenBSD, Solaris and HP-UX
   * Clarify segfault errors
+  * More debhelper fixes. Closes: #52662, #54566
+  * Fix for Joel's discovery of glibc removal behavoir.
+  * Fix for Ben Collins file: uri from slink upgrade.
+  * Fixed resume code in FTP. Closes: #54323
   
  -- Jason Gunthorpe <jgg@debian.org>  Sat,  4 Dec 1999 21:17:24 -0800
   
index c9a116d..996de3a 100644 (file)
@@ -109,7 +109,7 @@ dit(bf(Retries))
 Number of retries to perform. If this is non-zero apt will retry failed 
 files the given number of times.
 
-dit(bf(Acquire::Source-Symlinks))
+dit(bf(Source-Symlinks))
 Use symlinks for source archives. If set to true then source archives will
 be symlinked when possible instead of copying. True is the default
 
index 1780ac7..ac12d09 100644 (file)
@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description                                                         /*{{{*/
-// $Id: ftp.cc,v 1.18 1999/12/10 07:21:52 jgg Exp $
+// $Id: ftp.cc,v 1.19 2000/01/10 03:44:54 jgg Exp $
 /* ######################################################################
 
    HTTP Aquire Method - This is the FTP aquire method for APT.
@@ -814,6 +814,7 @@ bool FtpMethod::Fetch(FetchItem *Itm)
       {
         Res.Size = Buf.st_size;
         Res.LastModified = Buf.st_mtime;
+        Res.ResumePoint = Buf.st_size;
         URIDone(Res);
         return true;
       }
@@ -843,7 +844,6 @@ bool FtpMethod::Fetch(FetchItem *Itm)
         
         // Timestamp
         struct utimbuf UBuf;
-        time(&UBuf.actime);
         UBuf.actime = FailTime;
         UBuf.modtime = FailTime;
         utime(FailFile.c_str(),&UBuf);
@@ -863,7 +863,6 @@ bool FtpMethod::Fetch(FetchItem *Itm)
    
    // Timestamp
    struct utimbuf UBuf;
-   time(&UBuf.actime);
    UBuf.actime = FailTime;
    UBuf.modtime = FailTime;
    utime(Queue->DestFile.c_str(),&UBuf);