summaryrefslogtreecommitdiff
path: root/cmdline
diff options
context:
space:
mode:
Diffstat (limited to 'cmdline')
-rw-r--r--cmdline/apt-get.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc
index 03239dabe..00da0855f 100644
--- a/cmdline/apt-get.cc
+++ b/cmdline/apt-get.cc
@@ -1936,9 +1936,10 @@ bool DoInstall(CommandLine &CmdL)
{
/* Skip if package is installed already, or is about to be */
string target = Start.TargetPkg().FullName(true) + " ";
-
- if ((*Start.TargetPkg()).SelectedState == pkgCache::State::Install
- || Cache[Start.TargetPkg()].Install())
+ pkgCache::PkgIterator const TarPkg = Start.TargetPkg();
+ if (TarPkg->SelectedState == pkgCache::State::Install ||
+ TarPkg->SelectedState == pkgCache::State::Hold ||
+ Cache[Start.TargetPkg()].Install())
{
foundInstalledInOrGroup=true;
break;
@@ -2424,6 +2425,7 @@ bool DoSource(CommandLine &CmdL)
if (Process == 0)
{
+ bool const fixBroken = _config->FindB("APT::Get::Fix-Broken", false);
for (unsigned I = 0; I != J; I++)
{
string Dir = Dsc[I].Package + '-' + Cache->VS().UpstreamVersion(Dsc[I].Version.c_str());
@@ -2436,7 +2438,7 @@ bool DoSource(CommandLine &CmdL)
// See if the package is already unpacked
struct stat Stat;
- if (stat(Dir.c_str(),&Stat) == 0 &&
+ if (fixBroken == false && stat(Dir.c_str(),&Stat) == 0 &&
S_ISDIR(Stat.st_mode) != 0)
{
ioprintf(c0out ,_("Skipping unpack of already unpacked source in %s\n"),