Author: jgg
Date: 1998-12-05 01:45:19 GMT
Fixed cdrom method problems
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: acquire-method.cc,v 1.12 1998/12/04 22:56:50 jgg Exp $
+// $Id: acquire-method.cc,v 1.13 1998/12/05 01:45:19 jgg Exp $
/* ######################################################################
Acquire Method
/* ######################################################################
Acquire Method
while (1)
{
if (WaitFd(STDIN_FILENO) == false)
while (1)
{
if (WaitFd(STDIN_FILENO) == false)
if (ReadMessages(STDIN_FILENO,MyMessages) == false)
if (ReadMessages(STDIN_FILENO,MyMessages) == false)
string Message = MyMessages.front();
MyMessages.erase(MyMessages.begin());
string Message = MyMessages.front();
MyMessages.erase(MyMessages.begin());
// Change ack
if (Number == 603)
{
// Change ack
if (Number == 603)
{
- while (Message.empty() == false)
+ while (MyMessages.empty() == false)
{
Messages.push_back(MyMessages.front());
MyMessages.erase(MyMessages.begin());
}
{
Messages.push_back(MyMessages.front());
MyMessages.erase(MyMessages.begin());
}
- return StringToBool(LookupTag(Message,"Fail"),false);
+ return !StringToBool(LookupTag(Message,"Fail"),false);
}
Messages.push_back(Message);
}
Messages.push_back(Message);
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: acquire-worker.cc,v 1.14 1998/12/04 21:16:47 jgg Exp $
+// $Id: acquire-worker.cc,v 1.15 1998/12/05 01:45:20 jgg Exp $
/* ######################################################################
Acquire Worker
/* ######################################################################
Acquire Worker
read returned -1. */
bool pkgAcquire::Worker::MethodFailure()
{
read returned -1. */
bool pkgAcquire::Worker::MethodFailure()
{
- cerr << "Method " << Access << " has died unexpectedly!" << endl;
+ _error->Error("Method %s has died unexpectedly!",Access.c_str());
+
if (waitpid(Process,0,0) != Process)
_error->Warning("I waited but nothing was there!");
Process = -1;
if (waitpid(Process,0,0) != Process)
_error->Warning("I waited but nothing was there!");
Process = -1;
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: cdrom.cc,v 1.2 1998/12/04 22:56:55 jgg Exp $
+// $Id: cdrom.cc,v 1.3 1998/12/05 01:45:21 jgg Exp $
/* ######################################################################
CDROM URI method for APT
/* ######################################################################
CDROM URI method for APT
// CDROMMethod::CDROMethod - Constructor /*{{{*/
// ---------------------------------------------------------------------
/* */
// CDROMMethod::CDROMethod - Constructor /*{{{*/
// ---------------------------------------------------------------------
/* */
-CDROMMethod::CDROMMethod() : pkgAcqMethod("1.0",SingleInstance | LocalOnly)
+CDROMMethod::CDROMMethod() : pkgAcqMethod("1.0",SingleInstance | LocalOnly |
+ SendConfig)
{
// Read the database
string DFile = _config->FindFile("Dir::State::cdroms");
{
// Read the database
string DFile = _config->FindFile("Dir::State::cdroms");
}
string CDROM = _config->FindDir("Acquire::cdrom::mount","/cdrom/");
}
string CDROM = _config->FindDir("Acquire::cdrom::mount","/cdrom/");
+ if (CDROM[0] == '.')
+ CDROM= SafeGetCWD() + '/' + CDROM;
string NewID;
while (1)
{
string NewID;
while (1)
{
UnmountCdrom(CDROM);
if (MediaFail(Get.Host,CDROM) == false)
{
UnmountCdrom(CDROM);
if (MediaFail(Get.Host,CDROM) == false)
{
+ CurrentID = "FAIL";
+ Fail("Wrong CD",true);
+ return true;