summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
e3bf76d)
Author: jgg
Date: 1999-07-30 05:36:52 GMT
Fixed up dpkginit and acquire stuff..
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: acquire-worker.cc,v 1.23 1999/07/26 17:46:07 jgg Exp $
+// $Id: acquire-worker.cc,v 1.24 1999/07/30 05:36:52 jgg Exp $
/* ######################################################################
Acquire Worker
/* ######################################################################
Acquire Worker
Config = Cnf;
Access = Cnf->Access;
CurrentItem = 0;
Config = Cnf;
Access = Cnf->Access;
CurrentItem = 0;
+ TotalSize = 0;
+ CurrentSize = 0;
+
Config = Cnf;
Access = Cnf->Access;
CurrentItem = 0;
Config = Cnf;
Access = Cnf->Access;
CurrentItem = 0;
+ TotalSize = 0;
+ CurrentSize = 0;
pkgAcquire::Item *Owner = Itm->Owner;
pkgAcquire::ItemDesc Desc = *Itm;
OwnerQ->ItemDone(Itm);
pkgAcquire::Item *Owner = Itm->Owner;
pkgAcquire::ItemDesc Desc = *Itm;
OwnerQ->ItemDone(Itm);
- Owner->Done(Message,atoi(LookupTag(Message,"Size","0").c_str()),
- LookupTag(Message,"MD5-Hash"));
+ Pulse();
+ if (TotalSize != 0 &&
+ 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,
+ LookupTag(Message,"MD5-Hash"));
ItemDone();
// Log that we are done
ItemDone();
// Log that we are done
if (stat(CurrentItem->Owner->DestFile.c_str(),&Buf) != 0)
return;
CurrentSize = Buf.st_size;
if (stat(CurrentItem->Owner->DestFile.c_str(),&Buf) != 0)
return;
CurrentSize = Buf.st_size;
+
+ // Hmm? Should not happen...
+ if (CurrentSize > TotalSize && TotalSize != 0)
+ TotalSize = CurrentSize;
}
/*}}}*/
// Worker::ItemDone - Called when the current item is finished /*{{{*/
}
/*}}}*/
// Worker::ItemDone - Called when the current item is finished /*{{{*/
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: acquire.cc,v 1.37 1999/07/03 03:10:35 jgg Exp $
+// $Id: acquire.cc,v 1.38 1999/07/30 05:36:52 jgg Exp $
/* ######################################################################
Acquire - File Acquiration
/* ######################################################################
Acquire - File Acquiration
TotalBytes = 1;
if (Unknown == Count)
TotalBytes = Unknown;
TotalBytes = 1;
if (Unknown == Count)
TotalBytes = Unknown;
+
+ // Wha?! Is not supposed to happen.
+ if (CurrentBytes > TotalBytes)
+ CurrentBytes = TotalBytes;
// Compute the CPS
struct timeval NewTime;
// Compute the CPS
struct timeval NewTime;
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: dpkginit.cc,v 1.3 1999/07/26 17:46:08 jgg Exp $
+// $Id: dpkginit.cc,v 1.4 1999/07/30 05:36:52 jgg Exp $
/* ######################################################################
DPKG init - Initialize the dpkg stuff
/* ######################################################################
DPKG init - Initialize the dpkg stuff
"are you root?");
// See if we need to abort with a dirty journal
"are you root?");
// See if we need to abort with a dirty journal
- if (WithUpdates == true && CheckUpdates() == false)
+ if (WithUpdates == true && CheckUpdates() == true)
{
Close();
return _error->Error("dpkg was interrupted, you must manually "
{
Close();
return _error->Error("dpkg was interrupted, you must manually "
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: gzip.cc,v 1.7 1999/01/27 02:48:53 jgg Exp $
+// $Id: gzip.cc,v 1.8 1999/07/30 05:37:00 jgg Exp $
/* ######################################################################
GZip method - Take a file URI in and decompress it into the target
/* ######################################################################
GZip method - Take a file URI in and decompress it into the target
if (utime(Itm->DestFile.c_str(),&TimeBuf) != 0)
return _error->Errno("utime","Failed to set modification time");
if (utime(Itm->DestFile.c_str(),&TimeBuf) != 0)
return _error->Errno("utime","Failed to set modification time");
+ if (stat(Itm->DestFile.c_str(),&Buf) != 0)
+ return _error->Errno("stat","Failed to stat");
+
// Return a Done response
Res.LastModified = Buf.st_mtime;
// Return a Done response
Res.LastModified = Buf.st_mtime;
+ Res.Size = Buf.st_size;
URIDone(Res);
return true;
URIDone(Res);
return true;