summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArch Librarian <arch@canonical.com>2004-09-20 16:55:19 +0000
committerArch Librarian <arch@canonical.com>2004-09-20 16:55:19 +0000
commita3eaf9544039a9adfef159e8185f376f19b15c68 (patch)
treec3753b4f9bf79ea651a46882740a88dbd842705b
parentf93d1355dd915fd5c197293ba0e62292ec15cb2d (diff)
Fixed --no-download
Author: jgg Date: 1999-12-09 05:22:33 GMT Fixed --no-download
-rw-r--r--apt-pkg/acquire.cc4
-rw-r--r--apt-pkg/packagemanager.cc4
-rw-r--r--cmdline/apt-get.cc46
-rw-r--r--debian/changelog6
-rw-r--r--doc/apt-get.8.yo10
5 files changed, 53 insertions, 17 deletions
diff --git a/apt-pkg/acquire.cc b/apt-pkg/acquire.cc
index a7b28499a..a9a8b3396 100644
--- a/apt-pkg/acquire.cc
+++ b/apt-pkg/acquire.cc
@@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: acquire.cc,v 1.43 1999/10/27 22:34:29 jgg Exp $
+// $Id: acquire.cc,v 1.44 1999/12/09 05:22:33 jgg Exp $
/* ######################################################################
Acquire - File Acquiration
@@ -105,6 +105,8 @@ void pkgAcquire::Add(Item *Itm)
/* Remove an item from the acquire list. This is usually not used.. */
void pkgAcquire::Remove(Item *Itm)
{
+ Dequeue(Itm);
+
for (vector<Item *>::iterator I = Items.begin(); I < Items.end(); I++)
{
if (*I == Itm)
diff --git a/apt-pkg/packagemanager.cc b/apt-pkg/packagemanager.cc
index fad40c46a..392931042 100644
--- a/apt-pkg/packagemanager.cc
+++ b/apt-pkg/packagemanager.cc
@@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: packagemanager.cc,v 1.22 1999/10/22 05:58:54 jgg Exp $
+// $Id: packagemanager.cc,v 1.23 1999/12/09 05:22:33 jgg Exp $
/* ######################################################################
Package Manager - Abstacts the package manager
@@ -547,7 +547,7 @@ pkgPackageManager::OrderResult pkgPackageManager::OrderInstall()
if (List->IsMissing(Pkg) == true)
{
if (Debug == true)
- clog << "Sequence completed at" << Pkg.Name() << endl;
+ clog << "Sequence completed at " << Pkg.Name() << endl;
if (DoneSomething == false)
{
_error->Error("Internal Error, ordering was unable to handle the media swap");
diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc
index 4933e38a7..88b4ffc2e 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.91 1999/11/28 01:03:28 jgg Exp $
+// $Id: apt-get.cc,v 1.92 1999/12/09 05:22:33 jgg Exp $
/* ######################################################################
apt-get - Cover for dpkg
@@ -516,7 +516,8 @@ bool CacheFile::CheckDeps(bool AllowBroken)
// ---------------------------------------------------------------------
/* This displays the informative messages describing what is going to
happen and then calls the download routines */
-bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask = true,bool Saftey = true)
+bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask = true,
+ bool Saftey = true)
{
if (_config->FindB("APT::Get::Purge",false) == true)
{
@@ -694,13 +695,33 @@ bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask = true,bool Saftey =
// Run it
while (1)
{
- if (_config->FindB("APT::Get::No-Download",false) == false)
- if (Fetcher.Run() == pkgAcquire::Failed)
- return false;
+ bool Transient = false;
+ if (_config->FindB("APT::Get::No-Download",false) == true)
+ {
+ for (pkgAcquire::Item **I = Fetcher.ItemsBegin(); I < Fetcher.ItemsEnd();)
+ {
+ if ((*I)->Local == true)
+ {
+ I++;
+ continue;
+ }
+
+ // Close the item and check if it was found in cache
+ (*I)->Finished();
+ if ((*I)->Complete == false)
+ Transient = true;
+
+ // Clear it out of the fetch list
+ delete *I;
+ I = Fetcher.ItemsBegin();
+ }
+ }
+
+ 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++)
{
if ((*I)->Status == pkgAcquire::Item::StatDone &&
@@ -713,16 +734,16 @@ bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask = true,bool Saftey =
// Failed = true;
continue;
}
-
+
cerr << "Failed to fetch " << (*I)->DescURI() << endl;
cerr << " " << (*I)->ErrorText << endl;
Failed = true;
}
- /* If we are in no download mode and missing files then there were
+ /* If we are in no download mode and missing files and there were
'failures' then the user must specify -m. Furthermore, there
is no such thing as a transient error in no-download mode! */
- if (Transient == true &&
+ if (Transient == true &&
_config->FindB("APT::Get::No-Download",false) == true)
{
Transient = false;
@@ -750,7 +771,7 @@ bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask = true,bool Saftey =
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)
@@ -1513,9 +1534,10 @@ bool DoSource(CommandLine &CmdL)
// Diff only mode only fetches .diff files
if (_config->FindB("APT::Get::Diff-Only",false) == true ||
- _config->FindB("APT::Get::Tar-Only",false) == true)
+ _config->FindB("APT::Get::Tar-Only",false) == true ||
+ Dsc[I].Dsc.empty() == true)
continue;
-
+
// See if the package is already unpacked
struct stat Stat;
if (stat(Dir.c_str(),&Stat) == 0 &&
diff --git a/debian/changelog b/debian/changelog
index 63998b83c..eaf835029 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+apt (0.3.15.1) unstable; urgency=low
+
+ * Made --no-download work.
+
+ -- Jason Gunthorpe <jgg@debian.org> Sat, 4 Dec 1999 21:17:24 -0800
+
apt (0.3.15) unstable; urgency=low
* Added DSelect::WaitAfterDownload Closes: #49549
diff --git a/doc/apt-get.8.yo b/doc/apt-get.8.yo
index 6812e46c7..d46eb9bcb 100644
--- a/doc/apt-get.8.yo
+++ b/doc/apt-get.8.yo
@@ -158,11 +158,15 @@ dit(bf(-m, --ignore-missing, --fix-missing))
Ignore missing packages; If packages cannot be retrieved or fail the
integrity check after retrieval (corrupted package files), hold back
those packages and handle the result. Use of this option together with
--f may produce an error in some situations. Configuration Item: bf(ignore-missing).
+-f may produce an error in some situations. If a package is selected for
+installation (particularly if it is mentioned on the command line) and it
+could not be downloaded then it will be silently held back.
+Configuration Item: bf(APT::Get::ignore-missing).
dit(bf(--no-download))
Disables downloading of packages. This is best used with --ignore-missing to
force APT to use only the .debs it has already downloaded.
+Configuration Item: bf(APT::Get::No-Download).
dit(bf(-q, --quiet))
Quiet; produces output suitable for logging, omitting progress indicators.
@@ -195,6 +199,7 @@ upgraded. Configuration Item: bf(APT::Get::Show-Upgraded).
dit(bf(-b, --compile, --build))
Compile source packages after downloading them.
+Configuration Item: bf(APT::Get::Compile).
dit(bf(--ignore-hold))
Ignore package Holds; This causes bf(apt-get) to ignore a hold placed on
@@ -221,6 +226,7 @@ command. Configuration Item: bf(APT::Get::Print-URIs).
dit(bf(--purge))
Use purge instead of remove for anything that would be removed.
+Configuration Item: bf(APT::Get::Purge).
dit(bf(--reinstall))
Re-Install packages that are already installed and at the newest version.
@@ -241,7 +247,7 @@ dit(bf(--no-remove))
If any packages are to be removed apt-get immediately aborts without
prompting. Configuration Item: bf(APT::Get::No-Remove)
-dit(bf(--diff-only), bd(--tar-only))
+dit(bf(--diff-only), bf(--tar-only))
Download only the diff or tar file of a source archive.
Configuration Item: bf(APT::Get::Diff-Only)