summaryrefslogtreecommitdiff
path: root/cmdline
diff options
context:
space:
mode:
authorArch Librarian <arch@canonical.com>2004-09-20 16:54:10 +0000
committerArch Librarian <arch@canonical.com>2004-09-20 16:54:10 +0000
commit281daf46d178d4fb6f43e8b13b9b51736db84d74 (patch)
tree236d9fb0f8b1fc26b22406ba6eab54967d69f253 /cmdline
parenta4e87467fe5c5d12a617a43f3115c89daa54b7cf (diff)
CD swapping support
Author: jgg Date: 1999-07-03 03:10:35 GMT CD swapping support
Diffstat (limited to 'cmdline')
-rw-r--r--cmdline/acqprogress.cc5
-rw-r--r--cmdline/apt-cdrom.cc5
-rw-r--r--cmdline/apt-get.cc112
3 files changed, 73 insertions, 49 deletions
diff --git a/cmdline/acqprogress.cc b/cmdline/acqprogress.cc
index d6031ad0a..f16843c61 100644
--- a/cmdline/acqprogress.cc
+++ b/cmdline/acqprogress.cc
@@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: acqprogress.cc,v 1.15 1999/06/13 05:06:40 jgg Exp $
+// $Id: acqprogress.cc,v 1.16 1999/07/03 03:10:35 jgg Exp $
/* ######################################################################
Acquire Progress - Command line progress meter
@@ -92,6 +92,9 @@ void AcqTextStatus::Fail(pkgAcquire::ItemDesc &Itm)
if (Quiet > 1)
return;
+ if (Itm.Owner->Status == pkgAcquire::Item::StatIdle)
+ return;
+
if (Quiet <= 0)
cout << '\r' << BlankLine << '\r';
diff --git a/cmdline/apt-cdrom.cc b/cmdline/apt-cdrom.cc
index dd45e9b48..67c3bc7e4 100644
--- a/cmdline/apt-cdrom.cc
+++ b/cmdline/apt-cdrom.cc
@@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: apt-cdrom.cc,v 1.25 1999/05/29 21:49:58 jgg Exp $
+// $Id: apt-cdrom.cc,v 1.26 1999/07/03 03:10:35 jgg Exp $
/* ######################################################################
APT CDROM - Tool for handling APT's CDROM database.
@@ -988,7 +988,8 @@ bool DoAdd(CommandLine &)
cout << "deb \"cdrom:" << Name << "/" << string(*I,0,Space) <<
"\" " << string(*I,Space+1) << endl;
}
-
+
+ cout << "Repeat this process for the rest of the CDs in your set." << endl;
return true;
}
/*}}}*/
diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc
index ca93dcd74..f81d22d20 100644
--- a/cmdline/apt-get.cc
+++ b/cmdline/apt-get.cc
@@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: apt-get.cc,v 1.66 1999/06/24 04:06:31 jgg Exp $
+// $Id: apt-get.cc,v 1.67 1999/07/03 03:10:36 jgg Exp $
/* ######################################################################
apt-get - Cover for dpkg
@@ -470,7 +470,12 @@ bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask = true,bool Saftey =
if (_config->FindB("APT::Get::Simulate") == true)
{
pkgSimulate PM(Cache);
- return PM.DoInstall();
+ pkgPackageManager::OrderResult Res = PM.DoInstall();
+ if (Res == pkgPackageManager::Failed)
+ return false;
+ if (Res != pkgPackageManager::Completed)
+ return _error->Error("Internal Error, Ordering didn't finish");
+ return true;
}
// Create the text record parser
@@ -589,60 +594,75 @@ bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask = true,bool Saftey =
}
// Run it
- if (_config->FindB("APT::Get::No-Download",false) == false)
- if( Fetcher.Run() == pkgAcquire::Failed)
- return false;
-
- // Print out errors
- bool Failed = false;
- bool Transient = false;
- for (pkgAcquire::Item **I = Fetcher.ItemsBegin(); I != Fetcher.ItemsEnd(); I++)
+ while (1)
{
- if ((*I)->Status == pkgAcquire::Item::StatDone &&
- (*I)->Complete == true)
- continue;
+ if (_config->FindB("APT::Get::No-Download",false) == false)
+ if( Fetcher.Run() == pkgAcquire::Failed)
+ return false;
- (*I)->Finished();
-
- if ((*I)->Status == pkgAcquire::Item::StatIdle)
+ // Print out errors
+ bool Failed = false;
+ bool Transient = false;
+ for (pkgAcquire::Item **I = Fetcher.ItemsBegin(); I != Fetcher.ItemsEnd(); I++)
{
- Transient = true;
+ if ((*I)->Status == pkgAcquire::Item::StatDone &&
+ (*I)->Complete == true)
+ continue;
+
+ (*I)->Finished();
+
+ if ((*I)->Status == pkgAcquire::Item::StatIdle)
+ {
+ Transient = true;
+ // Failed = true;
+ continue;
+ }
+
+ cerr << "Failed to fetch " << (*I)->DescURI() << endl;
+ cerr << " " << (*I)->ErrorText << endl;
Failed = true;
- continue;
}
- cerr << "Failed to fetch " << (*I)->DescURI() << endl;
- cerr << " " << (*I)->ErrorText << endl;
- Failed = true;
- }
-
- if (_config->FindB("APT::Get::Download-Only",false) == true)
- {
+ if (_config->FindB("APT::Get::Download-Only",false) == true)
+ {
+ if (Failed == true && _config->FindB("APT::Get::Fix-Missing",false) == false)
+ return _error->Error("Some files failed to download");
+ return true;
+ }
+
if (Failed == true && _config->FindB("APT::Get::Fix-Missing",false) == false)
- return _error->Error("Some files failed to download");
- return true;
- }
-
- if (Failed == true && _config->FindB("APT::Get::Fix-Missing",false) == false)
- {
- if (Transient == true)
{
- c2out << "Upgrading with disk swapping is not supported in this version." << endl;
- c2out << "Try running multiple times with --fix-missing" << endl;
+ /*if (Transient == true)
+ {
+ c2out << "Upgrading with disk swapping is not supported in this version." << endl;
+ c2out << "Try running multiple times with --fix-missing" << endl;
+ }*/
+
+ return _error->Error("Unable to fetch some archives, maybe try with --fix-missing?");
}
- return _error->Error("Unable to fetch some archives, maybe try with --fix-missing?");
- }
-
- // Try to deal with missing package files
- if (PM.FixMissing() == false)
- {
- cerr << "Unable to correct missing packages." << endl;
- return _error->Error("Aborting Install.");
- }
-
- Cache.ReleaseLock();
- return PM.DoInstall();
+ if (Transient == true && Failed == true)
+ return _error->Error("--fix-missing and media swapping is not currently supported");
+
+ // Try to deal with missing package files
+ if (Failed == true && PM.FixMissing() == false)
+ {
+ cerr << "Unable to correct missing packages." << endl;
+ return _error->Error("Aborting Install.");
+ }
+
+ Cache.ReleaseLock();
+ pkgPackageManager::OrderResult Res = PM.DoInstall();
+ if (Res == pkgPackageManager::Failed || _error->PendingError() == true)
+ return false;
+ if (Res == pkgPackageManager::Completed)
+ return true;
+
+ // Reload the fetcher object and loop again for media swapping
+ Fetcher.Shutdown();
+ if (PM.GetArchives(&Fetcher,&List,&Recs) == false)
+ return false;
+ }
}
/*}}}*/