// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: acquire-item.cc,v 1.24 1999/02/19 07:56:06 jgg Exp $
+// $Id: acquire-item.cc,v 1.25 1999/02/27 22:29:11 jgg Exp $
/* ######################################################################
Acquire Item - Item to acquire
if (Cnf->LocalOnly == true ||
StringToBool(LookupTag(Message,"Transient-Failure"),false) == false)
{
- Status = StatIdle;
+ // Ignore this
+ Status = StatDone;
+ Complete = false;
Dequeue();
return;
}
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: strutl.cc,v 1.19 1999/02/01 08:11:57 jgg Exp $
+// $Id: strutl.cc,v 1.20 1999/02/27 22:29:11 jgg Exp $
/* ######################################################################
String Util - Some usefull string functions.
#include <ctype.h>
#include <string.h>
#include <stdio.h>
+#include <unistd.h>
/*}}}*/
// strstrip - Remove white space from the front and back of a string /*{{{*/
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: acqprogress.cc,v 1.9 1999/02/01 08:11:57 jgg Exp $
+// $Id: acqprogress.cc,v 1.10 1999/02/27 22:29:11 jgg Exp $
/* ######################################################################
Acquire Progress - Command line progress meter
if (Quiet <= 0)
cout << '\r' << BlankLine << '\r';
- if (Itm.Owner->Status == pkgAcquire::Item::StatIdle)
+ if (Itm.Owner->Status == pkgAcquire::Item::StatDone)
{
cout << "Ign " << Itm.Description << endl;
}
case "$1" in
configure)
if [ -f /usr/sbin/dhelp_parse ]; then
- #/usr/sbin/dhelp_parse -a /usr/doc/libapt-pkg-doc
+ /usr/sbin/dhelp_parse -a /usr/doc/libapt-pkg-doc
fi
;;
esac
case "$1" in
remove|upgrade|remove-in-favour|deconfigure-in-favour)
if [ -f /usr/sbin/dhelp_parse ]; then
- #/usr/sbin/dhelp_parse -d /usr/doc/libapt-pkg-doc
+ /usr/sbin/dhelp_parse -d /usr/doc/libapt-pkg-doc
fi
;;
failed-upgrade)
-// $Id: apt.conf,v 1.24 1999/01/31 08:55:53 jgg Exp $
+// $Id: apt.conf,v 1.25 1999/02/27 22:29:11 jgg Exp $
/* This file is an index of all APT configuration directives. It should
NOT actually be used as a real config file, though it is a completely
valid file.
Acquire
{
Queue-Mode "host"; // host|access
- Retry "false";
+ Retries "0";
// HTTP method configuration
http
{
Proxy "http://127.0.0.1:3128";
Proxy::http.us.debian.org "DIRECT"; // Specific per-host setting
+ Timeout "120";
// Cache Control. Note these do not work with Squid 2.0.2
No-Cache "false";
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: http.cc,v 1.26 1999/02/15 00:26:55 jgg Exp $
+// $Id: http.cc,v 1.27 1999/02/27 22:29:11 jgg Exp $
/* ######################################################################
HTTP Aquire Method - This is the HTTP aquire method for APT.
/* */
bool HttpMethod::ServerDie(ServerState *Srv)
{
+ unsigned int LErrno = errno;
+
// Dump the buffer to the file
if (Srv->State == ServerState::Data)
{
Srv->Encoding != ServerState::Closes)
{
Srv->Close();
- if (errno == 0)
+ if (LErrno == 0)
return _error->Error("Error reading from server Remote end closed connection");
+ errno = LErrno;
return _error->Errno("read","Error reading from server");
}
else
int FailCounter = 0;
while (1)
- {
- if (FailCounter >= 2)
- {
- Fail("Massive Server Brain Damage",true);
- FailCounter = 0;
- }
-
+ {
// We have no commands, wait for some to arrive
if (Queue == 0)
{
FailCounter++;
_error->Discard();
Server->Close();
+
+ if (FailCounter >= 2)
+ {
+ Fail("Connection timed out",true);
+ FailCounter = 0;
+ }
+
continue;
}
};
URIDone(Res);
}
else
- Fail();
+ Fail(true);
break;
}
-#include <apt-pkg/acquire-item.h>
-#include <apt-pkg/acquire-worker.h>
-#include <apt-pkg/init.h>
-#include <apt-pkg/error.h>
-#include <strutl.h>
+#include <apt-pkg/tagfile.h>
#include <signal.h>
#include <stdio.h>
int main(int argc,char *argv[])
{
-
- URI Foo(argv[1]);
- cout << Foo.Access << '\'' << endl;
- cout << Foo.Host << '\'' << endl;
- cout << Foo.Path << '\'' << endl;
- cout << Foo.User << '\'' << endl;
- cout << Foo.Password << '\'' << endl;
- cout << Foo.Port << endl;
+ FileFd F(argv[1],FileFd::ReadOnly);
+ pkgTagFile Reader(F);
+
+ pkgTagSection Sect;
+ while (Reader.Step(Sect) == true)
+ {
+ Sect.FindS("Package");
+ Sect.FindS("Section");
+ Sect.FindS("Version");
+ Sect.FindI("Size");
+ };
return 0;
}