summaryrefslogtreecommitdiff
path: root/src/generic
diff options
context:
space:
mode:
Diffstat (limited to 'src/generic')
-rw-r--r--src/generic/apt/download_install_manager.cc12
-rw-r--r--src/generic/apt/download_install_manager.h5
2 files changed, 16 insertions, 1 deletions
diff --git a/src/generic/apt/download_install_manager.cc b/src/generic/apt/download_install_manager.cc
index 7c9aa835..a499faa5 100644
--- a/src/generic/apt/download_install_manager.cc
+++ b/src/generic/apt/download_install_manager.cc
@@ -38,8 +38,11 @@
using namespace std;
download_install_manager::download_install_manager(bool _download_only,
+ bool _fix_missing,
const run_dpkg_in_terminal_func &_run_dpkg_in_terminal)
- : log(NULL), download_only(_download_only),
+ : log(NULL),
+ download_only(_download_only),
+ fix_missing(_fix_missing),
pm(new pkgDPkgPM(*apt_cache_file)),
run_dpkg_in_terminal(_run_dpkg_in_terminal)
{
@@ -139,6 +142,13 @@ download_manager::result download_install_manager::finish_pre_dpkg(pkgAcquire::R
}
}
+ if(failed == true && fix_missing == false)
+ {
+ _error->Error(_("Unable to fetch some archives, maybe run aptitude"
+ " update or try with --fix-missing?"));
+ return failure;
+ }
+
if(failed && !pm->FixMissing())
{
_error->Error(_("Unable to correct for unavailable packages"));
diff --git a/src/generic/apt/download_install_manager.h b/src/generic/apt/download_install_manager.h
index 24989883..069a1a41 100644
--- a/src/generic/apt/download_install_manager.h
+++ b/src/generic/apt/download_install_manager.h
@@ -59,6 +59,10 @@ class download_install_manager : public download_manager
/** If \b true, don't actually invoke the package manager. */
bool download_only;
+ /** If \b true, attempt to correct for packages which fail
+ to download or are unavailable. */
+ bool fix_missing;
+
/** The package manager object used when installing packages */
pkgPackageManager *pm;
@@ -112,6 +116,7 @@ public:
* \param _run_dpkg_in_terminal how to set up the terminal for dpkg.
*/
download_install_manager(bool _download_only,
+ bool _fix_missing,
const run_dpkg_in_terminal_func &_run_dpkg_in_terminal);
~download_install_manager();