Commit 0329b6ee authored by Lorenzo "Palinuro" Faletra's avatar Lorenzo "Palinuro" Faletra Committed by Lorenzo "Palinuro" Faletra

Import Debian version 2.1.7+parrot1

apt (2.1.7+parrot1) rolling-testing; urgency=medium

  * Import new Debian version.
  * Re-enable https-to-http redirects.

apt (2.1.7) unstable; urgency=medium

  [ David Kalnischkies ]
  * Do not hardcode (wrong) group and mode in setup warning (Closes: #962310)
  * Do not sent our filename-provides trick to EDSP solvers (Closes: #962741)
  * Tell EDSP solvers about all installed pkgs ignoring arch
  * Deduplicate EDSP Provides line of M-A:foreign packages
  * Delay removals due to Conflicts until Depends are resolved
  * Filter out impossible solutions for protected propagation
  * Add dependency points in the resolver also to providers
  * Reorder config check before checking systemd for non-interactive http
  * Reorder config check before result looping for SRV parsing debug
  * Fix test due to display change in ls (coreutils 8.32)
  * Detect pkg-config-dpkghook failure in tests to avoid fallback (Closes: #964475)

  [ Américo Monteiro ]
  * Portuguese manpages translation update (Closes: #962483)

  [ Julian Andres Klode ]
  * Replace some magic 64*1024 with APT_BUFFER_SIZE
  * Add basic support for the Protected field

  [ Sergio Oller Moreno ]
  * Minor Catalan grammar typo

  [ Frans Spiesschaert ]
  * Dutch program translation update (Closes: #963008)

apt (2.1.6) unstable; urgency=medium

  [ David Kalnischkies ]
  * Fix small memory leak in MethodConfig
  * Consider protected packages for removal if they are marked as such
  * Consider if a fix is successful before claiming it is
  * Allow 20 instead of 10 loops for pkgProblemResolver
  * Deal with duplicates in the solution space of a dep

apt (2.1.5) unstable; urgency=medium

  [ David Kalnischkies ]
  * Reset candidate version explicitly for internal state-keeping
    (Closes: #961266)
  * Known-bad candidate versions are not an upgrade option
  * Keep status number if candidate is discarded for kept back display
  * Allow pkgDepCache to be asked to check internal consistency
  * Don't update candidate provides map if the same as current
  * Ensure EDSP doesn't use a dangling architecture string
  * Allow FMV SSE4.2 detection to succeed on clang
  * Mark PatternTreeParser::Node destructor as virtual

  [ Frans Spiesschaert ]
  * Dutch manpages translation update (Closes: #961431)

apt (2.1.4) unstable; urgency=medium

  [ David Kalnischkies ]
  * Check satisfiability for versioned provides, not providing version

apt (2.1.3) unstable; urgency=medium

  [ David Kalnischkies ]
  * Prefer use of O_TMPFILE in GetTempFile if available
  * Allow prefix to be a complete filename for GetTempFile
  * Properly handle interrupted write() call in ExtractTar
  * Skip reading data from tar members if nobody will look at it
  * Keep going if a dep is bad for user requests to improve errors
  * Support negative dependencies in VCI::FromDependency
  * Deal with protected solution providers first
  * Propagate protected to already satisfied conflicts (Closes: #960705)
  * Propagate protected to already satisfied dependencies
  * Recognize propagated protected in pkgProblemResolver

  [ Julian Andres Klode ]
  * private-search: Only use V.TranslatedDescription() if good (LP: #1877987)

apt (2.1.2) unstable; urgency=critical

  [ Julian Andres Klode ]
  * SECURITY UPDATE: Out of bounds read in ar, tar implementations (LP: #1878177)
    - apt-pkg/contrib/arfile.cc: Fix out-of-bounds read in member name
    - apt-pkg/contrib/arfile.cc: Fix out-of-bounds read on unterminated
      member names in error path
    - apt-pkg/contrib/extracttar.cc: Fix out-of-bounds read on unterminated
      member names in error path
    - CVE-2020-3810

  [ Frans Spiesschaert ]
  * Dutch program translation update (Closes: #960186)
parent e725fd69
Pipeline #648 failed with stages
......@@ -25,11 +25,12 @@
# SOFTWARE.
include(CheckCXXSourceCompiles)
function(check_cxx_target var target code)
check_cxx_source_compiles(
"
__attribute__((target(\"${target}\"))) static int foo() { ${code} return 1; }
__attribute__((target(\"default\"))) static int foo() { ${code} return 0; }
int main() { return foo(); }
__attribute__((target(\"${target}\"))) static int foo(int i) { return ${code}; }
__attribute__((target(\"default\"))) static int foo(int i) { return i; }
int main(int i, char **) { return foo(i); }
" ${var})
endfunction()
......@@ -2,6 +2,9 @@
/* Internationalization macros for apt. This header should be included last
in each C file. */
#ifndef APT_I18N_H
#define APT_I18N_H
// Set by autoconf
#cmakedefine USE_NLS
......@@ -19,11 +22,13 @@
# define N_(x) x
#else
// apt will not use any gettext
# define setlocale(a, b)
# define textdomain(a)
# define bindtextdomain(a, b)
extern "C" inline char* setlocale(int, const char*) throw() { return nullptr; }
extern "C" inline char* textdomain(const char*) throw() { return nullptr; }
extern "C" inline char* bindtextdomain(const char*, const char*) throw() { return nullptr; }
extern "C" inline char* dgettext(const char*, const char* msg) throw() { return const_cast<char*>(msg); }
# define _(x) x
# define P_(msg,plural,n) (n == 1 ? msg : plural)
# define N_(x) x
# define dgettext(d, m) m
#endif
#endif
......@@ -198,13 +198,13 @@ endif()
# Check multiversioning
include(CheckCxxTarget)
check_cxx_target(HAVE_FMV_SSE42_AND_CRC32 "sse4.2" "__builtin_ia32_crc32si(0, 1llu);")
check_cxx_target(HAVE_FMV_SSE42_AND_CRC32DI "sse4.2" "__builtin_ia32_crc32di(0, 1llu);")
check_cxx_target(HAVE_FMV_SSE42_AND_CRC32 "sse4.2" "__builtin_ia32_crc32si(0,i)|__builtin_ia32_crc32hi(0,i)|__builtin_ia32_crc32qi(0,i)")
check_cxx_target(HAVE_FMV_SSE42_AND_CRC32DI "sse4.2" "__builtin_ia32_crc32di(0,i)")
# Configure some variables like package, version and architecture.
set(PACKAGE ${PROJECT_NAME})
set(PACKAGE_MAIL "APT Development Team <deity@lists.debian.org>")
set(PACKAGE_VERSION "2.1.1")
set(PACKAGE_VERSION "2.1.7")
string(REGEX MATCH "^[0-9.]+" PROJECT_VERSION ${PACKAGE_VERSION})
if (NOT DEFINED DPKG_DATADIR)
......
......@@ -105,18 +105,18 @@ static bool SetupAPTPartialDirectory(std::string const &grand, std::string const
{
// chown the partial dir
if(chown(partial.c_str(), pw->pw_uid, gr->gr_gid) != 0)
_error->WarningE("SetupAPTPartialDirectory", "chown to %s:root of directory %s failed", SandboxUser.c_str(), partial.c_str());
_error->WarningE("SetupAPTPartialDirectory", "chown to %s:%s of directory %s failed", SandboxUser.c_str(), ROOT_GROUP, partial.c_str());
}
}
if (chmod(partial.c_str(), mode) != 0)
_error->WarningE("SetupAPTPartialDirectory", "chmod 0700 of directory %s failed", partial.c_str());
_error->WarningE("SetupAPTPartialDirectory", "chmod 0%03o of directory %s failed", mode, partial.c_str());
}
else if (chmod(partial.c_str(), mode) != 0)
{
// if we haven't created the dir and aren't root, it is kinda expected that chmod doesn't work
if (partialExists == false)
_error->WarningE("SetupAPTPartialDirectory", "chmod 0700 of directory %s failed", partial.c_str());
_error->WarningE("SetupAPTPartialDirectory", "chmod 0%03o of directory %s failed", mode, partial.c_str());
}
_error->PushToStack();
......@@ -1474,5 +1474,5 @@ pkgAcquire::UriIterator::UriIterator(pkgAcquire::Queue *Q) : d(NULL), CurQ(Q), C
}
pkgAcquire::UriIterator::~UriIterator() {}
pkgAcquire::MethodConfig::~MethodConfig() {}
pkgAcquire::MethodConfig::~MethodConfig() { delete d; }
pkgAcquireStatus::~pkgAcquireStatus() {}
......@@ -58,6 +58,8 @@ pkgSimulate::pkgSimulate(pkgDepCache *Cache) : pkgPackageManager(Cache),
string Jnk = "SIMULATE";
for (decltype(PackageCount) I = 0; I != PackageCount; ++I)
FileNames[I] = Jnk;
Cache->CheckConsistency("simulate");
}
/*}}}*/
// Simulate::~Simulate - Destructor /*{{{*/
......@@ -515,18 +517,37 @@ void pkgProblemResolver::MakeScores()
Score += PrioInstalledAndNotObsolete;
// propagate score points along dependencies
for (pkgCache::DepIterator D = InstVer.DependsList(); D.end() == false; ++D)
for (pkgCache::DepIterator D = InstVer.DependsList(); not D.end(); ++D)
{
if (DepMap[D->Type] == 0)
continue;
pkgCache::PkgIterator const T = D.TargetPkg();
if (D->Version != 0)
if (not D.IsIgnorable(T))
{
if (D->Version != 0)
{
pkgCache::VerIterator const IV = Cache[T].InstVerIter(Cache);
if (IV.end() || not D.IsSatisfied(IV))
continue;
}
Scores[T->ID] += DepMap[D->Type];
}
std::vector<map_id_t> providers;
for (auto Prv = T.ProvidesList(); not Prv.end(); ++Prv)
{
pkgCache::VerIterator const IV = Cache[T].InstVerIter(Cache);
if (IV.end() == true || D.IsSatisfied(IV) == false)
if (D.IsIgnorable(Prv))
continue;
auto const PV = Prv.OwnerVer();
auto const PP = PV.ParentPkg();
if (PV != Cache[PP].InstVerIter(Cache) || not D.IsSatisfied(Prv))
continue;
providers.push_back(PP->ID);
}
Scores[T->ID] += DepMap[D->Type];
std::sort(providers.begin(), providers.end());
providers.erase(std::unique(providers.begin(), providers.end()), providers.end());
for (auto const prv : providers)
Scores[prv] += DepMap[D->Type];
}
}
......@@ -562,13 +583,25 @@ void pkgProblemResolver::MakeScores()
provide important packages extremely important */
for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; ++I)
{
for (pkgCache::PrvIterator P = I.ProvidesList(); P.end() == false; ++P)
auto const transfer = abs(Scores[I->ID] - OldScores[I->ID]);
if (transfer == 0)
continue;
std::vector<map_id_t> providers;
for (auto Prv = I.ProvidesList(); not Prv.end(); ++Prv)
{
// Only do it once per package
if ((pkgCache::Version *)P.OwnerVer() != Cache[P.OwnerPkg()].InstallVer)
if (Prv.IsMultiArchImplicit())
continue;
auto const PV = Prv.OwnerVer();
auto const PP = PV.ParentPkg();
if (PV != Cache[PP].InstVerIter(Cache))
continue;
Scores[P.OwnerPkg()->ID] += abs(Scores[I->ID] - OldScores[I->ID]);
providers.push_back(PP->ID);
}
std::sort(providers.begin(), providers.end());
providers.erase(std::unique(providers.begin(), providers.end()), providers.end());
for (auto const prv : providers)
Scores[prv] += transfer;
}
/* Protected things are pushed really high up. This number should put them
......@@ -599,7 +632,8 @@ bool pkgProblemResolver::DoUpgrade(pkgCache::PkgIterator Pkg)
Flags[Pkg->ID] &= ~Upgradable;
bool WasKept = Cache[Pkg].Keep();
Cache.MarkInstall(Pkg, false, 0, false);
if (not Cache.MarkInstall(Pkg, false, 0, false))
return false;
// This must be a virtual package or something like that.
if (Cache[Pkg].InstVerIter(Cache).end() == true)
......@@ -633,7 +667,7 @@ bool pkgProblemResolver::DoUpgrade(pkgCache::PkgIterator Pkg)
// Do not change protected packages
PkgIterator P = Start.SmartTargetPkg();
if ((Flags[P->ID] & Protected) == Protected)
if (Cache[P].Protect())
{
if (Debug == true)
clog << " Reinst Failed because of protected " << P.FullName(false) << endl;
......@@ -720,6 +754,9 @@ bool pkgProblemResolver::ResolveInternal(bool const BrokenFix)
{
pkgDepCache::ActionGroup group(Cache);
if (Debug)
Cache.CheckConsistency("resolve start");
// Record which packages are marked for install
bool Again = false;
do
......@@ -787,8 +824,9 @@ bool pkgProblemResolver::ResolveInternal(bool const BrokenFix)
changing a breaks c) */
bool Change = true;
bool const TryFixByInstall = _config->FindB("pkgProblemResolver::FixByInstall", true);
int const MaxCounter = _config->FindI("pkgProblemResolver::MaxCounter", 20);
std::vector<PackageKill> KillList;
for (int Counter = 0; Counter != 10 && Change == true; Counter++)
for (int Counter = 0; Counter < MaxCounter && Change; ++Counter)
{
Change = false;
for (pkgCache::Package **K = PList.get(); K != PEnd; K++)
......@@ -800,7 +838,7 @@ bool pkgProblemResolver::ResolveInternal(bool const BrokenFix)
if (Cache[I].CandidateVer != Cache[I].InstallVer &&
I->CurrentVer != 0 && Cache[I].InstallVer != 0 &&
(Flags[I->ID] & PreInstalled) != 0 &&
(Flags[I->ID] & Protected) == 0 &&
not Cache[I].Protect() &&
(Flags[I->ID] & ReInstateTried) == 0)
{
if (Debug == true)
......@@ -835,7 +873,7 @@ bool pkgProblemResolver::ResolveInternal(bool const BrokenFix)
pkgCache::DepIterator End;
size_t OldSize = 0;
KillList.resize(0);
KillList.clear();
enum {OrRemove,OrKeep} OrOp = OrRemove;
for (pkgCache::DepIterator D = Cache[I].InstVerIter(Cache).DependsList();
......@@ -849,7 +887,7 @@ bool pkgProblemResolver::ResolveInternal(bool const BrokenFix)
{
if (OrOp == OrRemove)
{
if ((Flags[I->ID] & Protected) != Protected)
if (not Cache[I].Protect())
{
if (Debug == true)
clog << " Or group remove for " << I.FullName(false) << endl;
......@@ -903,7 +941,7 @@ bool pkgProblemResolver::ResolveInternal(bool const BrokenFix)
targets then we keep the package and bail. This is necessary
if a package has a dep on another package that can't be found */
std::unique_ptr<pkgCache::Version *[]> VList(Start.AllTargets());
if (VList[0] == 0 && (Flags[I->ID] & Protected) != Protected &&
if (VList[0] == 0 && not Cache[I].Protect() &&
Start.IsNegative() == false &&
Cache[I].NowBroken() == false)
{
......@@ -950,7 +988,7 @@ bool pkgProblemResolver::ResolveInternal(bool const BrokenFix)
End.IsNegative() == false))
{
// Try a little harder to fix protected packages..
if ((Flags[I->ID] & Protected) == Protected)
if (Cache[I].Protect())
{
if (DoUpgrade(Pkg) == true)
{
......@@ -1037,7 +1075,7 @@ bool pkgProblemResolver::ResolveInternal(bool const BrokenFix)
}
// Skip adding to the kill list if it is protected
if ((Flags[Pkg->ID] & Protected) != 0)
if (Cache[Pkg].Protect() && Cache[Pkg].Mode != pkgDepCache::ModeDelete)
continue;
if (Debug == true)
......@@ -1053,7 +1091,7 @@ bool pkgProblemResolver::ResolveInternal(bool const BrokenFix)
// Hm, nothing can possibly satisfy this dep. Nuke it.
if (VList[0] == 0 &&
Start.IsNegative() == false &&
(Flags[I->ID] & Protected) != Protected)
not Cache[I].Protect())
{
bool Installed = Cache[I].Install();
Cache.MarkKeep(I);
......@@ -1093,33 +1131,38 @@ bool pkgProblemResolver::ResolveInternal(bool const BrokenFix)
// Apply the kill list now
if (Cache[I].InstallVer != 0)
{
for (auto J = KillList.begin(); J != KillList.end(); J++)
for (auto const &J : KillList)
{
Change = true;
if ((Cache[J->Dep] & pkgDepCache::DepGNow) == 0)
bool foundSomething = false;
if ((Cache[J.Dep] & pkgDepCache::DepGNow) == 0)
{
if (J->Dep.IsNegative() == true)
if (J.Dep.IsNegative() && Cache.MarkDelete(J.Pkg, false, 0, false))
{
if (Debug == true)
clog << " Fixing " << I.FullName(false) << " via remove of " << J->Pkg.FullName(false) << endl;
Cache.MarkDelete(J->Pkg, false, 0, false);
if (Debug)
std::clog << " Fixing " << I.FullName(false) << " via remove of " << J.Pkg.FullName(false) << '\n';
foundSomething = true;
}
}
else
else if (Cache.MarkKeep(J.Pkg, false, false))
{
if (Debug == true)
clog << " Fixing " << I.FullName(false) << " via keep of " << J->Pkg.FullName(false) << endl;
Cache.MarkKeep(J->Pkg, false, false);
if (Debug)
std::clog << " Fixing " << I.FullName(false) << " via keep of " << J.Pkg.FullName(false) << '\n';
foundSomething = true;
}
if (Counter > 1)
if (not foundSomething || Counter > 1)
{
if (Scores[I->ID] > Scores[J->Pkg->ID])
Scores[J->Pkg->ID] = Scores[I->ID];
}
}
if (Scores[I->ID] > Scores[J.Pkg->ID])
{
Scores[J.Pkg->ID] = Scores[I->ID];
Change = true;
}
}
if (foundSomething)
Change = true;
}
}
}
}
}
if (Debug == true)
......@@ -1133,7 +1176,7 @@ bool pkgProblemResolver::ResolveInternal(bool const BrokenFix)
{
if (Cache[I].InstBroken() == false)
continue;
if ((Flags[I->ID] & Protected) != Protected)
if (not Cache[I].Protect())
return _error->Error(_("Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages."));
}
return _error->Error(_("Unable to correct problems, you have held broken packages."));
......@@ -1151,6 +1194,8 @@ bool pkgProblemResolver::ResolveInternal(bool const BrokenFix)
}
}
if (Debug)
Cache.CheckConsistency("resolve done");
return true;
}
......@@ -1210,6 +1255,9 @@ bool pkgProblemResolver::ResolveByKeepInternal()
{
pkgDepCache::ActionGroup group(Cache);
if (Debug)
Cache.CheckConsistency("keep start");
MakeScores();
/* We have to order the packages so that the broken fixing pass
......@@ -1253,7 +1301,7 @@ bool pkgProblemResolver::ResolveByKeepInternal()
/* Keep the package. If this works then great, otherwise we have
to be significantly more aggressive and manipulate its dependencies */
if ((Flags[I->ID] & Protected) == 0)
if (not Cache[I].Protect())
{
if (Debug == true)
clog << "Keeping package " << I.FullName(false) << endl;
......@@ -1301,7 +1349,7 @@ bool pkgProblemResolver::ResolveByKeepInternal()
Pkg->CurrentVer == 0)
continue;
if ((Flags[I->ID] & Protected) == 0)
if (not Cache[I].Protect())
{
if (Debug == true)
clog << " Keeping Package " << Pkg.FullName(false) << " due to " << Start.DepType() << endl;
......@@ -1340,6 +1388,10 @@ bool pkgProblemResolver::ResolveByKeepInternal()
}
delete[] PList;
if (Debug)
Cache.CheckConsistency("keep done");
return true;
}
/*}}}*/
......
......@@ -48,6 +48,7 @@ struct APT_PUBLIC PatternTreeParser
virtual std::ostream &render(std::ostream &os) { return os; };
std::nullptr_t error(std::string message);
virtual ~Node() = default;
};
struct Error : public std::exception
......
......@@ -583,74 +583,54 @@ bool VersionContainerInterface::FromDependency(VersionContainerInterface * const
CacheSetHelper &helper)
{
bool found = false;
switch(selector) {
case CacheSetHelper::ALL:
{
pkgCache::PkgIterator const T = D.TargetPkg();
for (pkgCache::VerIterator Ver = T.VersionList(); Ver.end() == false; ++Ver)
auto const insertVersion = [&](pkgCache::PkgIterator const &TP, pkgCache::VerIterator const &TV) {
if (not TV.end() && not D.IsIgnorable(TP) && D.IsSatisfied(TV))
{
if (D.IsSatisfied(Ver) == true)
{
vci->insert(Ver);
found = true;
}
for (pkgCache::PrvIterator Prv = T.ProvidesList(); Prv.end() != true; ++Prv)
vci->insert(TV);
found = true;
}
};
pkgCache::PkgIterator const T = D.TargetPkg();
auto const insertAllTargetVersions = [&](auto const &getTargetVersion) {
insertVersion(T, getTargetVersion(T));
for (auto Prv = T.ProvidesList(); not Prv.end(); ++Prv)
{
if (D.IsIgnorable(Prv))
continue;
auto const OP = Prv.OwnerPkg();
auto const TV = getTargetVersion(OP);
if (Prv.OwnerVer() == TV && D.IsSatisfied(Prv))
{
pkgCache::VerIterator const V = Prv.OwnerVer();
if (unlikely(V.end() == true) || D.IsSatisfied(Prv) == false)
continue;
vci->insert(V);
vci->insert(TV);
found = true;
}
}
return found;
}
};
switch(selector) {
case CacheSetHelper::ALL:
for (auto Ver = T.VersionList(); not Ver.end(); ++Ver)
{
insertVersion(T, Ver);
for (pkgCache::PrvIterator Prv = T.ProvidesList(); not Prv.end(); ++Prv)
if (not D.IsIgnorable(Prv))
{
vci->insert(Prv.OwnerVer());
found = true;
}
}
return found;
case CacheSetHelper::CANDANDINST:
{
found = FromDependency(vci, Cache, D, CacheSetHelper::CANDIDATE, helper);
found &= FromDependency(vci, Cache, D, CacheSetHelper::INSTALLED, helper);
return found;
}
case CacheSetHelper::CANDIDATE:
{
pkgCache::PkgIterator const T = D.TargetPkg();
pkgCache::VerIterator const Cand = Cache[T].CandidateVerIter(Cache);
if (Cand.end() == false && D.IsSatisfied(Cand) == true)
{
vci->insert(Cand);
found = true;
}
for (pkgCache::PrvIterator Prv = T.ProvidesList(); Prv.end() != true; ++Prv)
{
pkgCache::VerIterator const V = Prv.OwnerVer();
pkgCache::VerIterator const Cand = Cache[Prv.OwnerPkg()].CandidateVerIter(Cache);
if (Cand.end() == true || V != Cand || D.IsSatisfied(Prv) == false)
continue;
vci->insert(Cand);
found = true;
}
return found;
}
// skip looking if we have already cached that we will find nothing
if (((Cache[D] & pkgDepCache::DepCVer) == 0) != D.IsNegative())
return found;
return insertAllTargetVersions([&](pkgCache::PkgIterator const &OP) { return Cache[OP].CandidateVerIter(Cache); });
case CacheSetHelper::INSTALLED:
{
pkgCache::PkgIterator const T = D.TargetPkg();
pkgCache::VerIterator const Cand = T.CurrentVer();
if (Cand.end() == false && D.IsSatisfied(Cand) == true)
{
vci->insert(Cand);
found = true;
}
for (pkgCache::PrvIterator Prv = T.ProvidesList(); Prv.end() != true; ++Prv)
{
pkgCache::VerIterator const V = Prv.OwnerVer();
pkgCache::VerIterator const Cand = Prv.OwnerPkg().CurrentVer();
if (Cand.end() == true || V != Cand || D.IsSatisfied(Prv) == false)
continue;
vci->insert(Cand);
found = true;
}
return found;
}
return insertAllTargetVersions([&](pkgCache::PkgIterator const &OP) { return OP.CurrentVer(); });
case CacheSetHelper::CANDINST:
return FromDependency(vci, Cache, D, CacheSetHelper::CANDIDATE, helper) ||
FromDependency(vci, Cache, D, CacheSetHelper::INSTALLED, helper);
......@@ -658,25 +638,7 @@ bool VersionContainerInterface::FromDependency(VersionContainerInterface * const
return FromDependency(vci, Cache, D, CacheSetHelper::INSTALLED, helper) ||
FromDependency(vci, Cache, D, CacheSetHelper::CANDIDATE, helper);
case CacheSetHelper::NEWEST:
{
pkgCache::PkgIterator const T = D.TargetPkg();
pkgCache::VerIterator const Cand = T.VersionList();
if (Cand.end() == false && D.IsSatisfied(Cand) == true)
{
vci->insert(Cand);
found = true;
}
for (pkgCache::PrvIterator Prv = T.ProvidesList(); Prv.end() != true; ++Prv)
{
pkgCache::VerIterator const V = Prv.OwnerVer();
pkgCache::VerIterator const Cand = Prv.OwnerPkg().VersionList();
if (Cand.end() == true || V != Cand || D.IsSatisfied(Prv) == false)
continue;
vci->insert(Cand);
found = true;
}
return found;
}
return insertAllTargetVersions([&](pkgCache::PkgIterator const &OP) { return OP.VersionList(); });
case CacheSetHelper::RELEASE:
case CacheSetHelper::VERSIONNUMBER:
// both make no sense here, so always false
......
......@@ -92,7 +92,7 @@ bool ARArchive::LoadHeaders()
StrToNum(Head.Size,Memb->Size,sizeof(Head.Size)) == false)
{
delete Memb;
return _error->Error(_("Invalid archive member header %s"), Head.Name);
return _error->Error(_("Invalid archive member header"));
}
// Check for an extra long name string
......@@ -119,7 +119,14 @@ bool ARArchive::LoadHeaders()
else
{
unsigned int I = sizeof(Head.Name) - 1;
for (; Head.Name[I] == ' ' || Head.Name[I] == '/'; I--);
for (; Head.Name[I] == ' ' || Head.Name[I] == '/'; I--)
{
if (I == 0)
{
delete Memb;
return _error->Error(_("Invalid archive member header"));
}
}
Memb->Name = std::string(Head.Name,I+1);
}
......