diff options
author | Arch Librarian <arch@canonical.com> | 2004-09-20 16:55:37 +0000 |
---|---|---|
committer | Arch Librarian <arch@canonical.com> | 2004-09-20 16:55:37 +0000 |
commit | 7ef724464cfe431862e0731327a3a131505fa38d (patch) | |
tree | a979b8372399fddcbdfbaba14b1e5c9e5060cb0f /apt-pkg | |
parent | 5af32db6607ca018936285fd19a776bd10a418f0 (diff) |
Fixed ftp resume
Author: jgg
Date: 2000-01-10 03:44:54 GMT
Fixed ftp resume
Diffstat (limited to 'apt-pkg')
-rw-r--r-- | apt-pkg/contrib/strutl.cc | 4 | ||||
-rw-r--r-- | apt-pkg/pkgcachegen.cc | 13 |
2 files changed, 13 insertions, 4 deletions
diff --git a/apt-pkg/contrib/strutl.cc b/apt-pkg/contrib/strutl.cc index 8e80c5efd..6b22cfe03 100644 --- a/apt-pkg/contrib/strutl.cc +++ b/apt-pkg/contrib/strutl.cc @@ -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--; diff --git a/apt-pkg/pkgcachegen.cc b/apt-pkg/pkgcachegen.cc index 4033dc540..404ef652a 100644 --- a/apt-pkg/pkgcachegen.cc +++ b/apt-pkg/pkgcachegen.cc @@ -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++; |