summaryrefslogtreecommitdiff
path: root/apt-pkg
diff options
context:
space:
mode:
Diffstat (limited to 'apt-pkg')
-rw-r--r--apt-pkg/deb/dpkgpm.cc1
-rw-r--r--apt-pkg/packagemanager.cc5
-rw-r--r--apt-pkg/policy.cc14
3 files changed, 20 insertions, 0 deletions
diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc
index 9ba60060c..c0efa7b59 100644
--- a/apt-pkg/deb/dpkgpm.cc
+++ b/apt-pkg/deb/dpkgpm.cc
@@ -950,6 +950,7 @@ bool pkgDPkgPM::Go(int OutStatusFd)
rtt = tt;
cfmakeraw(&rtt);
rtt.c_lflag &= ~ECHO;
+ rtt.c_lflag |= ISIG;
// block SIGTTOU during tcsetattr to prevent a hang if
// the process is a member of the background process group
// http://www.opengroup.org/onlinepubs/000095399/functions/tcsetattr.html
diff --git a/apt-pkg/packagemanager.cc b/apt-pkg/packagemanager.cc
index 35cc24550..034cc8339 100644
--- a/apt-pkg/packagemanager.cc
+++ b/apt-pkg/packagemanager.cc
@@ -345,6 +345,9 @@ bool pkgPackageManager::DepAdd(pkgOrderList &OList,PkgIterator Pkg,int Depth)
return true;
if (List->IsFlag(Pkg,pkgOrderList::UnPacked) == false)
return false;
+
+ if (Debug)
+ std::clog << OutputInDepth(Depth) << "DepAdd: " << Pkg.Name() << std::endl;
// Put the package on the list
OList.push_back(Pkg);
@@ -398,6 +401,8 @@ bool pkgPackageManager::DepAdd(pkgOrderList &OList,PkgIterator Pkg,int Depth)
if (Bad == true)
{
+ if (Debug)
+ std::clog << OutputInDepth(Depth) << "DepAdd FAILS on: " << Pkg.Name() << std::endl;
OList.Flag(Pkg,0,pkgOrderList::Added);
OList.pop_back();
Depth--;
diff --git a/apt-pkg/policy.cc b/apt-pkg/policy.cc
index 0b8c1a81b..9b24c2ef1 100644
--- a/apt-pkg/policy.cc
+++ b/apt-pkg/policy.cc
@@ -121,6 +121,10 @@ pkgCache::VerIterator pkgPolicy::GetCandidateVer(pkgCache::PkgIterator Pkg)
signed Max = GetPriority(Pkg);
pkgCache::VerIterator Pref = GetMatch(Pkg);
+ // Alternatives in case we can not find our package pin (Bug#512318).
+ signed MaxAlt = 0;
+ pkgCache::VerIterator PrefAlt;
+
// no package = no candidate version
if (Pkg.end() == true)
return Pref;
@@ -159,6 +163,11 @@ pkgCache::VerIterator pkgPolicy::GetCandidateVer(pkgCache::PkgIterator Pkg)
{
Pref = Ver;
Max = Prio;
+ }
+ if (Prio > MaxAlt)
+ {
+ PrefAlt = Ver;
+ MaxAlt = Prio;
}
}
@@ -175,6 +184,11 @@ pkgCache::VerIterator pkgPolicy::GetCandidateVer(pkgCache::PkgIterator Pkg)
break;
}
}
+ // If we do not find our candidate, use the one with the highest pin.
+ // This means that if there is a version available with pin > 0; there
+ // will always be a candidate (Closes: #512318)
+ if (!Pref.IsGood() && MaxAlt > 0)
+ Pref = PrefAlt;
return Pref;
}
/*}}}*/