diff options
106 files changed, 2339 insertions, 1412 deletions
diff --git a/CMake/CheckCxxTarget.cmake b/CMake/CheckCxxTarget.cmake index 373c0be4c..17c32bfac 100644 --- a/CMake/CheckCxxTarget.cmake +++ b/CMake/CheckCxxTarget.cmake @@ -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() diff --git a/CMake/Documentation.cmake b/CMake/Documentation.cmake index d8a2d2c9d..1df0960a4 100644 --- a/CMake/Documentation.cmake +++ b/CMake/Documentation.cmake @@ -318,7 +318,7 @@ function(add_update_po4a target pot header) add_custom_target(${target} COMMAND po4a --previous --no-backups --force --no-translations --msgmerge-opt --add-location=file - --porefs noline,wrap + --porefs file --package-name=${PROJECT_NAME}-doc --package-version=${PACKAGE_VERSION} --msgid-bugs-address=${PACKAGE_MAIL} po4a.conf ${WRITE_HEADER} diff --git a/CMake/apti18n.h.in b/CMake/apti18n.h.in index 192979590..de9c84965 100644 --- a/CMake/apti18n.h.in +++ b/CMake/apti18n.h.in @@ -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 diff --git a/CMakeLists.txt b/CMakeLists.txt index 1571089c5..afd74adb5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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.0") +set(PACKAGE_VERSION "2.1.7") string(REGEX MATCH "^[0-9.]+" PROJECT_VERSION ${PACKAGE_VERSION}) if (NOT DEFINED DPKG_DATADIR) diff --git a/apt-pkg/acquire.cc b/apt-pkg/acquire.cc index fffe76f46..1cffc0463 100644 --- a/apt-pkg/acquire.cc +++ b/apt-pkg/acquire.cc @@ -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() {} diff --git a/apt-pkg/algorithms.cc b/apt-pkg/algorithms.cc index f2977b9af..cd09a6944 100644 --- a/apt-pkg/algorithms.cc +++ b/apt-pkg/algorithms.cc @@ -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; } /*}}}*/ diff --git a/apt-pkg/cachefilter-patterns.h b/apt-pkg/cachefilter-patterns.h index 093364ff1..d64bc4ccf 100644 --- a/apt-pkg/cachefilter-patterns.h +++ b/apt-pkg/cachefilter-patterns.h @@ -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 diff --git a/apt-pkg/cacheset.cc b/apt-pkg/cacheset.cc index 3967ba980..565a2b298 100644 --- a/apt-pkg/cacheset.cc +++ b/apt-pkg/cacheset.cc @@ -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 diff --git a/apt-pkg/contrib/arfile.cc b/apt-pkg/contrib/arfile.cc index 3fc3afedb..5cb43c690 100644 --- a/apt-pkg/contrib/arfile.cc +++ b/apt-pkg/contrib/arfile.cc @@ -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); } diff --git a/apt-pkg/contrib/extracttar.cc b/apt-pkg/contrib/extracttar.cc index 9bb0a55c0..1616c9f12 100644 --- a/apt-pkg/contrib/extracttar.cc +++ b/apt-pkg/contrib/extracttar.cc @@ -254,53 +254,53 @@ bool ExtractTar::Go(pkgDirStream &Stream) default: BadRecord = true; - _error->Warning(_("Unknown TAR header type %u, member %s"),(unsigned)Tar->LinkFlag,Tar->Name); + _error->Warning(_("Unknown TAR header type %u"), (unsigned)Tar->LinkFlag); break; } - + int Fd = -1; - if (BadRecord == false) - if (Stream.DoItem(Itm,Fd) == false) + if (not BadRecord && not Stream.DoItem(Itm, Fd)) + return false; + + if (Fd == -1 || Fd < -2 || BadRecord) + { + if (Itm.Size > 0 && not InFd.Skip(((Itm.Size + (sizeof(Block) - 1)) / sizeof(Block)) * sizeof(Block))) return false; - - // Copy the file over the FD - unsigned long long Size = Itm.Size; - while (Size != 0) + } + else if (Itm.Size != 0) { + // Copy the file over the FD + auto Size = Itm.Size; unsigned char Junk[32*1024]; - unsigned long Read = min(Size, (unsigned long long)sizeof(Junk)); - if (InFd.Read(Junk,((Read+511)/512)*512) == false) - return false; - - if (BadRecord == false) + do { + auto const Read = std::min<unsigned long long>(Size, sizeof(Junk)); + if (not InFd.Read(Junk, ((Read + (sizeof(Block) - 1)) / sizeof(Block)) * sizeof(Block))) + return false; + if (Fd > 0) { - if (write(Fd,Junk,Read) != (signed)Read) - return Stream.Fail(Itm,Fd); + if (not FileFd::Write(Fd, Junk, Read)) + return Stream.Fail(Itm, Fd); } - else + // An Fd of -2 means to send to a special processing function + else if (Fd == -2) { - /* An Fd of -2 means to send to a special processing - function */ - if (Fd == -2) - if (Stream.Process(Itm,Junk,Read,Itm.Size - Size) == false) - return Stream.Fail(Itm,Fd); + if (not Stream.Process(Itm, Junk, Read, Itm.Size - Size)) + return Stream.Fail(Itm, Fd); } - } - - Size -= Read; + + Size -= Read; + } while (Size != 0); } - + // And finish up - if (BadRecord == false) - if (Stream.FinishedFile(Itm,Fd) == false) - return false; - + if (not BadRecord && not Stream.FinishedFile(Itm, Fd)) + return false; LastLongName.erase(); LastLongLink.erase(); } - + return Done(); } /*}}}*/ diff --git a/apt-pkg/contrib/fileutl.cc b/apt-pkg/contrib/fileutl.cc index 045dbe17d..e91c1acc3 100644 --- a/apt-pkg/contrib/fileutl.cc +++ b/apt-pkg/contrib/fileutl.cc @@ -3150,30 +3150,49 @@ FileFd* GetTempFile(std::string const &Prefix, bool ImmediateUnlink, FileFd * co } FileFd* GetTempFile(std::string const &Prefix, bool ImmediateUnlink, FileFd * const TmpFd, bool Buffered) { - char fn[512]; - FileFd * const Fd = TmpFd == nullptr ? new FileFd() : TmpFd; - + std::string fn; std::string const tempdir = GetTempDir(); - snprintf(fn, sizeof(fn), "%s/%s.XXXXXX", - tempdir.c_str(), Prefix.c_str()); - int const fd = mkstemp(fn); + int fd = -1; +#ifdef O_TMPFILE if (ImmediateUnlink) - unlink(fn); + fd = open(tempdir.c_str(), O_RDWR|O_TMPFILE|O_EXCL|O_CLOEXEC, 0600); if (fd < 0) +#endif { - _error->Errno("GetTempFile",_("Unable to mkstemp %s"), fn); - if (TmpFd == nullptr) - delete Fd; + auto const suffix = Prefix.find(".XXXXXX."); + std::vector<char> buffer(tempdir.length() + 1 + Prefix.length() + (suffix == std::string::npos ? 7 : 0) + 1, '\0'); + if (suffix != std::string::npos) + { + if (snprintf(buffer.data(), buffer.size(), "%s/%s", tempdir.c_str(), Prefix.c_str()) > 0) + { + ssize_t const suffixlen = (buffer.size() - 1) - (tempdir.length() + 1 + suffix + 7); + if (likely(suffixlen > 0)) + fd = mkstemps(buffer.data(), suffixlen); + } + } + else + { + if (snprintf(buffer.data(), buffer.size(), "%s/%s.XXXXXX", tempdir.c_str(), Prefix.c_str()) > 0) + fd = mkstemp(buffer.data()); + } + fn.assign(buffer.data(), buffer.size() - 1); + if (ImmediateUnlink && fd != -1) + unlink(fn.c_str()); + } + if (fd < 0) + { + _error->Errno("GetTempFile",_("Unable to mkstemp %s"), fn.c_str()); return nullptr; } - if (!Fd->OpenDescriptor(fd, FileFd::ReadWrite | (Buffered ? FileFd::BufferedWrite : 0), FileFd::None, true)) + FileFd * const Fd = TmpFd == nullptr ? new FileFd() : TmpFd; + if (not Fd->OpenDescriptor(fd, FileFd::ReadWrite | (Buffered ? FileFd::BufferedWrite : 0), FileFd::None, true)) { - _error->Errno("GetTempFile",_("Unable to write to %s"),fn); + _error->Errno("GetTempFile",_("Unable to write to %s"),fn.c_str()); if (TmpFd == nullptr) delete Fd; return nullptr; } - if (ImmediateUnlink == false) + if (not ImmediateUnlink) Fd->SetFileName(fn); return Fd; } diff --git a/apt-pkg/contrib/srvrec.cc b/apt-pkg/contrib/srvrec.cc index 7d9bf116e..4ca208273 100644 --- a/apt-pkg/contrib/srvrec.cc +++ b/apt-pkg/contrib/srvrec.cc @@ -137,17 +137,12 @@ bool GetSrvRecords(std::string name, std::vector<SrvRec> &Result) // sort them by priority std::stable_sort(Result.begin(), Result.end()); - for(std::vector<SrvRec>::iterator I = Result.begin(); - I != Result.end(); ++I) - { - if (_config->FindB("Debug::Acquire::SrvRecs", false) == true) - { - std::cerr << "SrvRecs: got " << I->target - << " prio: " << I->priority - << " weight: " << I->weight - << std::endl; - } - } + if (_config->FindB("Debug::Acquire::SrvRecs", false)) + for(auto const &R : Result) + std::cerr << "SrvRecs: got " << R.target + << " prio: " << R.priority + << " weight: " << R.weight + << '\n'; return true; } diff --git a/apt-pkg/deb/deblistparser.cc b/apt-pkg/deb/deblistparser.cc index ab957a01a..240946529 100644 --- a/apt-pkg/deb/deblistparser.cc +++ b/apt-pkg/deb/deblistparser.cc @@ -318,6 +318,8 @@ bool debListParser::UsePackage(pkgCache::PkgIterator &Pkg, return false; if (Section.FindFlag(pkgTagSection::Key::Important,Pkg->Flags,pkgCache::Flag::Important) == false) return false; + if (Section.FindFlag(pkgTagSection::Key::Protected, Pkg->Flags, pkgCache::Flag::Important) == false) + return false; if (std::find(forceEssential.begin(), forceEssential.end(), Pkg.Name()) != forceEssential.end()) { @@ -1018,12 +1020,11 @@ debDebFileParser::debDebFileParser(FileFd *File, std::string const &DebFile) bool debDebFileParser::UsePackage(pkgCache::PkgIterator &Pkg, pkgCache::VerIterator &Ver) { - bool res = debListParser::UsePackage(Pkg, Ver); - // we use the full file path as a provides so that the file is found - // by its name - if(NewProvides(Ver, DebFile, Pkg.Cache()->NativeArch(), Ver.VerStr(), 0) == false) + if (not debListParser::UsePackage(Pkg, Ver)) return false; - return res; + // we use the full file path as a provides so that the file is found by its name + // using the MultiArchImplicit flag for this is a bit of a stretch + return NewProvides(Ver, DebFile, Pkg.Cache()->NativeArch(), Ver.VerStr(), pkgCache::Flag::MultiArchImplicit | pkgCache::Flag::ArchSpecific); } debListParser::~debListParser() {} diff --git a/apt-pkg/deb/debsystem.cc b/apt-pkg/deb/debsystem.cc index 6904879b6..eac43c3b7 100644 --- a/apt-pkg/deb/debsystem.cc +++ b/apt-pkg/deb/debsystem.cc @@ -270,7 +270,7 @@ static std::string getDpkgStatusLocation(Configuration const &Cnf) { Configuration PathCnf; PathCnf.Set("Dir", Cnf.Find("Dir", "/")); PathCnf.Set("Dir::State::status", "status"); - auto const cnfstatedir = Cnf.Find("Dir::State", STATE_DIR + 1); + auto const cnfstatedir = Cnf.Find("Dir::State", &STATE_DIR[1]); // if the state dir ends in apt, replace it with dpkg - // for the default this gives us the same as the fallback below. // This can't be a ../dpkg as that would play bad with symlinks @@ -466,8 +466,13 @@ pid_t debSystem::ExecDpkg(std::vector<std::string> const &sArgs, int * const inp /*}}}*/ bool debSystem::MultiArchSupported() const /*{{{*/ { + return AssertFeature("multi-arch"); +} + /*}}}*/ +bool debSystem::AssertFeature(std::string const &feature) /*{{{*/ +{ std::vector<std::string> Args = GetDpkgBaseCommand(); - Args.push_back("--assert-multi-arch"); + Args.push_back("--assert-" + feature); pid_t const dpkgAssertMultiArch = ExecDpkg(Args, nullptr, nullptr, true); if (dpkgAssertMultiArch > 0) { diff --git a/apt-pkg/deb/debsystem.h b/apt-pkg/deb/debsystem.h index 2e5a8550c..b3d241512 100644 --- a/apt-pkg/deb/debsystem.h +++ b/apt-pkg/deb/debsystem.h @@ -45,6 +45,7 @@ class debSystem : public pkgSystem APT_HIDDEN static void DpkgChrootDirectory(); APT_HIDDEN static pid_t ExecDpkg(std::vector<std::string> const &sArgs, int * const inputFd, int * const outputFd, bool const DiscardOutput); bool MultiArchSupported() const override; + static bool AssertFeature(std::string const &Feature); std::vector<std::string> ArchitecturesSupported() const override; bool LockInner(OpProgress *const Progress, int timeoutSec) override; diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc index ef73881c8..c496538cc 100644 --- a/apt-pkg/deb/dpkgpm.cc +++ b/apt-pkg/deb/dpkgpm.cc @@ -1416,6 +1416,15 @@ static bool ItemIsEssential(pkgDPkgPM::Item const &I) return true; return (I.Pkg->Flags & pkgCache::Flag::Essential) != 0; } +static bool ItemIsProtected(pkgDPkgPM::Item const &I) +{ + static auto const cachegen = _config->Find("pkgCacheGen::Protected"); + if (cachegen == "none" || cachegen == "native") + return true; + if (unlikely(I.Pkg.end())) + return true; + return (I.Pkg->Flags & pkgCache::Flag::Important) != 0; +} bool pkgDPkgPM::ExpandPendingCalls(std::vector<Item> &List, pkgDepCache &Cache) { { @@ -1712,6 +1721,7 @@ bool pkgDPkgPM::Go(APT::Progress::PackageManager *progress) OpenLog(); bool dpkgMultiArch = _system->MultiArchSupported(); + bool dpkgProtectedField = debSystem::AssertFeature("protected-field"); // start pty magic before the loop StartPtyMagic(); @@ -1780,6 +1790,10 @@ bool pkgDPkgPM::Go(APT::Progress::PackageManager *progress) { ADDARGC("--force-remove-essential"); } + if (dpkgProtectedField && std::any_of(I, J, ItemIsProtected)) + { + ADDARGC("--force-remove-protected"); + } ADDARGC("--remove"); break; diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc index 7730aaf5b..817d9de3c 100644 --- a/apt-pkg/depcache.cc +++ b/apt-pkg/depcache.cc @@ -118,6 +118,88 @@ pkgDepCache::~pkgDepCache() delete delLocalPolicy; } /*}}}*/ +bool pkgDepCache::CheckConsistency(char const *const msgtag) /*{{{*/ +{ + auto const OrigPkgState = PkgState; + auto const OrigDepState = DepState; + + PkgState = new StateCache[Head().PackageCount]; + DepState = new unsigned char[Head().DependsCount]; + memset(PkgState,0,sizeof(*PkgState)*Head().PackageCount); + memset(DepState,0,sizeof(*DepState)*Head().DependsCount); + + auto const origUsrSize = iUsrSize; + auto const origDownloadSize = iDownloadSize; + auto const origInstCount = iInstCount; + auto const origDelCount = iDelCount; + auto const origKeepCount = iKeepCount; + auto const origBrokenCount = iBrokenCount; + auto const origPolicyBrokenCount = iPolicyBrokenCount; + auto const origBadCount = iBadCount; + + for (PkgIterator I = PkgBegin(); not I.end(); ++I) + { + auto &State = PkgState[I->ID]; + auto const &OrigState = OrigPkgState[I->ID]; + State.iFlags = OrigState.iFlags; + + State.CandidateVer = OrigState.CandidateVer; + State.InstallVer = OrigState.InstallVer; + State.Mode = OrigState.Mode; + State.Update(I,*this); + State.Status = OrigState.Status; + } + PerformDependencyPass(nullptr); + + _error->PushToStack(); +#define APT_CONSISTENCY_CHECK(VAR,STR) \ + if (orig##VAR != i##VAR) \ + _error->Warning("Internal Inconsistency in pkgDepCache: " #VAR " " STR " vs " STR " (%s)", i##VAR, orig##VAR, msgtag) + APT_CONSISTENCY_CHECK(UsrSize, "%lld"); + APT_CONSISTENCY_CHECK(DownloadSize, "%lld"); + APT_CONSISTENCY_CHECK(InstCount, "%lu"); + APT_CONSISTENCY_CHECK(DelCount, "%lu"); + APT_CONSISTENCY_CHECK(KeepCount, "%lu"); + APT_CONSISTENCY_CHECK(BrokenCount, "%lu"); + APT_CONSISTENCY_CHECK(PolicyBrokenCount, "%lu"); + APT_CONSISTENCY_CHECK(BadCount, "%lu"); +#undef APT_CONSISTENCY_CHECK + + for (PkgIterator P = PkgBegin(); not P.end(); ++P) + { + auto const &State = PkgState[P->ID]; + auto const &OrigState = OrigPkgState[P->ID]; + if (State.Status != OrigState.Status) + _error->Warning("Internal Inconsistency in pkgDepCache: Status of %s is %d vs %d (%s)", P.FullName().c_str(), State.Status, OrigState.Status, msgtag); + if (State.NowBroken() != OrigState.NowBroken()) + _error->Warning("Internal Inconsistency in pkgDepCache: Now broken for %s is %d vs %d (%s)", P.FullName().c_str(), static_cast<int>(State.DepState), static_cast<int>(OrigState.DepState), msgtag); + if (State.NowPolicyBroken() != OrigState.NowPolicyBroken()) + _error->Warning("Internal Inconsistency in pkgDepCache: Now policy broken for %s is %d vs %d (%s)", P.FullName().c_str(), static_cast<int>(State.DepState), static_cast<int>(OrigState.DepState), msgtag); + if (State.InstBroken() != OrigState.InstBroken()) + _error->Warning("Internal Inconsistency in pkgDepCache: Install broken for %s is %d vs %d (%s)", P.FullName().c_str(), static_cast<int>(State.DepState), static_cast<int>(OrigState.DepState), msgtag); + if (State.InstPolicyBroken() != OrigState.InstPolicyBroken()) + _error->Warning("Internal Inconsistency in pkgDepCache: Install broken for %s is %d vs %d (%s)", P.FullName().c_str(), static_cast<int>(State.DepState), static_cast<int>(OrigState.DepState), msgtag); + } + + auto inconsistent = _error->PendingError(); + _error->MergeWithStack(); + + delete[] PkgState; + delete[] DepState; + PkgState = OrigPkgState; + DepState = OrigDepState; + iUsrSize = origUsrSize; + iDownloadSize = origDownloadSize; + iInstCount = origInstCount; + iDelCount = origDelCount; + iKeepCount = origKeepCount; + iBrokenCount = origBrokenCount; + iPolicyBrokenCount = origPolicyBrokenCount; + iBadCount = origBadCount; + + return not inconsistent; +} + /*}}}*/ // DepCache::Init - Generate the initial extra structures. /*{{{*/ // --------------------------------------------------------------------- /* This allocats the extension buffers and initializes them. */ @@ -655,8 +737,8 @@ void pkgDepCache::UpdateVerState(PkgIterator const &Pkg) // --------------------------------------------------------------------- /* This will figure out the state of all the packages and all the dependencies based on the current policy. */ -void pkgDepCache::Update(OpProgress * const Prog) -{ +void pkgDepCache::PerformDependencyPass(OpProgress * const Prog) +{ iUsrSize = 0; iDownloadSize = 0; iInstCount = 0; @@ -666,7 +748,6 @@ void pkgDepCache::Update(OpProgress * const Prog) iPolicyBrokenCount = 0; iBadCount = 0; - // Perform the depends pass int Done = 0; for (PkgIterator I = PkgBegin(); I.end() != true; ++I, ++Done) { @@ -699,10 +780,12 @@ void pkgDepCache::Update(OpProgress * const Prog) UpdateVerState(I); AddStates(I); } - if (Prog != 0) Prog->Progress(Done); - +} +void pkgDepCache::Update(OpProgress * const Prog) +{ + PerformDependencyPass(Prog); readStateFile(Prog); } /*}}}*/ @@ -744,25 +827,85 @@ void pkgDepCache::Update(PkgIterator const &Pkg) Update(Pkg.RevDependsList()); // Update the provides map for the current ver - if (Pkg->CurrentVer != 0) - for (PrvIterator P = Pkg.CurrentVer().ProvidesList(); - P.end() != true; ++P) + auto const CurVer = Pkg.CurrentVer(); + if (not CurVer.end()) + for (PrvIterator P = CurVer.ProvidesList(); not P.end(); ++P) Update(P.ParentPkg().RevDependsList()); // Update the provides map for the candidate ver - if (PkgState[Pkg->ID].CandidateVer != 0) - for (PrvIterator P = PkgState[Pkg->ID].CandidateVerIter(*this).ProvidesList(); - P.end() != true; ++P) + auto const CandVer = PkgState[Pkg->ID].CandidateVerIter(*this); + if (not CandVer.end() && CandVer != CurVer) + for (PrvIterator P = CandVer.ProvidesList(); not P.end(); ++P) Update(P.ParentPkg().RevDependsList()); } /*}}}*/ +// DepCache::IsModeChangeOk - check if it is ok to change the mode /*{{{*/ +// --------------------------------------------------------------------- +/* this is used by all Mark methods on the very first line to check sanity + and prevents mode changes for packages on hold for example. + If you want to check Mode specific stuff you can use the virtual public + Is<Mode>Ok methods instead */ +static char const* PrintMode(char const mode) +{ + switch (mode) + { + case pkgDepCache::ModeInstall: return "Install"; + case pkgDepCache::ModeKeep: return "Keep"; + case pkgDepCache::ModeDelete: return "Delete"; + case pkgDepCache::ModeGarbage: return "Garbage"; + default: return "UNKNOWN"; + } +} +static bool IsModeChangeOk(pkgDepCache &Cache, pkgDepCache::ModeList const mode, pkgCache::PkgIterator const &Pkg, + unsigned long const Depth, bool const FromUser, bool const DebugMarker) +{ + // we are not trying to hard… + if (unlikely(Depth > 100)) + return false; + + // general sanity + if (unlikely(Pkg.end() == true || Pkg->VersionList == 0)) + return false; + + // the user is always right + if (FromUser == true) + return true; + + auto &P = Cache[Pkg]; + // not changing the mode is obviously also fine as we might want to call + // e.g. MarkInstall multiple times with different arguments for the same package + if (P.Mode == mode) + return true; + + // if previous state was set by user only user can reset it + if ((P.iFlags & pkgDepCache::Protected) == pkgDepCache::Protected) + { + if (unlikely(DebugMarker == true)) + std::clog << OutputInDepth(Depth) << "Ignore Mark" << PrintMode(mode) + << " of " << APT::PrettyPkg(&Cache, Pkg) << " as its mode (" << PrintMode(P.Mode) + << ") is protected" << std::endl; + return false; + } + // enforce dpkg holds + else if (mode != pkgDepCache::ModeKeep && Pkg->SelectedState == pkgCache::State::Hold && + _config->FindB("APT::Ignore-Hold",false) == false) + { + if (unlikely(DebugMarker == true)) + std::clog << OutputInDepth(Depth) << "Hold prevents Mark" << PrintMode(mode) + << " of " << APT::PrettyPkg(&Cache, Pkg) << std::endl; + return false; + } + + return true; +} + /*}}}*/ // DepCache::MarkKeep - Put the package in the keep state /*{{{*/ // --------------------------------------------------------------------- /* */ bool pkgDepCache::MarkKeep(PkgIterator const &Pkg, bool Soft, bool FromUser, unsigned long Depth) { - if (IsModeChangeOk(ModeKeep, Pkg, Depth, FromUser) == false) + if (not IsModeChangeOk(*this, ModeKeep, Pkg, Depth, FromUser, DebugMarker)) return false; /* Reject an attempt to keep a non-source broken installed package, those @@ -822,7 +965,7 @@ bool pkgDepCache::MarkKeep(PkgIterator const &Pkg, bool Soft, bool FromUser, bool pkgDepCache::MarkDelete(PkgIterator const &Pkg, bool rPurge, unsigned long Depth, bool FromUser) { - if (IsModeChangeOk(ModeDelete, Pkg, Depth, FromUser) == false) + if (not IsModeChangeOk(*this, ModeDelete, Pkg, Depth, FromUser, DebugMarker)) return false; StateCache &P = PkgState[Pkg->ID]; @@ -921,75 +1064,18 @@ bool pkgDepCache::IsDeleteOkProtectInstallRequests(PkgIterator const &Pkg, return true; } /*}}}*/ -// DepCache::IsModeChangeOk - check if it is ok to change the mode /*{{{*/ -// --------------------------------------------------------------------- -/* this is used by all Mark methods on the very first line to check sanity - and prevents mode changes for packages on hold for example. - If you want to check Mode specific stuff you can use the virtual public - Is<Mode>Ok methods instead */ -static char const* PrintMode(char const mode) -{ - switch (mode) - { - case pkgDepCache::ModeInstall: return "Install"; - case pkgDepCache::ModeKeep: return "Keep"; - case pkgDepCache::ModeDelete: return "Delete"; - case pkgDepCache::ModeGarbage: return "Garbage"; - default: return "UNKNOWN"; - } -} -bool pkgDepCache::IsModeChangeOk(ModeList const mode, PkgIterator const &Pkg, - unsigned long const Depth, bool const FromUser) -{ - // we are not trying to hard… - if (unlikely(Depth > 100)) - return false; - - // general sanity - if (unlikely(Pkg.end() == true || Pkg->VersionList == 0)) - return false; - - // the user is always right - if (FromUser == true) - return true; - - StateCache &P = PkgState[Pkg->ID]; - // not changing the mode is obviously also fine as we might want to call - // e.g. MarkInstall multiple times with different arguments for the same package - if (P.Mode == mode) - return true; - - // if previous state was set by user only user can reset it - if ((P.iFlags & Protected) == Protected) - { - if (unlikely(DebugMarker == true)) - std::clog << OutputInDepth(Depth) << "Ignore Mark" << PrintMode(mode) - << " of " << APT::PrettyPkg(this, Pkg) << " as its mode (" << PrintMode(P.Mode) - << ") is protected" << std::endl; - return false; - } - // enforce dpkg holds - else if (mode != ModeKeep && Pkg->SelectedState == pkgCache::State::Hold && - _config->FindB("APT::Ignore-Hold",false) == false) - { - if (unlikely(DebugMarker == true)) - std::clog << OutputInDepth(Depth) << "Hold prevents Mark" << PrintMode(mode) - << " of " << APT::PrettyPkg(this, Pkg) << std::endl; - return false; - } - - return true; -} - /*}}}*/ struct CompareProviders /*{{{*/ { + pkgDepCache const &Cache; pkgCache::PkgIterator const Pkg; - explicit CompareProviders(pkgCache::DepIterator const &Dep) : Pkg(Dep.TargetPkg()) {}; - //bool operator() (APT::VersionList::iterator const &AV, APT::VersionList::iterator const &BV) + explicit CompareProviders(pkgDepCache const &pCache, pkgCache::DepIterator const &Dep) : Cache{pCache}, Pkg{Dep.TargetPkg()} {} bool operator() (pkgCache::VerIterator const &AV, pkgCache::VerIterator const &BV) { pkgCache::PkgIterator const A = AV.ParentPkg(); pkgCache::PkgIterator const B = BV.ParentPkg(); + // Deal with protected first as if they don't work we usually have a problem + if (Cache[A].Protect() != Cache[B].Protect()) + return Cache[A].Protect(); // Prefer MA:same packages if other architectures for it are installed if ((AV->MultiArch & pkgCache::Version::Same) == pkgCache::Version::Same || (BV->MultiArch & pkgCache::Version::Same) == pkgCache::Version::Same) @@ -1068,10 +1154,13 @@ struct CompareProviders /*{{{*/ } }; /*}}}*/ -bool pkgDepCache::MarkInstall_StateChange(PkgIterator const &Pkg, bool AutoInst, bool FromUser) /*{{{*/ +bool pkgDepCache::MarkInstall_StateChange(pkgCache::PkgIterator const &Pkg, bool AutoInst, bool FromUser) /*{{{*/ { - StateCache &P = PkgState[Pkg->ID]; - P.iFlags &= ~AutoKept; + auto &P = (*this)[Pkg]; + if (P.Protect() && P.InstallVer == P.CandidateVer) + return true; + + P.iFlags &= ~pkgDepCache::AutoKept; /* Target the candidate version and remove the autoflag. We reset the autoflag below if this was called recursively. Otherwise the user @@ -1079,7 +1168,7 @@ bool pkgDepCache::MarkInstall_StateChange(PkgIterator const &Pkg, bool AutoInst, RemoveSizes(Pkg); RemoveStates(Pkg); - P.Mode = ModeInstall; + P.Mode = pkgDepCache::ModeInstall; P.InstallVer = P.CandidateVer; if(FromUser) @@ -1088,16 +1177,16 @@ bool pkgDepCache::MarkInstall_StateChange(PkgIterator const &Pkg, bool AutoInst, // but only if its not marked by the autoremover (aptitude depend on this behavior) // or if we do automatic installation (aptitude never does it) if(P.Status == 2 || (Pkg->CurrentVer != 0 && (AutoInst == true || P.Marked == false))) - P.Flags &= ~Flag::Auto; + P.Flags &= ~pkgCache::Flag::Auto; } else { // Set it to auto if this is a new install. if(P.Status == 2) - P.Flags |= Flag::Auto; + P.Flags |= pkgCache::Flag::Auto; } - if (P.CandidateVer == (Version *)Pkg.CurrentVer()) - P.Mode = ModeKeep; + if (P.CandidateVer == (pkgCache::Version *)Pkg.CurrentVer()) + P.Mode = pkgDepCache::ModeKeep; AddStates(Pkg); Update(Pkg); @@ -1105,8 +1194,37 @@ bool pkgDepCache::MarkInstall_StateChange(PkgIterator const &Pkg, bool AutoInst, return true; } /*}}}*/ -bool pkgDepCache::MarkInstall_CollectDependencies(pkgCache::VerIterator const &PV, std::vector<pkgCache::DepIterator> &toInstall, std::vector<pkgCache::DepIterator> &toRemove) /*{{{*/ +static bool MarkInstall_DiscardCandidate(pkgDepCache &Cache, pkgCache::PkgIterator const &Pkg) /*{{{*/ { + auto &State = Cache[Pkg]; + State.CandidateVer = State.InstallVer; + auto const oldStatus = State.Status; + State.Update(Pkg, Cache); + State.Status = oldStatus; + return true; +} + /*}}}*/ +bool pkgDepCache::MarkInstall_DiscardInstall(pkgCache::PkgIterator const &Pkg) /*{{{*/ +{ + StateCache &State = PkgState[Pkg->ID]; + if (State.Mode == ModeKeep && State.InstallVer == State.CandidateVer && State.CandidateVer == Pkg.CurrentVer()) + return true; + RemoveSizes(Pkg); + RemoveStates(Pkg); + if (Pkg->CurrentVer != 0) + State.InstallVer = Pkg.CurrentVer(); + else + State.InstallVer = nullptr; + State.Mode = ModeKeep; + AddStates(Pkg); + Update(Pkg); + AddSizes(Pkg); + return MarkInstall_DiscardCandidate(*this, Pkg); +} + /*}}}*/ +static bool MarkInstall_CollectDependencies(pkgDepCache const &Cache, pkgCache::VerIterator const &PV, std::vector<pkgCache::DepIterator> &toInstall, std::vector<pkgCache::DepIterator> &toRemove) /*{{{*/ +{ + auto const propagateProctected = Cache[PV.ParentPkg()].Protect(); for (auto Dep = PV.DependsList(); not Dep.end();) { auto const Start = Dep; @@ -1114,17 +1232,17 @@ bool pkgDepCache::MarkInstall_CollectDependencies(pkgCache::VerIterator const &P bool foundSolution = false; for (bool LastOR = true; not Dep.end() && LastOR; ++Dep) { - LastOR = (Dep->CompareOp & Dep::Or) == Dep::Or; - if ((DepState[Dep->ID] & DepInstall) == DepInstall) + LastOR = (Dep->CompareOp & pkgCache::Dep::Or) == pkgCache::Dep::Or; + if ((Cache[Dep] & pkgDepCache::DepInstall) == pkgDepCache::DepInstall) foundSolution = true; } - if (foundSolution) + if (foundSolution && not propagateProctected) continue; /* Check if this dep should be consider for install. (Pre-)Depends, Conflicts and Breaks for sure. Recommends & Suggests depending on configuration */ - if (not IsImportantDep(Start)) + if (not Cache.IsImportantDep(Start)) continue; if (Start.IsNegative()) @@ -1138,74 +1256,190 @@ bool pkgDepCache::MarkInstall_CollectDependencies(pkgCache::VerIterator const &P return true; } /*}}}*/ -bool pkgDepCache::MarkInstall_RemoveConflictsIfNotUpgradeable(pkgCache::VerIterator const &PV, unsigned long Depth, std::vector<pkgCache::DepIterator> &toRemove, APT::PackageVector &toUpgrade) /*{{{*/ +static APT::VersionVector getAllPossibleSolutions(pkgDepCache &Cache, pkgCache::DepIterator Start, pkgCache::DepIterator const &End, APT::CacheSetHelper::VerSelector const selector, bool const sorted) /*{{{*/ { - /* Negative dependencies have no or-group - If the dependency isn't versioned, we try if an upgrade might solve the problem. - Otherwise we remove the offender if needed */ - for (auto const &D : toRemove) + pkgCacheFile CacheFile{&Cache}; + APT::VersionVector toUpgrade, toNewInstall; + do { - std::unique_ptr<Version *[]> List(D.AllTargets()); - pkgCache::PkgIterator TrgPkg = D.TargetPkg(); - for (Version **I = List.get(); *I != 0; I++) + APT::VersionVector verlist = APT::VersionVector::FromDependency(CacheFile, Start, selector); + if (not sorted) { - VerIterator Ver(*this, *I); - PkgIterator Pkg = Ver.ParentPkg(); + std::move(verlist.begin(), verlist.end(), std::back_inserter(toUpgrade)); + continue; + } + std::sort(verlist.begin(), verlist.end(), CompareProviders{Cache, Start}); + for (auto &&Ver : verlist) + { + auto P = Ver.ParentPkg(); + if (P->CurrentVer != 0) + toUpgrade.emplace_back(std::move(Ver)); + else + toNewInstall.emplace_back(std::move(Ver)); + } + } while (Start++ != End); + if (toUpgrade.empty()) + toUpgrade = std::move(toNewInstall); + else + std::move(toNewInstall.begin(), toNewInstall.end(), std::back_inserter(toUpgrade)); - /* The List includes all packages providing this dependency, - even providers which are not installed, so skip them. */ - if (PkgState[Pkg->ID].InstallVer == 0) - continue; + if (not sorted) + std::sort(toUpgrade.begin(), toUpgrade.end(), [](pkgCache::VerIterator const &A, pkgCache::VerIterator const &B) { return A->ID < B->ID; }); + toUpgrade.erase(std::unique(toUpgrade.begin(), toUpgrade.end()), toUpgrade.end()); - // Ignore negative dependencies on versions that are not going to get installed - if (PkgState[Pkg->ID].InstallVer != *I) - continue; + if (not End.IsNegative()) + toUpgrade.erase(std::remove_if(toUpgrade.begin(), toUpgrade.end(), [&Cache](pkgCache::VerIterator const &V) { + auto const P = V.ParentPkg(); + auto const &State = Cache[P]; + return State.Protect() && (State.Delete() || (State.Keep() && P->CurrentVer == 0)); + }), + toUpgrade.end()); + + return toUpgrade; +} + /*}}}*/ +static bool MarkInstall_MarkDeleteForNotUpgradeable(pkgDepCache &Cache, bool const DebugAutoInstall, pkgCache::VerIterator const &PV, unsigned long const Depth, pkgCache::PkgIterator const &Pkg, bool const propagateProctected, APT::PackageVector &delayedRemove)/*{{{*/ +{ + auto &State = Cache[Pkg]; + if (not propagateProctected) + { + if (State.Delete()) + return true; + if(DebugAutoInstall) + std::clog << OutputInDepth(Depth) << " Delayed Removing: " << Pkg.FullName() << " as upgrade is not an option for " << PV.ParentPkg().FullName() << " (" << PV.VerStr() << ")\n"; + if (not IsModeChangeOk(Cache, pkgDepCache::ModeDelete, Pkg, Depth, false, DebugAutoInstall) || + not Cache.IsDeleteOk(Pkg, false, Depth, false)) + return false; + delayedRemove.push_back(Pkg); + return true; + } - if ((D->Version != 0 || TrgPkg != Pkg) && - PkgState[Pkg->ID].CandidateVer != PkgState[Pkg->ID].InstallVer && - PkgState[Pkg->ID].CandidateVer != *I) + if (not State.Delete()) + { + if(DebugAutoInstall) + std::clog << OutputInDepth(Depth) << " Removing: " << Pkg.FullName() << " as upgrade is not an option for " << PV.ParentPkg().FullName() << " (" << PV.VerStr() << ")\n"; + if (not Cache.MarkDelete(Pkg, false, Depth + 1, false)) + return false; + } + MarkInstall_DiscardCandidate(Cache, Pkg); + Cache.MarkProtected(Pkg); + return true; +} + /*}}}*/ +static bool MarkInstall_RemoveConflictsIfNotUpgradeable(pkgDepCache &Cache, bool const DebugAutoInstall, pkgCache::VerIterator const &PV, unsigned long Depth, std::vector<pkgCache::DepIterator> &toRemove, APT::PackageVector &toUpgrade, APT::PackageVector &delayedRemove, bool const propagateProctected, bool const FromUser) /*{{{*/ +{ + /* Negative dependencies have no or-group + If the candidate is effected try to keep current and discard candidate + If the current is effected try upgrading to candidate or remove it */ + bool failedToRemoveSomething = false; + APT::PackageVector badCandidate; + for (auto const &D : toRemove) + { + for (auto const &Ver : getAllPossibleSolutions(Cache, D, D, APT::CacheSetHelper::CANDIDATE, true)) + { + auto const Pkg = Ver.ParentPkg(); + auto &State = Cache[Pkg]; + if (State.CandidateVer != Ver) + continue; + if (Pkg.CurrentVer() != Ver) + { + if (State.Install() && not Cache.MarkKeep(Pkg, false, false, Depth)) + { + failedToRemoveSomething = true; + if (not propagateProctected && not FromUser) + break; + } + else if (propagateProctected) + { + MarkInstall_DiscardCandidate(Cache, Pkg); + if (Pkg->CurrentVer == 0) + Cache.MarkProtected(Pkg); + } + else + badCandidate.push_back(Pkg); + } + else if (not MarkInstall_MarkDeleteForNotUpgradeable(Cache, DebugAutoInstall, PV, Depth, Pkg, propagateProctected, delayedRemove)) + { + failedToRemoveSomething = true; + if (not propagateProctected && not FromUser) + break; + } + } + if (failedToRemoveSomething && not propagateProctected && not FromUser) + break; + for (auto const &Ver : getAllPossibleSolutions(Cache, D, D, APT::CacheSetHelper::INSTALLED, true)) + { + auto const Pkg = Ver.ParentPkg(); + auto &State = Cache[Pkg]; + if (State.CandidateVer != Ver && State.CandidateVer != nullptr && + std::find(badCandidate.cbegin(), badCandidate.cend(), Pkg) == badCandidate.end()) toUpgrade.push_back(Pkg); - else + else if (State.CandidateVer == Pkg.CurrentVer()) + ; // already done in the first loop above + else if (not MarkInstall_MarkDeleteForNotUpgradeable(Cache, DebugAutoInstall, PV, Depth, Pkg, propagateProctected, delayedRemove)) { - if(DebugAutoInstall == true) - std::clog << OutputInDepth(Depth) << " Removing: " << Pkg.Name() << " as upgrade is not an option for " << PV.ParentPkg().FullName() << "(" << PV.VerStr() << ")\n"; - if (not MarkDelete(Pkg, false, Depth + 1, false)) - return false; - if (PkgState[PV.ParentPkg()->ID].Protect()) - MarkProtected(Pkg); + failedToRemoveSomething = true; + if (not propagateProctected && not FromUser) + break; } } + if (failedToRemoveSomething && not propagateProctected && not FromUser) + break; } toRemove.clear(); - return true; + return not failedToRemoveSomething; } /*}}}*/ -bool pkgDepCache::MarkInstall_UpgradeOrRemoveConflicts(bool const propagateProctected, unsigned long Depth, bool const ForceImportantDeps, APT::PackageVector &toUpgrade) /*{{{*/ +static bool MarkInstall_UpgradeOrRemoveConflicts(pkgDepCache &Cache, bool const DebugAutoInstall, unsigned long Depth, bool const ForceImportantDeps, APT::PackageVector &toUpgrade, bool const propagateProctected, bool const FromUser) /*{{{*/ { + bool failedToRemoveSomething = false; for (auto const &InstPkg : toUpgrade) - if (not MarkInstall(InstPkg, true, Depth + 1, false, ForceImportantDeps)) + if (not Cache[InstPkg].Install() && not Cache.MarkInstall(InstPkg, true, Depth + 1, false, ForceImportantDeps)) { if (DebugAutoInstall) std::clog << OutputInDepth(Depth) << " Removing: " << InstPkg.FullName() << " as upgrade is not possible\n"; - if (not MarkDelete(InstPkg, false, Depth + 1, false)) - return false; - if (propagateProctected) - MarkProtected(InstPkg); + if (not Cache.MarkDelete(InstPkg, false, Depth + 1, false)) + { + failedToRemoveSomething = true; + if (not propagateProctected && not FromUser) + break; + } + else if (propagateProctected) + Cache.MarkProtected(InstPkg); } toUpgrade.clear(); - return true; + return not failedToRemoveSomething; } /*}}}*/ -bool pkgDepCache::MarkInstall_InstallDependencies(PkgIterator const &Pkg, unsigned long Depth, bool const ForceImportantDeps, std::vector<pkgCache::DepIterator> &toInstall, APT::PackageVector *const toMoveAuto, bool const propagateProctected) /*{{{*/ +static bool MarkInstall_InstallDependencies(pkgDepCache &Cache, bool const DebugAutoInstall, bool const DebugMarker, pkgCache::PkgIterator const &Pkg, unsigned long Depth, bool const ForceImportantDeps, std::vector<pkgCache::DepIterator> &toInstall, APT::PackageVector *const toMoveAuto, bool const propagateProctected, bool const FromUser) /*{{{*/ { - auto const IsSatisfiedByInstalled = [&](auto const D) { return (DepState[D.ID] & DepInstall) == DepInstall; }; + auto const IsSatisfiedByInstalled = [&](auto &D) { return (Cache[pkgCache::DepIterator{Cache, &D}] & pkgDepCache::DepInstall) == pkgDepCache::DepInstall; }; + bool failedToInstallSomething = false; for (auto &&Dep : toInstall) { - pkgDepCache::DepIterator Start, End; + auto const Copy = Dep; + pkgCache::DepIterator Start, End; Dep.GlobOr(Start, End); - if (std::any_of(Start, Dep, IsSatisfiedByInstalled)) + bool foundSolution = std::any_of(Start, Dep, IsSatisfiedByInstalled); + if (foundSolution && not propagateProctected) continue; bool const IsCriticalDep = Start.IsCritical(); + if (foundSolution) + { + // try propagating protected to this satisfied dependency + if (not IsCriticalDep) + continue; + auto const possibleSolutions = getAllPossibleSolutions(Cache, Start, End, APT::CacheSetHelper::CANDANDINST, false); + if (possibleSolutions.size() != 1) + continue; + auto const InstPkg = possibleSolutions.begin().ParentPkg(); + if (Cache[InstPkg].Protect()) + continue; + Cache.MarkProtected(InstPkg); + if (not Cache.MarkInstall(InstPkg, true, Depth + 1, false, ForceImportantDeps)) + failedToInstallSomething = true; + continue; + } /* Check if any ImportantDep() (but not Critical) were added * since we installed the package. Also check for deps that @@ -1218,21 +1452,21 @@ bool pkgDepCache::MarkInstall_InstallDependencies(PkgIterator const &Pkg, unsign { bool isNewImportantDep = true; bool isPreviouslySatisfiedImportantDep = false; - for (DepIterator D = Pkg.CurrentVer().DependsList(); D.end() != true; ++D) + for (pkgCache::DepIterator D = Pkg.CurrentVer().DependsList(); D.end() != true; ++D) { //FIXME: Should we handle or-group better here? // We do not check if the package we look for is part of the same or-group // we might find while searching, but could that really be a problem? - if (D.IsCritical() || not IsImportantDep(D) || + if (D.IsCritical() || not Cache.IsImportantDep(D) || Start.TargetPkg() != D.TargetPkg()) continue; isNewImportantDep = false; - while ((D->CompareOp & Dep::Or) != 0) + while ((D->CompareOp & pkgCache::Dep::Or) != 0) ++D; - isPreviouslySatisfiedImportantDep = (((*this)[D] & DepGNow) != 0); + isPreviouslySatisfiedImportantDep = ((Cache[D] & pkgDepCache::DepGNow) != 0); if (isPreviouslySatisfiedImportantDep) break; } @@ -1258,41 +1492,22 @@ bool pkgDepCache::MarkInstall_InstallDependencies(PkgIterator const &Pkg, unsign } } - pkgCacheFile CacheFile{this}; - APT::PackageVector toUpgrade, toNewInstall; - do - { - if ((DepState[Start->ID] & DepCVer) != DepCVer) - continue; - - APT::VersionVector verlist = APT::VersionVector::FromDependency(CacheFile, Start, APT::CacheSetHelper::CANDIDATE); - std::sort(verlist.begin(), verlist.end(), CompareProviders{Start}); - for (auto const &Ver : verlist) - { - auto P = Ver.ParentPkg(); - if (P->CurrentVer != 0) - toUpgrade.emplace_back(std::move(P)); - else - toNewInstall.emplace_back(std::move(P)); - } - } while (Start++ != End); - - std::move(toNewInstall.begin(), toNewInstall.end(), std::back_inserter(toUpgrade)); - bool foundSolution = false; - for (auto const &InstPkg : toUpgrade) + auto const possibleSolutions = getAllPossibleSolutions(Cache, Start, End, APT::CacheSetHelper::CANDIDATE, true); + for (auto const &InstVer : possibleSolutions) { - if (PkgState[InstPkg->ID].CandidateVer == nullptr || PkgState[InstPkg->ID].CandidateVer == InstPkg.CurrentVer()) + auto const InstPkg = InstVer.ParentPkg(); + if (Cache[InstPkg].CandidateVer != InstVer) continue; if (DebugAutoInstall) std::clog << OutputInDepth(Depth) << "Installing " << InstPkg.FullName() << " as " << End.DepType() << " of " << Pkg.FullName() << '\n'; - if (propagateProctected && IsCriticalDep && toUpgrade.size() == 1) + if (propagateProctected && IsCriticalDep && possibleSolutions.size() == 1) { - if (not MarkInstall(InstPkg, false, Depth + 1, false, ForceImportantDeps)) + if (not Cache.MarkInstall(InstPkg, false, Depth + 1, false, ForceImportantDeps)) continue; - MarkProtected(InstPkg); + Cache.MarkProtected(InstPkg); } - if (not MarkInstall(InstPkg, true, Depth + 1, false, ForceImportantDeps)) + if (not Cache.MarkInstall(InstPkg, true, Depth + 1, false, ForceImportantDeps)) continue; if (toMoveAuto != nullptr && InstPkg->CurrentVer == 0) @@ -1301,28 +1516,17 @@ bool pkgDepCache::MarkInstall_InstallDependencies(PkgIterator const &Pkg, unsign foundSolution = true; break; } + if (DebugMarker && not foundSolution) + std::clog << OutputInDepth(Depth+1) << APT::PrettyDep(&Cache, Copy) << " can't be satisfied! (dep)\n"; if (not foundSolution && IsCriticalDep) { - if (not propagateProctected) - { - StateCache &State = PkgState[Pkg->ID]; - RemoveSizes(Pkg); - RemoveStates(Pkg); - if (Pkg->CurrentVer != 0) - State.InstallVer = State.CandidateVer = Pkg.CurrentVer(); - else - State.InstallVer = State.CandidateVer = nullptr; - State.Mode = ModeKeep; - State.Update(Pkg, *this); - AddStates(Pkg); - Update(Pkg); - AddSizes(Pkg); - } - return false; + failedToInstallSomething = true; + if (not propagateProctected && not FromUser) + break; } } toInstall.clear(); - return true; + return not failedToInstallSomething; } /*}}}*/ // DepCache::MarkInstall - Put the package in the install state /*{{{*/ @@ -1330,52 +1534,65 @@ bool pkgDepCache::MarkInstall(PkgIterator const &Pkg, bool AutoInst, unsigned long Depth, bool FromUser, bool ForceImportantDeps) { - if (IsModeChangeOk(ModeInstall, Pkg, Depth, FromUser) == false) + StateCache &P = PkgState[Pkg->ID]; + if (P.Protect() && P.Keep() && P.CandidateVer != nullptr && P.CandidateVer == Pkg.CurrentVer()) + ; // we are here to mark our dependencies as protected, no state is changed + else if (not IsModeChangeOk(*this, ModeInstall, Pkg, Depth, FromUser, DebugMarker)) return false; - StateCache &P = PkgState[Pkg->ID]; // See if there is even any possible installation candidate if (P.CandidateVer == 0) return false; - /* Check that it is not already marked for install and that it can be - installed */ - if ((not P.InstPolicyBroken() && not P.InstBroken()) && - (P.Mode == ModeInstall || - P.CandidateVer == (Version *)Pkg.CurrentVer())) + // Check that it is not already marked for install and that it can be installed + if (not P.Protect() && not P.InstPolicyBroken() && not P.InstBroken()) { - if (P.CandidateVer == (Version *)Pkg.CurrentVer() && P.InstallVer == 0) - return MarkKeep(Pkg, false, FromUser, Depth + 1); - return true; + if (P.CandidateVer == Pkg.CurrentVer()) + { + if (P.InstallVer == 0) + return MarkKeep(Pkg, false, FromUser, Depth + 1); + return true; + } + else if (P.Mode == ModeInstall) + return true; } // check if we are allowed to install the package if (not IsInstallOk(Pkg, AutoInst, Depth, FromUser)) return false; + ActionGroup group(*this); + if (FromUser && not MarkInstall_StateChange(Pkg, AutoInst, FromUser)) + return false; + bool const AutoSolve = AutoInst && _config->Find("APT::Solver", "internal") == "internal"; + bool const failEarly = not P.Protect() && not FromUser; + bool hasFailed = false; std::vector<pkgCache::DepIterator> toInstall, toRemove; - APT::PackageVector toUpgrade; + APT::PackageVector toUpgrade, delayedRemove; if (AutoSolve) { VerIterator const PV = P.CandidateVerIter(*this); if (unlikely(PV.end())) return false; - if (not MarkInstall_CollectDependencies(PV, toInstall, toRemove)) + if (not MarkInstall_CollectDependencies(*this, PV, toInstall, toRemove)) return false; - if (not MarkInstall_RemoveConflictsIfNotUpgradeable(PV, Depth, toRemove, toUpgrade)) - return false; + if (not MarkInstall_RemoveConflictsIfNotUpgradeable(*this, DebugAutoInstall, PV, Depth, toRemove, toUpgrade, delayedRemove, P.Protect(), FromUser)) + { + if (failEarly) + return false; + hasFailed = true; + } } - ActionGroup group(*this); - if (not MarkInstall_StateChange(Pkg, AutoInst, FromUser)) + if (not FromUser && not MarkInstall_StateChange(Pkg, AutoInst, FromUser)) return false; if (not AutoSolve) - return true; + return not hasFailed; if (DebugMarker) std::clog << OutputInDepth(Depth) << "MarkInstall " << APT::PrettyPkg(this, Pkg) << " FU=" << FromUser << '\n'; @@ -1399,8 +1616,15 @@ bool pkgDepCache::MarkInstall(PkgIterator const &Pkg, bool AutoInst, operator bool() noexcept { return already; } } propagateProctected{PkgState[Pkg->ID]}; - if (not MarkInstall_UpgradeOrRemoveConflicts(propagateProctected, Depth, ForceImportantDeps, toUpgrade)) - return false; + if (not MarkInstall_UpgradeOrRemoveConflicts(*this, DebugAutoInstall, Depth, ForceImportantDeps, toUpgrade, propagateProctected, FromUser)) + { + if (failEarly) + { + MarkInstall_DiscardInstall(Pkg); + return false; + } + hasFailed = true; + } bool const MoveAutoBitToDependencies = [&]() { VerIterator const PV = P.InstVerIter(*this); @@ -1419,8 +1643,29 @@ bool pkgDepCache::MarkInstall(PkgIterator const &Pkg, bool AutoInst, }(); APT::PackageVector toMoveAuto; - if (not MarkInstall_InstallDependencies(Pkg, Depth, ForceImportantDeps, toInstall, MoveAutoBitToDependencies ? &toMoveAuto : nullptr, propagateProctected)) - return false; + if (not MarkInstall_InstallDependencies(*this, DebugAutoInstall, DebugMarker, Pkg, Depth, ForceImportantDeps, toInstall, + MoveAutoBitToDependencies ? &toMoveAuto : nullptr, propagateProctected, FromUser)) + { + if (failEarly) + { + MarkInstall_DiscardInstall(Pkg); + return false; + } + hasFailed = true; + } + + for (auto const &R : delayedRemove) + { + if (not MarkDelete(R, false, Depth, false)) + { + if (failEarly) + { + MarkInstall_DiscardInstall(Pkg); + return false; + } + hasFailed = true; + } + } if (MoveAutoBitToDependencies) { @@ -1435,7 +1680,7 @@ bool pkgDepCache::MarkInstall(PkgIterator const &Pkg, bool AutoInst, MarkAuto(InstPkg, false); } } - return true; + return not hasFailed; } /*}}}*/ // DepCache::IsInstallOk - check if it is ok to install this package /*{{{*/ @@ -1810,22 +2055,24 @@ void pkgDepCache::StateCache::Update(PkgIterator Pkg,pkgCache &Cache) { // Some info VerIterator Ver = CandidateVerIter(Cache); - + // Use a null string or the version string if (Ver.end() == true) CandVersion = ""; else CandVersion = Ver.VerStr(); - + // Find the current version - CurVersion = ""; if (Pkg->CurrentVer != 0) CurVersion = Pkg.CurrentVer().VerStr(); + else + CurVersion = ""; // Figure out if its up or down or equal - Status = Ver.CompareVer(Pkg.CurrentVer()); if (Pkg->CurrentVer == 0 || Pkg->VersionList == 0 || CandidateVer == 0) - Status = 2; + Status = 2; + else + Status = Ver.CompareVer(Pkg.CurrentVer()); } /*}}}*/ // Policy::GetCandidateVer - Returns the Candidate install version /*{{{*/ @@ -1975,7 +2222,7 @@ bool pkgDepCache::MarkRequired(InRootSetFunc &userFunc) reason = "Required"; else if (userFunc.InRootSet(P)) reason = "Blacklisted [APT::NeverAutoRemove]"; - else if (IsModeChangeOk(ModeGarbage, P, 0, false) == false) + else if (not IsModeChangeOk(*this, ModeGarbage, P, 0, false, DebugMarker)) reason = "Hold"; else continue; diff --git a/apt-pkg/depcache.h b/apt-pkg/depcache.h index 1579fedbe..78f88ba2f 100644 --- a/apt-pkg/depcache.h +++ b/apt-pkg/depcache.h @@ -368,6 +368,7 @@ class APT_PUBLIC pkgDepCache : protected pkgCache::Namespace inline StateCache &operator [](PkgIterator const &I) {return PkgState[I->ID];}; inline StateCache &operator [](PkgIterator const &I) const {return PkgState[I->ID];}; inline unsigned char &operator [](DepIterator const &I) {return DepState[I->ID];}; + inline unsigned char const &operator [](DepIterator const &I) const {return DepState[I->ID];}; /** \return A function identifying packages in the root set other * than manually installed packages and essential packages, or \b @@ -501,6 +502,8 @@ class APT_PUBLIC pkgDepCache : protected pkgCache::Namespace pkgDepCache(pkgCache * const Cache,Policy * const Plcy = 0); virtual ~pkgDepCache(); + bool CheckConsistency(char const *const msgtag = ""); + protected: // methods call by IsInstallOk bool IsInstallOkMultiArchSameVersionSynced(PkgIterator const &Pkg, @@ -515,14 +518,10 @@ class APT_PUBLIC pkgDepCache : protected pkgCache::Namespace private: void * const d; - APT_HIDDEN bool IsModeChangeOk(ModeList const mode, PkgIterator const &Pkg, - unsigned long const Depth, bool const FromUser); - APT_HIDDEN bool MarkInstall_StateChange(PkgIterator const &Pkg, bool AutoInst, bool FromUser); - APT_HIDDEN bool MarkInstall_CollectDependencies(pkgCache::VerIterator const &PV, std::vector<pkgCache::DepIterator> &toInstall, std::vector<pkgCache::DepIterator> &toRemove); - APT_HIDDEN bool MarkInstall_RemoveConflictsIfNotUpgradeable(pkgCache::VerIterator const &PV, unsigned long Depth, std::vector<pkgCache::DepIterator> &toRemove, APT::PackageVector &toUpgrade); - APT_HIDDEN bool MarkInstall_UpgradeOrRemoveConflicts(bool const propagateProtected, unsigned long Depth, bool const ForceImportantDeps, APT::PackageVector &toUpgrade); - APT_HIDDEN bool MarkInstall_InstallDependencies(PkgIterator const &Pkg, unsigned long Depth, bool const ForceImportantDeps, std::vector<pkgCache::DepIterator> &toInstall, APT::PackageVector *const toMoveAuto, bool const propagateProtected); + APT_HIDDEN bool MarkInstall_DiscardInstall(PkgIterator const &Pkg); + + APT_HIDDEN void PerformDependencyPass(OpProgress * const Prog); }; #endif diff --git a/apt-pkg/edsp.cc b/apt-pkg/edsp.cc index fe6f55dcb..7e3993be4 100644 --- a/apt-pkg/edsp.cc +++ b/apt-pkg/edsp.cc @@ -29,8 +29,10 @@ #include <sys/stat.h> #include <unistd.h> +#include <algorithm> #include <array> #include <limits> +#include <sstream> #include <string> #include <apti18n.h> @@ -119,19 +121,25 @@ static bool WriteScenarioDependency(FileFd &output, pkgCache::VerIterator const for (size_t i = 1; i < dependencies.size(); ++i) if (dependencies[i].empty() == false) WriteOkay(Okay, output, "\n", DepMap[i], ": ", dependencies[i]); - string provides; - for (pkgCache::PrvIterator Prv = Ver.ProvidesList(); Prv.end() == false; ++Prv) + std::vector<std::string> provides; + for (auto Prv = Ver.ProvidesList(); not Prv.end(); ++Prv) { - if (Prv.IsMultiArchImplicit() == true) + if (Prv.IsMultiArchImplicit()) continue; - if (provides.empty() == false) - provides.append(", "); - provides.append(Prv.Name()); + std::string provide = Prv.Name(); if (Prv->ProvideVersion != 0) - provides.append(" (= ").append(Prv.ProvideVersion()).append(")"); + provide.append(" (= ").append(Prv.ProvideVersion()).append(")"); + if ((Ver->MultiArch & pkgCache::Version::Foreign) != 0 && std::find(provides.cbegin(), provides.cend(), provide) != provides.cend()) + continue; + provides.emplace_back(std::move(provide)); + } + if (not provides.empty()) + { + std::ostringstream out; + std::copy(provides.begin(), provides.end() - 1, std::ostream_iterator<std::string>(out, ", ")); + out << provides.back(); + WriteOkay(Okay, output, "\nProvides: ", out.str()); } - if (provides.empty() == false) - WriteOkay(Okay, output, "\nProvides: ", provides); return WriteOkay(Okay, output, "\n"); } /*}}}*/ @@ -262,7 +270,7 @@ bool EDSP::WriteScenario(pkgDepCache &Cache, FileFd &output, OpProgress *Progres for (pkgCache::PkgIterator Pkg = Cache.PkgBegin(); Pkg.end() == false && likely(Okay); ++Pkg) { std::string const arch = Pkg.Arch(); - if (std::find(archs.begin(), archs.end(), arch) == archs.end()) + if (Pkg->CurrentVer == 0 && std::find(archs.begin(), archs.end(), arch) == archs.end()) continue; for (pkgCache::VerIterator Ver = Pkg.VersionList(); Ver.end() == false && likely(Okay); ++Ver, ++p) { @@ -335,9 +343,8 @@ bool EDSP::WriteRequest(pkgDepCache &Cache, FileFd &output, } bool Okay = WriteOkay(output, "Request: EDSP 0.5\n"); - const char *arch = _config->Find("APT::Architecture").c_str(); std::vector<string> archs = APT::Configuration::getArchitectures(); - WriteOkay(Okay, output, "Architecture: ", arch, "\n", + WriteOkay(Okay, output, "Architecture: ", _config->Find("APT::Architecture").c_str(), "\n", "Architectures:"); for (std::vector<string>::const_iterator a = archs.begin(); a != archs.end(); ++a) WriteOkay(Okay, output, " ", *a); @@ -858,9 +865,8 @@ bool EIPP::WriteRequest(pkgDepCache &Cache, FileFd &output, /*{{{*/ } bool Okay = WriteOkay(output, "Request: EIPP 0.1\n"); - const char *arch = _config->Find("APT::Architecture").c_str(); std::vector<string> archs = APT::Configuration::getArchitectures(); - WriteOkay(Okay, output, "Architecture: ", arch, "\n", + WriteOkay(Okay, output, "Architecture: ", _config->Find("APT::Architecture").c_str(), "\n", "Architectures:"); for (std::vector<string>::const_iterator a = archs.begin(); a != archs.end(); ++a) WriteOkay(Okay, output, " ", *a); diff --git a/apt-pkg/init.cc b/apt-pkg/init.cc index a619368ec..b9d9b15d2 100644 --- a/apt-pkg/init.cc +++ b/apt-pkg/init.cc @@ -134,18 +134,18 @@ bool pkgInitConfig(Configuration &Cnf) Cnf.CndSet("Dir","/"); // State - Cnf.CndSet("Dir::State", STATE_DIR + 1); + Cnf.CndSet("Dir::State", &STATE_DIR[1]); Cnf.CndSet("Dir::State::lists","lists/"); Cnf.CndSet("Dir::State::cdroms","cdroms.list"); // Cache - Cnf.CndSet("Dir::Cache", CACHE_DIR + 1); + Cnf.CndSet("Dir::Cache", &CACHE_DIR[1]); Cnf.CndSet("Dir::Cache::archives","archives/"); Cnf.CndSet("Dir::Cache::srcpkgcache","srcpkgcache.bin"); Cnf.CndSet("Dir::Cache::pkgcache","pkgcache.bin"); // Configuration - Cnf.CndSet("Dir::Etc", CONF_DIR + 1); + Cnf.CndSet("Dir::Etc", &CONF_DIR[1]); Cnf.CndSet("Dir::Etc::sourcelist","sources.list"); Cnf.CndSet("Dir::Etc::sourceparts","sources.list.d"); Cnf.CndSet("Dir::Etc::main","apt.conf"); @@ -162,7 +162,7 @@ bool pkgInitConfig(Configuration &Cnf) Cnf.CndSet("Dir::Media::MountPath","/media/apt"); // State - Cnf.CndSet("Dir::Log", LOG_DIR + 1); + Cnf.CndSet("Dir::Log", &LOG_DIR[1]); Cnf.CndSet("Dir::Log::Terminal","term.log"); Cnf.CndSet("Dir::Log::History","history.log"); Cnf.CndSet("Dir::Log::Planner","eipp.log.xz"); diff --git a/apt-pkg/pkgcache.cc b/apt-pkg/pkgcache.cc index 02448a073..7eb5ab10b 100644 --- a/apt-pkg/pkgcache.cc +++ b/apt-pkg/pkgcache.cc @@ -214,8 +214,6 @@ map_id_t pkgCache::sHash(StringView Str) const return Hash % HeaderP->GetHashTableSize(); } -#if defined(HAVE_FMV_SSE42_AND_CRC32) - #ifdef HAVE_FMV_SSE42_AND_CRC32 __attribute__((target("sse4.2"))) static uint32_t hash32(uint32_t crc32, const unsigned char *input, size_t size) { @@ -253,7 +251,6 @@ __attribute__((target("sse4.2"))) static uint32_t hash32(uint32_t crc32, const u crc32 ^= 0xffffffffU; return crc32; } -#endif __attribute__((target("default"))) #endif diff --git a/apt-pkg/tagfile-keys.list b/apt-pkg/tagfile-keys.list index a979a404b..a16bc686a 100644 --- a/apt-pkg/tagfile-keys.list +++ b/apt-pkg/tagfile-keys.list @@ -48,6 +48,7 @@ Package-Revision Package-Type Pre-Depends Priority +Protected Provides Recommended Recommends diff --git a/apt-pkg/tagfile-order.c b/apt-pkg/tagfile-order.c index 4c2068c00..bb199b32e 100644 --- a/apt-pkg/tagfile-order.c +++ b/apt-pkg/tagfile-order.c @@ -11,7 +11,7 @@ static const char *iTFRewritePackageOrder[] = { "Architecture", "Subarchitecture", // Used only by d-i "Version", - "Revision", // Obsolete (warning in dpkg) + "Revision", // Obsolete (warning in dpkg) "Package-Revision", // Obsolete (warning in dpkg) "Package_Revision", // Obsolete (warning in dpkg) "Kernel-Version", // Used only by d-i @@ -23,6 +23,7 @@ static const char *iTFRewritePackageOrder[] = { "Priority", "Class", // dpkg nickname for Priority "Build-Essential", + "Protected", "Essential", "Installer-Menu-Item", // Used only by d-i "Section", diff --git a/apt-private/private-search.cc b/apt-private/private-search.cc index b3f9469ac..b2114740e 100644 --- a/apt-private/private-search.cc +++ b/apt-private/private-search.cc @@ -42,7 +42,7 @@ static std::vector<pkgCache::DescIterator> const TranslatedDescriptionsList(pkgC Descriptions.push_back(Desc); } - if (Descriptions.empty()) + if (Descriptions.empty() && V.TranslatedDescription().IsGood()) Descriptions.push_back(V.TranslatedDescription()); return Descriptions; diff --git a/cmdline/apt-dump-solver.cc b/cmdline/apt-dump-solver.cc index 24a9f23eb..ab44b9fd1 100644 --- a/cmdline/apt-dump-solver.cc +++ b/cmdline/apt-dump-solver.cc @@ -134,11 +134,10 @@ int main(int argc,const char *argv[]) /*{{{*/ return WriteError("ERR_READ_ERROR", out, stdoutfd, Solver); } - constexpr size_t BufSize = 64 * 1024; - std::unique_ptr<char[]> Buf(new char[BufSize]); + std::unique_ptr<char[]> Buf(new char[APT_BUFFER_SIZE]); unsigned long long ToRead = 0; do { - if (input.Read(Buf.get(),BufSize, &ToRead) == false) + if (input.Read(Buf.get(), APT_BUFFER_SIZE, &ToRead) == false) { std::ostringstream out; out << "Writing EDSP solver input to file '" << filename << "' failed as reading from stdin failed!\n"; diff --git a/debian/changelog b/debian/changelog index aba34297b..c7651c4d6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,116 @@ +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) + + -- Julian Andres Klode <jak@debian.org> Wed, 08 Jul 2020 09:38:35 +0200 + +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 + + -- Julian Andres Klode <jak@debian.org> Wed, 03 Jun 2020 18:25:22 +0200 + +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) + + -- Julian Andres Klode <jak@debian.org> Tue, 26 May 2020 12:19:40 +0200 + +apt (2.1.4) unstable; urgency=medium + + [ David Kalnischkies ] + * Check satisfiability for versioned provides, not providing version + + -- Julian Andres Klode <jak@debian.org> Tue, 19 May 2020 11:28:59 +0200 + +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) + + -- Julian Andres Klode <jak@debian.org> Mon, 18 May 2020 22:23:27 +0200 + +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) + + -- Julian Andres Klode <jak@debian.org> Wed, 13 May 2020 22:04:47 +0200 + +apt (2.1.1) unstable; urgency=medium + + [ David Kalnischkies ] + * Allow aptitude to MarkInstall broken packages via FromUser + * Drop nowrap from po4a --porefs as it is no longer supported + * Use "po4a --porefs file" instead of undocumented compat noline + + [ Artur Grącki ] + * Fix typo in Polish translation of --help messages + + -- Julian Andres Klode <jak@debian.org> Fri, 08 May 2020 18:02:53 +0200 + apt (2.1.0) unstable; urgency=medium [ Frans Spiesschaert ] diff --git a/doc/apt-verbatim.ent b/doc/apt-verbatim.ent index 85a52ffd1..c691d1de8 100644 --- a/doc/apt-verbatim.ent +++ b/doc/apt-verbatim.ent @@ -274,7 +274,7 @@ "> <!-- this will be updated by 'prepare-release' --> -<!ENTITY apt-product-version "2.1.0"> +<!ENTITY apt-product-version "2.1.7"> <!-- (Code)names for various things used all over the place --> <!ENTITY debian-oldstable-codename "stretch"> diff --git a/doc/examples/configure-index b/doc/examples/configure-index index 497483ccc..f04e32502 100644 --- a/doc/examples/configure-index +++ b/doc/examples/configure-index @@ -558,6 +558,7 @@ Debug pkgCacheGen { Essential "<STRING>"; // native,all, none, installed + Protected "<STRING>"; // native,all, none, installed ForceEssential "<STRING_OR_LIST>"; // package names ForceImportant "<LIST>"; // package names }; @@ -586,6 +587,7 @@ pkgProblemResolver::Scores AddEssential "<INT>"; }; pkgProblemResolver::FixByInstall "<BOOL>"; +pkgProblemResolver::MaxCounter "<INT>"; APT::FTPArchive::release { diff --git a/doc/po/apt-doc.pot b/doc/po/apt-doc.pot index 770980cd1..f0bf7bdf1 100644 --- a/doc/po/apt-doc.pot +++ b/doc/po/apt-doc.pot @@ -5,9 +5,9 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: apt-doc 2.1.0\n" +"Project-Id-Version: apt-doc 2.1.7\n" "Report-Msgid-Bugs-To: APT Development Team <deity@lists.debian.org>\n" -"POT-Creation-Date: 2020-05-04 15:59+0200\n" +"POT-Creation-Date: 2020-07-08 09:40+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" diff --git a/doc/po/nl.po b/doc/po/nl.po index 96097127d..53145ebae 100644 --- a/doc/po/nl.po +++ b/doc/po/nl.po @@ -4,10 +4,10 @@ # msgid "" msgstr "" -"Project-Id-Version: apt-doc 2.2.0\n" +"Project-Id-Version: apt-doc 2.1.4\n" "Report-Msgid-Bugs-To: APT Development Team <deity@lists.debian.org>\n" -"POT-Creation-Date: 2020-05-04 15:59+0200\n" -"PO-Revision-Date: 2020-03-16 21:20+0100\n" +"POT-Creation-Date: 2020-05-24 21:07+0200\n" +"PO-Revision-Date: 2020-05-24 16:39+0200\n" "Last-Translator: Frans Spiesschaert <Frans.Spiesschaert@yucom.be>\n" "Language-Team: Debian Dutch l10n Team <debian-l10n-dutch@lists.debian.org>\n" "Language: nl\n" @@ -780,12 +780,6 @@ msgstr "," #. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para> #: apt.8.xml -#, fuzzy -#| msgid "" -#| "Performs the requested action on one or more packages specified via " -#| "®ex;, &glob; or exact match. The requested action can be overridden " -#| "for specific packages by append a plus (+) to the package name to install " -#| "this package or a minus (-) to remove it." msgid "" "Performs the requested action on one or more packages specified via ®ex;, " "&glob; or exact match. The requested action can be overridden for specific " @@ -11537,10 +11531,6 @@ msgstr "<code>?narrow(PATROON...)</code>" #. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para> #: apt-patterns.7.xml -#, fuzzy -#| msgid "" -#| "Selects any version matching all PATTERNs, short for<code>?any-version(?" -#| "and(PATTERN...))</code>." msgid "" "Selects any version matching all PATTERNs, short for <code>?any-version(?" "and(PATTERN...))</code>." @@ -11869,10 +11859,6 @@ msgstr "<code>~VREGEX</code>" #. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para> #: apt-patterns.7.xml -#, fuzzy -#| msgid "" -#| "Selects versions where the version string matching the specified regular " -#| "expression." msgid "" "Selects versions where the version string matches the specified regular " "expression." diff --git a/doc/po/pt.po b/doc/po/pt.po index 8bf531370..1d30c9b31 100644 --- a/doc/po/pt.po +++ b/doc/po/pt.po @@ -2,13 +2,13 @@ # Copyright (C) 2009 Free Software Foundation, Inc. # This file is distributed under the same license as the apt package. # -# Américo Monteiro <a_monteiro@gmx.com>, 2014 - 2017, 2019. +# Américo Monteiro <a_monteiro@gmx.com>, 2014 - 2020. msgid "" msgstr "" -"Project-Id-Version: apt 1.8.0\n" +"Project-Id-Version: apt 2.1.6\n" "Report-Msgid-Bugs-To: APT Development Team <deity@lists.debian.org>\n" -"POT-Creation-Date: 2020-02-26 21:29+0100\n" -"PO-Revision-Date: 2019-04-07 22:02+0000\n" +"POT-Creation-Date: 2020-06-14 10:17+0200\n" +"PO-Revision-Date: 2020-06-08 17:06+0000\n" "Last-Translator: Américo Monteiro <a_monteiro@gmx.com>\n" "Language-Team: Portuguese <>\n" "Language: pt\n" @@ -460,7 +460,7 @@ msgid "" msgstr "" "<!-- TRANSLATOR: This is the section header for the following paragraphs - comparable\n" " to the other headers like NAME and DESCRIPTION and should therefore be uppercase. -->\n" -"<!ENTITY translation-title \"TRADUÇÂO\">\n" +"<!ENTITY translation-title \"TRADUÇÃO\">\n" #. type: Plain text #: apt.ent @@ -774,8 +774,8 @@ msgstr "," msgid "" "Performs the requested action on one or more packages specified via ®ex;, " "&glob; or exact match. The requested action can be overridden for specific " -"packages by appending a plus (+) to the package name to install this package or " -"a minus (-) to remove it." +"packages by appending a plus (+) to the package name to install this package " +"or a minus (-) to remove it." msgstr "" "Executa a acção requisitada em um ou mais pacotes especificados via ®ex;, " "&glob; ou por correspondência exacta. A acção requisitada pode ser " @@ -793,12 +793,12 @@ msgid "" "testing, unstable). This will also select versions from this release for " "dependencies of this package if needed to satisfy the request." msgstr "" -"Pode ser seleccionada para instalação uma versão específica de um pacote ao " +"Pode ser selecionada para instalação uma versão específica de um pacote ao " "adicionar ao nome do pacote o símbolo igual (=) e a versão do pacote a " -"seleccionar. Alternativamente a versão de um lançamento específico pode ser " -"seleccionada ao adicionar ao nome do pacote uma barra de divisão (/) e o " -"nome de código (&debian-stable-codename;, &debian-testing-codename;, sid …) " -"ou o nome de suite (stable, testing, unstable). Isto irá também seleccionar " +"selecionar. Alternativamente a versão de um lançamento específico pode ser " +"selecionada ao adicionar ao nome do pacote uma barra de divisão (/) e o nome " +"de código (&debian-stable-codename;, &debian-testing-codename;, sid …) ou o " +"nome de suite (stable, testing, unstable). Isto irá também selecionar " "versões a partir deste lançamento para as dependências deste pacote se " "necessário para satisfazer o pedido." @@ -857,6 +857,9 @@ msgid "" "Depends. It also handles conflicts, by prefixing an argument with <literal>" "\"Conflicts: \"</literal>." msgstr "" +"<option>satisfy</option> satisfaz strings de dependências, como usado em " +"Build-Depends. Também lida com conflitos, ao prefixar um argumento com " +"<literal>\"Conflicts: \"</literal>." #. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para> #: apt.8.xml @@ -864,6 +867,8 @@ msgid "" "Example: <literal>apt satisfy \"foo, bar (>= 1.0)\" \"Conflicts: baz, fuzz" "\"</literal>" msgstr "" +"Exemplo: <literal>apt satisfy \"foo, bar (>= 1.0)\" \"Conflicts: baz, fuzz" +"\"</literal>" #. type: Content of: <refentry><refsect1><variablelist><varlistentry><term> #: apt.8.xml @@ -1160,12 +1165,12 @@ msgid "" "package name with a slash and the version of the distribution or the Archive " "name (stable, testing, unstable)." msgstr "" -"Pode ser seleccionada para instalação uma versão específica de um pacote ao " +"Pode ser selecionada para instalação uma versão específica de um pacote ao " "continuar o nome do pacote com um igual (=) e a versão do pacote a " -"seleccionar. Isto irá fazer com que essa versão seja localizada e " -"seleccionada para instalação. Alternativamente pode ser seleccionada uma " -"distribuição específica ao continuar o nome do pacote com uma slash (/) e a " -"versão da distribuição ou o nome de Arquivo (stable, testing, unstable)." +"selecionar. Isto irá fazer com que essa versão seja localizada e selecionada " +"para instalação. Alternativamente pode ser selecionada uma distribuição " +"específica ao continuar o nome do pacote com uma slash (/) e a versão da " +"distribuição ou o nome de Arquivo (stable, testing, unstable)." #. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para> #: apt-get.8.xml @@ -1231,6 +1236,9 @@ msgid "" "in &apt;, except for anchored expressions, and will be removed from &apt-" "get; in a future version. Use &apt-patterns; instead." msgstr "" +"O cair (fallback) para expressões regulares está descontinuado no APT 2.0, " +"foi removido no &apt;, excepto para expressões ancoradas, irá ser removido " +"do &apt-get; numa versão futura. Use &apt-patterns; em vez disto." #. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para> #: apt-get.8.xml @@ -1384,6 +1392,12 @@ msgid "" "with <literal>\"Conflicts: \"</literal> to unsatisfy the dependency string. " "Multiple strings of the same type can be specified." msgstr "" +"<literal>satisfy</literal> faz o apt-get satisfazer as strings de " +"dependências fornecidas. As strings de dependências podem ter perfiles de " +"compilação e listas de restrição de arquitecturas como dependem de " +"compilação. Podem opcionalmente ser prefixadas com <literal>\"Conflicts: \"</" +"literal> para satisfazer a string de dependência. Podem ser especificadas " +"várias strings do mesmo tipo." #. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para> #: apt-get.8.xml @@ -1391,12 +1405,16 @@ msgid "" "Example: <literal>apt-get satisfy \"foo\" \"Conflicts: bar\" \"baz (>> " "1.0) | bar (= 2.0), moo\"</literal>" msgstr "" +"Exemplo: <literal>apt-get satisfy \"foo\" \"Conflicts: bar\" \"baz (>> " +"1.0) | bar (= 2.0), moo\"</literal>" #. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para> #: apt-get.8.xml msgid "" "The legacy operator '</>' is not supported, use '<=/>=' instead." msgstr "" +"O operador antigo '</>' não é suportado, use '<=/>=' em vez " +"disto." #. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para> #: apt-get.8.xml @@ -1584,7 +1602,7 @@ msgstr "" "verificação de integridade após obtenção (ficheiros de pacotes corrompidos), " "retêm esses pacotes e manuseia o resultado. Usar esta opção em conjunto com " "<option>-f</option> pode produzir erros em algumas situações. Se um pacote " -"for seleccionado para instalação (particularmente se for mencionado na linha " +"for selecionado para instalação (particularmente se for mencionado na linha " "de comandos) e não pode ser descarregado estão será segurado em silêncio. " "Item de Configuração: <literal>APT::Get::Fix-Missing</literal>." @@ -1732,7 +1750,7 @@ msgstr "" "fonte é compilado por <command>apt-get source --compile</command> e como as " "dependências de compilação são satisfeitas. Por predefinição, nenhum perfil " "de compilação está activo. Podem ser activados ao mesmo tempo mais do que um " -"perfil de compilação ao concatená-los com uma vírgula. Item de configuração: " +"perfil de compilação ao concatena-los com uma vírgula. Item de configuração: " "<literal>APT::Build-Profiles</literal>." #. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para> @@ -1812,7 +1830,7 @@ msgid "" msgstr "" "Esta é uma opção perigosa que irá fazer com que o apt continue sem avisar " "quando está a instalar versões anteriores (downgrades) Não deve ser usado " -"excepto em situações muito especiais. Usá-lo pode potencialmente destruir o " +"excepto em situações muito especiais. Usa-lo pode potencialmente destruir o " "seu sistema! Item de Configuração: <literal>APT::Get::allow-downgrades</" "literal>. introduzido no APT 1.1." @@ -1827,7 +1845,7 @@ msgid "" msgstr "" "Força o sim; Esta é uma opção perigosa que irá fazer com que o apt continue " "sem avisar quando está a remover coisas essenciais. Não deve ser usado " -"excepto em situações muito especiais. Usá-lo pode potencialmente destruir o " +"excepto em situações muito especiais. Usa-lo pode potencialmente destruir o " "seu sistema! Item de Configuração: <literal>APT::Get::allow-remove-" "essential</literal>. Introduzido no APT 1.1." @@ -1842,7 +1860,7 @@ msgid "" msgstr "" "Força o sim; Esta é uma opção perigosa que irá fazer com que o apt continue " "sem avisar se estiver a alterar pacotes segurados. Não deve ser usado " -"excepto em situações muito especiais. Usá-lo pode destruir potencialmente o " +"excepto em situações muito especiais. Usa-lo pode destruir potencialmente o " "seu sistema! Item de Configuração: <literal>APT::Get::allow-change-held-" "packages</literal>. Introduzido em APT 1.1." @@ -2611,8 +2629,8 @@ msgid "" "cache used by all operations. Configuration Item: <literal>Dir::Cache::" "pkgcache</literal>." msgstr "" -"Selecciona o ficheiro para armazenar a cache do pacote. A cache do pacote é " -"a cache principal usada por todas as operações. Item de Configuração: " +"Seleciona o ficheiro para armazenar a cache do pacote. A cache do pacote é a " +"cache principal usada por todas as operações. Item de Configuração: " "<literal>Dir::Cache::pkgcache</literal>." #. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para> @@ -2624,8 +2642,8 @@ msgid "" "cache is used to avoid reparsing all of the package files. Configuration " "Item: <literal>Dir::Cache::srcpkgcache</literal>." msgstr "" -"Selecciona o ficheiro para armazenar a cache de fonte. A fonte é usada " -"apenas pelo <literal>gencaches</literal> e armazena uma versão analisada da " +"Seleciona o ficheiro para armazenar a cache de fonte. A fonte é usada apenas " +"pelo <literal>gencaches</literal> e armazena uma versão analisada da " "informação do pacote a partir de fontes remotas. Ao construir a cache de " "pacote é usada a cache fonte para evitar reanalisar todos os ficheiros do " "pacote. Item de Configuração: <literal>Dir::Cache::srcpkgcache</literal>." @@ -2711,8 +2729,8 @@ msgstr "" "Escreve registos completos para todas as versões disponíveis. Isto é a " "predefinição; para a desligar, use <option>--no-all-versions</option>. Se " "<option>--no-all-versions</option> for especificada, apenas a versão " -"candidata será mostrada (aquela que seria seleccionada para instalação). " -"Esta opção é aplicável apenas ao comando <literal>show</literal>. Item de " +"candidata será mostrada (aquela que seria selecionada para instalação). Esta " +"opção é aplicável apenas ao comando <literal>show</literal>. Item de " "Configuração: <literal>APT::Cache::AllVersions</literal>." #. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para> @@ -3466,7 +3484,7 @@ msgstr "" "<literal>Ataques de rede \"man in the middle\"</literal>. Sem verificação de " "assinatura, um agente malicioso pode introduzir-se ele próprio no processo " "de descarga de pacotes e disponibilizar software malicioso seja ao controlar " -"um elemento de rede (router, switch, etc.) ou ao redireccionar tráfego para " +"um elemento de rede (router, switch, etc.) ou ao redirecionar tráfego para " "um servidor impostor (através de ataques de fraude de ARP ou DNS)." #. type: Content of: <refentry><refsect1><itemizedlist><listitem><para> @@ -5169,7 +5187,7 @@ msgid "" "\"true\"." msgstr "" "Esta opção controla se o apt irá usar o registo do servidor DNS SRV como " -"especificado em RFC 2782 para seleccionar um servidor alternativo a onde " +"especificado em RFC 2782 para selecionar um servidor alternativo a onde " "ligar: A predefinição é \"true\"." #. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para> @@ -6111,7 +6129,7 @@ msgstr "" "O ficheiro de preferências do APT <filename>/etc/apt/preferences</filename> " "e os ficheiros fragmentados no directório <filename>/etc/apt/preferences.d/</" "filename> podem ser usados para controlar quais as versões de pacotes irão " -"ser seleccionadas para instalação." +"ser selecionadas para instalação." #. type: Content of: <refentry><refsect1><para> #: apt_preferences.5.xml @@ -6129,10 +6147,10 @@ msgstr "" "ficheiro &sources-list; contém referências a mais do que uma distribuição " "(por exemplo, <literal>stable</literal> e <literal>testing</literal>). O APT " "atribui uma prioridade a cada versão que está disponível. Sujeito a " -"constrangimentos de dependências, o <command>apt-get</command> selecciona a " +"constrangimentos de dependências, o <command>apt-get</command> seleciona a " "versão com a prioridade mais alta para instalação. As preferências do APT " "sobrepõem as prioridades que o APT atribui às versões de pacotes por " -"predefinição, assim dando controle ao utilizador sobre qual é seleccionado " +"predefinição, assim dando controle ao utilizador sobre qual é selecionado " "para instalação." #. type: Content of: <refentry><refsect1><para> @@ -6717,7 +6735,7 @@ msgstr "" #. type: Content of: <refentry><refsect1><refsect2><title> #: apt_preferences.5.xml msgid "Pinning by source package" -msgstr "" +msgstr "Fixação pelo pacote de origem" #. type: Content of: <refentry><refsect1><refsect2><para> #: apt_preferences.5.xml @@ -6725,6 +6743,8 @@ msgid "" "APT supports pinning by source packages. To pin by a source package, prepend " "\"src:\" to the package name." msgstr "" +"O APT suporta fixar pelo pacote fonte. Para fixar um pacote fonte, preceda " +"\"src:\" ao nome do pacote." #. type: Content of: <refentry><refsect1><refsect2><para> #: apt_preferences.5.xml @@ -6732,22 +6752,20 @@ msgid "" "For example, to pin all binaries produced by the apt source package of this " "APT's version to 990, you can do:" msgstr "" +"Por exemplo, para fixar todos os binários produzidos pelo pacote fonte do " +"apt desta versão do APT para 990, você pode fazer:" #. type: Content of: <refentry><refsect1><refsect2><programlisting> #: apt_preferences.5.xml -#, fuzzy, no-wrap -#| msgid "" -#| "Package: perl\n" -#| "Pin: version &good-perl;*\n" -#| "Pin-Priority: 1001\n" +#, no-wrap msgid "" "Package: src:apt\n" "Pin: version &apt-product-version;\n" "Pin-Priority: 990\n" msgstr "" -"Package: perl\n" -"Pin: version &good-perl;*\n" -"Pin-Priority: 1001\n" +"Package: src:apt\n" +"Pin: version &apt-product-version;\n" +"Pin-Priority: 990\n" #. type: Content of: <refentry><refsect1><refsect2><para> #: apt_preferences.5.xml @@ -6755,6 +6773,8 @@ msgid "" "Source package pinning can be combined with regular expressions and glob " "patterns, and can also take a binary architecture." msgstr "" +"A fixação de pacote fonte pode ser combinada com expressões regulares e " +"padrões glob, e também podem tomar uma arquitectura binária." #. type: Content of: <refentry><refsect1><refsect2><para> #: apt_preferences.5.xml @@ -6762,22 +6782,20 @@ msgid "" "For example, let's pin all binaries for all architectures produced by any " "source package containing apt in its name to 990:" msgstr "" +"Por exemplo, vamos fixar todos os binários para todas as arquitecturas " +"produzidas por qualquer pacote fonte que contenha apt no seu nome para 990:" #. type: Content of: <refentry><refsect1><refsect2><programlisting> #: apt_preferences.5.xml -#, fuzzy, no-wrap -#| msgid "" -#| "Package: *\n" -#| "Pin: origin \"\"\n" -#| "Pin-Priority: 999\n" +#, no-wrap msgid "" "Package: src:*apt*:any\n" "Pin: version *\n" "Pin-Priority: 990\n" msgstr "" -"Package: *\n" -"Pin: origin \"\"\n" -"Pin-Priority: 999\n" +"Package: src:*apt*:any\n" +"Pin: version *\n" +"Pin-Priority: 990\n" #. type: Content of: <refentry><refsect1><refsect2><title> #: apt_preferences.5.xml @@ -6980,7 +6998,7 @@ msgid "" msgstr "" "Uma versão de um pacote cuja origem não é o sistema local mas qualquer outro " "site listado em &sources-list; e o qual pertence a uma distribuição " -"<literal>unstable</literal> apenas é instalado se for seleccionado para " +"<literal>unstable</literal> apenas é instalado se for selecionado para " "instalação e se nenhuma versão do pacote já estiver instalada." #. type: Content of: <refentry><refsect1><refsect2><title> @@ -8131,14 +8149,14 @@ msgstr "" "ficheiros de chaveiro (têm de estar acessíveis e legíveis para o utilizador " "do sistema <literal>_apt</literal>, portanto assegure que todos têm " "permissões de leitura ao ficheiro) e impressões digitais de chaves para " -"seleccionar a partir destes chaveiros. Se não forem especificados nenhuns " +"selecionar a partir destes chaveiros. Se não forem especificados nenhuns " "ficheiros chaveiro, o predefinido é o chaveiro <filename>trusted.gpg</" "filename> e todos os chaveiros no directório <filename>trusted.gpg.d/</" "filename> (veja <command>apt-key fingerprint</command>). Se não for " -"especificada nenhuma impressão digital, são seleccionadas todas as chaves " -"nos chaveiros. Uma impressão digital irá também aceitar todas as assinaturas " -"por uma sub-chave dessa chave. Se isto não for desejado pode ser adicionado " -"um ponto de exclamação (<literal>!</literal>) à impressão digital para " +"especificada nenhuma impressão digital, são selecionadas todas as chaves nos " +"chaveiros. Uma impressão digital irá também aceitar todas as assinaturas por " +"uma sub-chave dessa chave. Se isto não for desejado pode ser adicionado um " +"ponto de exclamação (<literal>!</literal>) à impressão digital para " "desactivar este comportamento. A opção usa por predefinição o valor da opção " "com o mesmo nome se for definida no ficheiro <filename>Release</filename> " "previamente adquirido deste repositório (apenas impressões digitais podem " @@ -9775,7 +9793,7 @@ msgid "" "command. Configuration Item: <literal>APT::FTPArchive::SourceOverride</" "literal>." msgstr "" -"Selecciona o ficheiro de sobreposição de fonte a usar com o comando " +"Seleciona o ficheiro de sobreposição de fonte a usar com o comando " "<literal>sources</literal>. Item de Configuração: <literal>APT::FTPArchive::" "SourceOverride</literal>." @@ -9925,17 +9943,14 @@ msgstr "" #. type: Content of: <refentry><refsect1><variablelist><varlistentry><term> #: apt_auth.conf.5.xml -#, fuzzy -#| msgid "" -#| "<literal>machine</literal> <replaceable>hostname</replaceable>[:" -#| "<replaceable>port</replaceable>][/<replaceable>path</replaceable>]" msgid "" "<literal>machine</literal> <replaceable>[protocol://]</" "replaceable><replaceable>hostname</replaceable>[:<replaceable>port</" "replaceable>][/<replaceable>path</replaceable>]" msgstr "" -"<literal>machine</literal> <replaceable>nome-de-máquina</replaceable>[:" -"<replaceable>porto</replaceable>][/<replaceable>caminho</replaceable>]" +"<literal>machine</literal> <replaceable>[protocolo://]</" +"replaceable><replaceable>nome-de-máquina</replaceable>[:<replaceable>porto</" +"replaceable>][/<replaceable>caminho</replaceable>]" #. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para> #: apt_auth.conf.5.xml @@ -9968,6 +9983,8 @@ msgstr "" msgid "" "If protocol is not specified, the entry only matches https and tor+https." msgstr "" +"Se o protocolo não for especificado, a entrada apenas coincide com https e " +"tor+https." #. type: Content of: <refentry><refsect1><variablelist><varlistentry><term> #: apt_auth.conf.5.xml @@ -9996,17 +10013,15 @@ msgstr "Exemplo" #. type: Content of: <refentry><refsect1><para><literallayout> #: apt_auth.conf.5.xml -#, fuzzy, no-wrap -#| msgid "deb http://example.org/debian &debian-stable-codename; main" +#, no-wrap msgid "deb https://example.org/debian &debian-stable-codename; main" -msgstr "deb http://example.org/debian &debian-stable-codename; main" +msgstr "deb https://example.org/debian &debian-stable-codename; main" #. type: Content of: <refentry><refsect1><para><literallayout> #: apt_auth.conf.5.xml -#, fuzzy, no-wrap -#| msgid "deb http://apt:debian@example.org/debian &debian-stable-codename; main" +#, no-wrap msgid "deb https://apt:debian@example.org/debian &debian-stable-codename; main" -msgstr "deb http://apt:debian@example.org/debian &debian-stable-codename; main" +msgstr "deb https://apt:debian@example.org/debian &debian-stable-codename; main" #. type: Content of: <refentry><refsect1><para><literallayout> #: apt_auth.conf.5.xml @@ -10040,13 +10055,7 @@ msgstr "" #. type: Content of: <refentry><refsect1><para><literallayout> #: apt_auth.conf.5.xml -#, fuzzy, no-wrap -#| msgid "" -#| "machine example.org:80 login apt password debian\n" -#| "machine example.org/deb/ login apt password debian\n" -#| "machine example.org/ubuntu login apt password debian\n" -#| "machine example.orga login apt password debian\n" -#| "machine example.net login apt password debian\n" +#, no-wrap msgid "" "machine example.org:443 login apt password debian\n" "machine example.org/deb/ login apt password debian\n" @@ -10054,7 +10063,7 @@ msgid "" "machine example.orga login apt password debian\n" "machine example.net login apt password debian\n" msgstr "" -"machine example.org:80 login apt password debian\n" +"machine example.org:443 login apt password debian\n" "machine example.org/deb/ login apt password debian\n" "machine example.org/ubuntu login apt password debian\n" "machine example.orga login apt password debian\n" @@ -10117,6 +10126,11 @@ msgid "" "only, or if the sources.list entry redirects elsewhere, login information " "for the redirect destination can be supplied." msgstr "" +"As informações de Login em auth.conf são mais flexíveis que aquelas em " +"sources.list. Por exemplo, a informação de login pode ser especificada para " +"apenas partes de um repositório, ou se a entrada de sources.list " +"redirecionar para outro lado, pode ser fornecida informação de login para o " +"destino do redirecionamento." #. type: Content of: <refentry><refsect1><variablelist><varlistentry><term> #: apt_auth.conf.5.xml @@ -10389,7 +10403,7 @@ msgid "" "follow redirects, which is enabled by default." msgstr "" "<literal>Acquire::http::AllowRedirect</literal> controla se o APT irá seguir " -"os redireccionamentos, o que está activo por predefinição." +"os redirecionamentos, o que está activo por predefinição." #. type: Content of: <refentry><refsect1><refsect2><para> #: apt-transport-http.1.xml @@ -10709,7 +10723,7 @@ msgid "" msgstr "" "Este transporte do APT não está por si só a implementar um protocolo para " "aceder a repositórios locais ou remotos, mas obtêm uma mirrorlist e " -"redirecciona todos os pedidos para os mirro(s) retirados dessa lista, " +"redireciona todos os pedidos para os mirro(s) retirados dessa lista, " "acedendo a eles via outros transportes como &apt-transport-http;. A " "funcionalidade básica esteve disponível desde o apt 0.7.24, mas não esteve " "documentada até ao apt 1.6 o qual continha uma reconstrução do transporte e " @@ -10823,7 +10837,7 @@ msgid "" "literal>) and type of the file (<literal>type</literal>)." msgstr "" "Como especificado no formato, um mirror pode ter meta-dados adicionais " -"acrescentados para impedir que um mirror seja seleccionado para obter um " +"acrescentados para impedir que um mirror seja selecionado para obter um " "ficheiro que não corresponda a esses meta-dados. Deste modo a mirrorlist " "pode por exemplo conter mirrors parciais que servem apenas certas " "arquitecturas e o APT irá automaticamente escolher um mirror diferente para " @@ -11036,12 +11050,12 @@ msgstr "" #. type: Content of: <refentry><refmeta><manvolnum> #: apt-patterns.7.xml msgid "7" -msgstr "" +msgstr "7" #. type: Content of: <refentry><refnamediv><refpurpose> #: apt-patterns.7.xml msgid "Syntax and semantics of apt search patterns" -msgstr "" +msgstr "Sintaxe e semânticas dos padrões do apt search" #. type: Content of: <refentry><refsect1><para> #: apt-patterns.7.xml @@ -11049,11 +11063,13 @@ msgid "" "Starting with version 2.0, <command>APT</command> provides support for " "patterns, which can be used to query the apt cache for packages." msgstr "" +"A partir da versão 2.0, o <command>APT</command> disponibiliza suporte para " +"padrões, o que pode ser usado para pesquisar a cache do apt por pacotes." #. type: Content of: <refentry><refsect1><title> #: apt-patterns.7.xml msgid "Logic patterns" -msgstr "" +msgstr "Padrões de lógica" #. type: Content of: <refentry><refsect1><para> #: apt-patterns.7.xml @@ -11062,86 +11078,90 @@ msgid "" "complex expressions, as well as <code>?true</code> and <code>?false</code> " "patterns." msgstr "" +"Estes padrões fornecem os meios básicos para combinar outros padrões em " +"expressões mais complexas, assim como padrões <code>?true</code> e <code>?" +"false</code>." #. type: Content of: <refentry><refsect1><variablelist><varlistentry><term> #: apt-patterns.7.xml msgid "<code>?and(PATTERN, PATTERN, ...)</code>" -msgstr "" +msgstr "<code>?and(PATTERN, PATTERN, ...)</code>" #. type: Content of: <refentry><refsect1><variablelist><varlistentry><term> #: apt-patterns.7.xml msgid "<code>PATTERN PATTERN ...</code>" -msgstr "" +msgstr "<code>PATTERN PATTERN ...</code>" #. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para> #: apt-patterns.7.xml msgid "Selects objects where all specified patterns match." -msgstr "" +msgstr "Seleciona objectos onde coincidem todos os padrões especificados." #. type: Content of: <refentry><refsect1><variablelist><varlistentry><term> #: apt-patterns.7.xml msgid "<code>?false</code>" -msgstr "" +msgstr "<code>?false</code>" #. type: Content of: <refentry><refsect1><variablelist><varlistentry><term> #: apt-patterns.7.xml msgid "<code>~F</code>" -msgstr "" +msgstr "<code>~F</code>" #. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para> #: apt-patterns.7.xml msgid "Selects nothing." -msgstr "" +msgstr "Não seleciona nada." #. type: Content of: <refentry><refsect1><variablelist><varlistentry><term> #: apt-patterns.7.xml msgid "<code>?not(PATTERN)</code>" -msgstr "" +msgstr "<code>?not(PATTERN)</code>" #. type: Content of: <refentry><refsect1><variablelist><varlistentry><term> #: apt-patterns.7.xml msgid "<code>!PATTERN</code>" -msgstr "" +msgstr "<code>!PATTERN</code>" #. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para> #: apt-patterns.7.xml msgid "Selects objects where PATTERN does not match." -msgstr "" +msgstr "Seleciona objectos onde PATTERN não coincide." #. type: Content of: <refentry><refsect1><variablelist><varlistentry><term> #: apt-patterns.7.xml msgid "<code>?or(PATTERN, PATTERN, ...)</code>" -msgstr "" +msgstr "<code>?or(PATTERN, PATTERN, ...)</code>" #. type: Content of: <refentry><refsect1><variablelist><varlistentry><term> #: apt-patterns.7.xml msgid "<code>PATTERN | PATTERN | ...</code>" -msgstr "" +msgstr "<code>PATTERN | PATTERN | ...</code>" #. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para> #: apt-patterns.7.xml msgid "Selects objects where at least one of the specified patterns match." msgstr "" +"Seleciona objectos onde pelo menos um dos padrões especificados coincide." #. type: Content of: <refentry><refsect1><variablelist><varlistentry><term> #: apt-patterns.7.xml msgid "<code>?true</code>" -msgstr "" +msgstr "<code>?true</code>" #. type: Content of: <refentry><refsect1><variablelist><varlistentry><term> #: apt-patterns.7.xml msgid "<code>~T</code>" -msgstr "" +msgstr "<code>~T</code>" #. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para> #: apt-patterns.7.xml msgid "Selects all objects." -msgstr "" +msgstr "Seleciona todos os objectos." #. type: Content of: <refentry><refsect1><variablelist><varlistentry><term> #: apt-patterns.7.xml msgid "<code>(PATTERN)</code>" -msgstr "" +msgstr "<code>(PATTERN)</code>" #. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para> #: apt-patterns.7.xml @@ -11149,16 +11169,18 @@ msgid "" "Selects the same as <code>PATTERN</code>, can be used to work around " "precedence, for example, <code>(~ramd64|~ri386)~nfoo</code>" msgstr "" +"Seleciona o mesmo que <code>PATTERN</code>, pode ser usado para contornar " +"precedência, por exemplo, <code>(~ramd64|~ri386)~nfoo</code>" #. type: Content of: <refentry><refsect1><title> #: apt-patterns.7.xml msgid "Narrowing patterns" -msgstr "" +msgstr "Estreitar padrões" #. type: Content of: <refentry><refsect1><variablelist><varlistentry><term> #: apt-patterns.7.xml msgid "<code>?all-versions(PATTERN)</code>" -msgstr "" +msgstr "<code>?all-versions(PATTERN)</code>" #. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para> #: apt-patterns.7.xml @@ -11166,16 +11188,18 @@ msgid "" "Selects packages where all versions match PATTERN. When matching versions " "instead, same as PATTERN." msgstr "" +"Seleciona pacotes onde todas as versões coincidem com PATTERN. Quando em vez " +"disso coincide versões, o mesmo que PATTERN." #. type: Content of: <refentry><refsect1><variablelist><varlistentry><term> #: apt-patterns.7.xml msgid "<code>?any-version(PATTERN)</code>" -msgstr "" +msgstr "<code>?any-version(PATTERN)</code>" #. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para> #: apt-patterns.7.xml msgid "Selects any version where the pattern matches on the version." -msgstr "" +msgstr "Seleciona qualquer versão onde o padrão coincide com a versão." #. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para> #: apt-patterns.7.xml @@ -11185,11 +11209,15 @@ msgid "" "<code>?any-version(?and(?version(1),?version(2)))</code> restricts the " "<code>?and</code> to act on the same version." msgstr "" +"por exemplo, enquanto <code>?and(?version(1),?version(2))</code> corresponde " +"a pacote que tem uma versão contendo 1 e uma versão contendo 2, <code>?any-" +"version(?and(?version(1),?version(2)))</code> restringe o <code>?and</code> " +"a actuar na mesma versão." #. type: Content of: <refentry><refsect1><variablelist><varlistentry><term> #: apt-patterns.7.xml msgid "<code>?narrow(PATTERN...)</code>" -msgstr "" +msgstr "<code>?narrow(PATTERN...)</code>" #. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para> #: apt-patterns.7.xml @@ -11197,26 +11225,28 @@ msgid "" "Selects any version matching all PATTERNs, short for <code>?any-version(?" "and(PATTERN...))</code>." msgstr "" +"Seleciona qualquer versão que corresponda a todos os PATTERNs, abreviatura " +"de <code>?any-version(?and(PATTERN...))</code>." #. type: Content of: <refentry><refsect1><title> #: apt-patterns.7.xml msgid "Package patterns" -msgstr "" +msgstr "Padrões de pacotes" #. type: Content of: <refentry><refsect1><para> #: apt-patterns.7.xml msgid "These patterns select specific packages." -msgstr "" +msgstr "Estes padrões selecionam pacotes específicos." #. type: Content of: <refentry><refsect1><variablelist><varlistentry><term> #: apt-patterns.7.xml msgid "<code>?architecture(WILDCARD)</code>" -msgstr "" +msgstr "<code>?architecture(WILDCARD)</code>" #. type: Content of: <refentry><refsect1><variablelist><varlistentry><term> #: apt-patterns.7.xml msgid "<code>~rWILDCARD</code>" -msgstr "" +msgstr "<code>~rWILDCARD</code>" #. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para> #: apt-patterns.7.xml @@ -11224,46 +11254,48 @@ msgid "" "Selects packages matching the specified architecture, which may contain " "wildcards using any." msgstr "" +"Seleciona pacotes que coincidam com a arquitectura especificada, a qual pode " +"conter wildcards usando qualquer uma delas." #. type: Content of: <refentry><refsect1><variablelist><varlistentry><term> #: apt-patterns.7.xml msgid "<code>?automatic</code>" -msgstr "" +msgstr "<code>?automatic</code>" #. type: Content of: <refentry><refsect1><variablelist><varlistentry><term> #: apt-patterns.7.xml msgid "<code>~M</code>" -msgstr "" +msgstr "<code>~M</code>" #. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para> #: apt-patterns.7.xml msgid "Selects packages that were installed automatically." -msgstr "" +msgstr "Seleciona pacotes que foram instalados automaticamente." #. type: Content of: <refentry><refsect1><variablelist><varlistentry><term> #: apt-patterns.7.xml msgid "<code>?broken</code>" -msgstr "" +msgstr "<code>?broken</code>" #. type: Content of: <refentry><refsect1><variablelist><varlistentry><term> #: apt-patterns.7.xml msgid "<code>~b</code>" -msgstr "" +msgstr "<code>~b</code>" #. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para> #: apt-patterns.7.xml msgid "Selects packages that have broken dependencies." -msgstr "" +msgstr "Seleciona pacotes que têm dependências quebradas." #. type: Content of: <refentry><refsect1><variablelist><varlistentry><term> #: apt-patterns.7.xml msgid "<code>?config-files</code>" -msgstr "" +msgstr "<code>?config-files</code>" #. type: Content of: <refentry><refsect1><variablelist><varlistentry><term> #: apt-patterns.7.xml msgid "<code>~c</code>" -msgstr "" +msgstr "<code>~c</code>" #. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para> #: apt-patterns.7.xml @@ -11271,116 +11303,122 @@ msgid "" "Selects packages that are not fully installed, but have solely residual " "configuration files left." msgstr "" +"Seleciona pacotes que não estão totalmente instalados, mas têm somente " +"deixados ficheiros residuais de configuração." #. type: Content of: <refentry><refsect1><variablelist><varlistentry><term> #: apt-patterns.7.xml msgid "<code>?essential</code>" -msgstr "" +msgstr "<code>?essential</code>" #. type: Content of: <refentry><refsect1><variablelist><varlistentry><term> #: apt-patterns.7.xml msgid "<code>~E</code>" -msgstr "" +msgstr "<code>~E</code>" #. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para> #: apt-patterns.7.xml msgid "Selects packages that have Essential: yes set in their control file." msgstr "" +"Seleciona pacotes que têm Essential: yes definido no seu ficheiro de " +"controle." #. type: Content of: <refentry><refsect1><variablelist><varlistentry><term> #: apt-patterns.7.xml msgid "<code>?exact-name(NAME)</code>" -msgstr "" +msgstr "<code>?exact-name(NAME)</code>" #. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para> #: apt-patterns.7.xml msgid "Selects packages with the exact specified name." -msgstr "" +msgstr "Seleciona pacotes com o nome exacto especificado." #. type: Content of: <refentry><refsect1><variablelist><varlistentry><term> #: apt-patterns.7.xml msgid "<code>?garbage</code>" -msgstr "" +msgstr "<code>?garbage</code>" #. type: Content of: <refentry><refsect1><variablelist><varlistentry><term> #: apt-patterns.7.xml msgid "<code>~g</code>" -msgstr "" +msgstr "<code>~g</code>" #. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para> #: apt-patterns.7.xml msgid "Selects packages that can be removed automatically." -msgstr "" +msgstr "Seleciona pacotes que podem ser removidos automaticamente." #. type: Content of: <refentry><refsect1><variablelist><varlistentry><term> #: apt-patterns.7.xml msgid "<code>?installed</code>" -msgstr "" +msgstr "<code>?installed</code>" #. type: Content of: <refentry><refsect1><variablelist><varlistentry><term> #: apt-patterns.7.xml msgid "<code>~i</code>" -msgstr "" +msgstr "<code>~i</code>" #. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para> #: apt-patterns.7.xml msgid "Selects packages that are currently installed." -msgstr "" +msgstr "Seleciona pacotes que estão presentemente instalados." #. type: Content of: <refentry><refsect1><variablelist><varlistentry><term> #: apt-patterns.7.xml msgid "<code>?name(REGEX)</code>" -msgstr "" +msgstr "<code>?name(REGEX)</code>" #. type: Content of: <refentry><refsect1><variablelist><varlistentry><term> #: apt-patterns.7.xml msgid "<code>~nREGEX</code>" -msgstr "" +msgstr "<code>~nREGEX</code>" #. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para> #: apt-patterns.7.xml msgid "Selects packages where the name matches the given regular expression." msgstr "" +"Seleciona pacotes onde o nome coincide com a expressão regular fornecida." #. type: Content of: <refentry><refsect1><variablelist><varlistentry><term> #: apt-patterns.7.xml msgid "<code>?obsolete</code>" -msgstr "" +msgstr "<code>?obsolete</code>" #. type: Content of: <refentry><refsect1><variablelist><varlistentry><term> #: apt-patterns.7.xml msgid "<code>~o</code>" -msgstr "" +msgstr "<code>~o</code>" #. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para> #: apt-patterns.7.xml msgid "Selects packages that no longer exist in repositories." -msgstr "" +msgstr "Seleciona todos os pacotes que já não existem nos repositórios." #. type: Content of: <refentry><refsect1><variablelist><varlistentry><term> #: apt-patterns.7.xml msgid "<code>?upgradable</code>" -msgstr "" +msgstr "<code>?upgradable</code>" #. type: Content of: <refentry><refsect1><variablelist><varlistentry><term> #: apt-patterns.7.xml msgid "<code>~U</code>" -msgstr "" +msgstr "<code>~U</code>" #. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para> #: apt-patterns.7.xml msgid "Selects packages that can be upgraded (have a newer candidate)." msgstr "" +"Seleciona pacotes que podem ser actualizados (têm um candidato mais recente)." #. type: Content of: <refentry><refsect1><variablelist><varlistentry><term> #: apt-patterns.7.xml msgid "<code>?virtual</code>" -msgstr "" +msgstr "<code>?virtual</code>" #. type: Content of: <refentry><refsect1><variablelist><varlistentry><term> #: apt-patterns.7.xml msgid "<code>~v</code>" -msgstr "" +msgstr "<code>~v</code>" #. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para> #: apt-patterns.7.xml @@ -11389,28 +11427,29 @@ msgid "" "exist when they are referenced somewhere in the archive, for example because " "something depends on that name." msgstr "" +"Seleciona todos os pacotes virtuais; que são pacotes sem versão. Estes " +"existem quando são referenciados algures no arquivo, por exemplo porque algo " +"depende desse nome." #. type: Content of: <refentry><refsect1><title> #: apt-patterns.7.xml -#, fuzzy -#| msgid "Version &apt-product-version;" msgid "Version patterns" -msgstr "Versão &apt-product-version;" +msgstr "Padrões de versão" #. type: Content of: <refentry><refsect1><para> #: apt-patterns.7.xml msgid "These patterns select specific versions of a package." -msgstr "" +msgstr "Estes padrões selecionam versões específicas de um pacote." #. type: Content of: <refentry><refsect1><variablelist><varlistentry><term> #: apt-patterns.7.xml msgid "<code>?archive(REGEX)</code>" -msgstr "" +msgstr "<code>?archive(REGEX)</code>" #. type: Content of: <refentry><refsect1><variablelist><varlistentry><term> #: apt-patterns.7.xml msgid "<code>~AREGEX</code>" -msgstr "" +msgstr "<code>~AREGEX</code>" #. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para> #: apt-patterns.7.xml @@ -11419,16 +11458,19 @@ msgid "" "regular expression. Archive, here, means the values after <code>a=</code> in " "<command>apt-cache policy</command>." msgstr "" +"Seleciona versões que vêm do arquivo que correspondem à expressão regular " +"fornecida. Archive, aqui, significa os valores após <code>a=</code> em " +"<command>apt-cache policy</command>." #. type: Content of: <refentry><refsect1><variablelist><varlistentry><term> #: apt-patterns.7.xml msgid "<code>?origin(REGEX)</code>" -msgstr "" +msgstr "<code>?origin(REGEX)</code>" #. type: Content of: <refentry><refsect1><variablelist><varlistentry><term> #: apt-patterns.7.xml msgid "<code>~OREGEX</code>" -msgstr "" +msgstr "<code>~OREGEX</code>" #. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para> #: apt-patterns.7.xml @@ -11437,32 +11479,36 @@ msgid "" "regular expression. Origin, here, means the values after <code>o=</code> in " "<command>apt-cache policy</command>." msgstr "" +"Seleciona versões que vêm do arquivo que correspondem à expressão regular " +"fornecida. Origin, aqui, significa os valores após <code>a=</code> em " +"<command>apt-cache policy</command>." #. type: Content of: <refentry><refsect1><variablelist><varlistentry><term> #: apt-patterns.7.xml msgid "<code>?section(REGEX)</code>" -msgstr "" +msgstr "<code>?section(REGEX)</code>" #. type: Content of: <refentry><refsect1><variablelist><varlistentry><term> #: apt-patterns.7.xml msgid "<code>~sREGEX</code>" -msgstr "" +msgstr "<code>~sREGEX</code>" #. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para> #: apt-patterns.7.xml msgid "" "Selects versions where the section matches the specified regular expression." msgstr "" +"Seleciona versões onde a secção coincide com a expressão regular fornecida." #. type: Content of: <refentry><refsect1><variablelist><varlistentry><term> #: apt-patterns.7.xml msgid "<code>?source-package(REGEX)</code>" -msgstr "" +msgstr "<code>?source-package(REGEX)</code>" #. type: Content of: <refentry><refsect1><variablelist><varlistentry><term> #: apt-patterns.7.xml msgid "<code>~eREGEX</code>" -msgstr "" +msgstr "<code>~eREGEX</code>" #. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para> #: apt-patterns.7.xml @@ -11470,11 +11516,13 @@ msgid "" "Selects versions where the source package name matches the specified regular " "expression." msgstr "" +"Seleciona versões onde o nome do pacote fonte coincide com a expressão " +"regular fornecida." #. type: Content of: <refentry><refsect1><variablelist><varlistentry><term> #: apt-patterns.7.xml msgid "<code>?source-version(REGEX)</code>" -msgstr "" +msgstr "<code>?source-version(REGEX)</code>" #. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para> #: apt-patterns.7.xml @@ -11482,16 +11530,18 @@ msgid "" "Selects versions where the source package version matches the specified " "regular expression." msgstr "" +"Seleciona versões onde a versão do pacote fonte coincide com a expressão " +"regular fornecida." #. type: Content of: <refentry><refsect1><variablelist><varlistentry><term> #: apt-patterns.7.xml msgid "<code>?version(REGEX)</code>" -msgstr "" +msgstr "<code>?version(REGEX)</code>" #. type: Content of: <refentry><refsect1><variablelist><varlistentry><term> #: apt-patterns.7.xml msgid "<code>~VREGEX</code>" -msgstr "" +msgstr "<code>~VREGEX</code>" #. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para> #: apt-patterns.7.xml @@ -11499,11 +11549,13 @@ msgid "" "Selects versions where the version string matches the specified regular " "expression." msgstr "" +"Seleciona versões onde a string de versão coincide com a expressão regular " +"fornecida." #. type: Content of: <refentry><refsect1><variablelist><varlistentry><term> #: apt-patterns.7.xml msgid "<code>apt remove ?garbage</code>" -msgstr "" +msgstr "<code>apt remove ?garbage</code>" #. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para> #: apt-patterns.7.xml @@ -11511,21 +11563,24 @@ msgid "" "Remove all packages that are automatically installed and no longer needed - " "same as apt autoremove" msgstr "" +"Remove todos os pacotes que foram instalados automaticamente e já não fazem " +"falta - o mesmo que apt autoremove" #. type: Content of: <refentry><refsect1><variablelist><varlistentry><term> #: apt-patterns.7.xml msgid "<code>apt purge ?config-files</code>" -msgstr "" +msgstr "<code>apt purge ?config-files</code>" #. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para> #: apt-patterns.7.xml msgid "Purge all packages that only have configuration files left" msgstr "" +"Purga todos os pacotes que apenas têm ficheiros de configuração deixados" #. type: Content of: <refentry><refsect1><variablelist><varlistentry><term> #: apt-patterns.7.xml msgid "<code>apt list '~i !~M (~slibs|~sperl|~spython)'</code>" -msgstr "" +msgstr "<code>apt list '~i !~M (~slibs|~sperl|~spython)'</code>" #. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para> #: apt-patterns.7.xml @@ -11533,11 +11588,13 @@ msgid "" "List all manually-installed packages in sections matching libs, perl, or " "python." msgstr "" +"Lista todos os pacotes instalados manualmente em secções que correspondam a " +"libs, perl, ou python." #. type: Content of: <refentry><refsect1><title> #: apt-patterns.7.xml msgid "Migrating from aptitude" -msgstr "" +msgstr "Migrar do aptitude" #. type: Content of: <refentry><refsect1><para> #: apt-patterns.7.xml @@ -11545,6 +11602,8 @@ msgid "" "Patterns in apt are heavily inspired by patterns in aptitude, but with some " "tweaks:" msgstr "" +"Os padrões no apt são fortemente inspirados pelos padrões no aptitude, mas " +"com alguns ajustes:" #. type: Content of: <refentry><refsect1><itemizedlist><listitem><para> #: apt-patterns.7.xml @@ -11552,6 +11611,8 @@ msgid "" "Syntax is uniform: If there is an opening parenthesis after a term, it is " "always assumed to be the beginning of an argument list." msgstr "" +"A sintaxe é uniforme: Se existir um abre-parênteses após um termo, será " +"sempre assumido ao inicio de uma lista de argumentos. " #. type: Content of: <refentry><refsect1><itemizedlist><listitem><para> #: apt-patterns.7.xml @@ -11560,11 +11621,14 @@ msgid "" "and(?foo,bar)\"</code> if foo does not take an argument. In APT, this will " "cause an error." msgstr "" +"No aptitude, a forma de sintaxe <code>\"?foo(bar)\"</code> pode significar " +"<code>\"?and(?foo,bar)\"</code> se foo não tiver um argumento. No APT, isto " +"irá causar um erro." #. type: Content of: <refentry><refsect1><itemizedlist><listitem><para> #: apt-patterns.7.xml msgid "Not all patterns are supported." -msgstr "" +msgstr "Nem todos os padrões são suportados." #. type: Content of: <refentry><refsect1><itemizedlist><listitem><para> #: apt-patterns.7.xml @@ -11572,21 +11636,23 @@ msgid "" "Some additional patterns are available, for example, for finding gstreamer " "codecs." msgstr "" +"Estão disponíveis alguns padrões adicionais, por exemplo, para encontrar " +"codecs do gstreamer." #. type: Content of: <refentry><refsect1><itemizedlist><listitem><para> #: apt-patterns.7.xml msgid "Escaping terms with <code>~</code> is not supported." -msgstr "" +msgstr "Escapar termos com <code>~</code> não é suportado." #. type: Content of: <refentry><refsect1><itemizedlist><listitem><para> #: apt-patterns.7.xml msgid "A trailing comma is allowed in argument lists" -msgstr "" +msgstr "Uma vírgula final é permitida em listas de argumentos" #. type: Content of: <refentry><refsect1><itemizedlist><listitem><para> #: apt-patterns.7.xml msgid "?narrow accepts infinite arguments" -msgstr "" +msgstr "?narrow aceita argumentos infinitos" #. type: Content of: <refentry><refsect1><itemizedlist><listitem><para> #: apt-patterns.7.xml @@ -11597,6 +11663,11 @@ msgid "" "priority, but if you do not type the <code>~</code>, it would require the " "package name to contain <code>poptional</code>." msgstr "" +"<code>foo</code> não pode ser usado como abreviatura para <code>?name(foo)</" +"code>, pois isto pode fazer com que erros de escrita passem despercebidos: " +"Considere <code>?and(...,~poptional)</code>: isto requer que um pacote tenha " +"prioridade <code>required</code>, mas se você não escrever o <code>~</code>, " +"irá requerer que o nome do pacote contenha <code>poptional</code>." #. type: Content of: <refentry><refsect1><itemizedlist><listitem><para> #: apt-patterns.7.xml @@ -11605,13 +11676,14 @@ msgid "" "as <code>A|B</code> are not supported. We do not believe that the use of " "<code>|</code> is that common, and the grouping is not necessary without it." msgstr "" +"Agrupar padrões com <code>(...)</code> ou escrever <code>?or(A,B)</code> " +"como <code>A|B</code> não é suportado. Não acreditamos que o uso de <code>|</" +"code> seja tão comum, e o agrupar não seja necessário sem ele." #. type: Content of: <refentry><refsect1><para> #: apt-patterns.7.xml -#, fuzzy -#| msgid "&apt-get;, &apt-conf;" msgid "&apt-get;, &apt;" -msgstr "&apt-get;, &apt-conf;" +msgstr "&apt-get;, &apt;" #. type: Attribute 'lang' of: <book> #: guide.dbk offline.dbk @@ -11811,7 +11883,7 @@ msgstr "" "Em qualquer altura uma única dependência pode ser satisfeita por pacotes que " "já estão instalados ou podem não estar. O APT tenta ajudar a resolver " "problemas com dependências ao disponibilizar um número de algoritmos " -"automáticos que ajudam a seleccionar os pacotes para instalação." +"automáticos que ajudam a selecionar os pacotes para instalação." #. type: Content of: <book><chapter><title> #: guide.dbk @@ -11920,11 +11992,11 @@ msgid "" msgstr "" "Install é usado para instalar pacotes pelo nome. O pacote é obtido " "automaticamente e instalado. Isto pode ser útil se você já conhecer o nome " -"do pacote a instalar e não quer ir para uma GUI para o seleccionar. Podem " -"ser passados qualquer número de pacotes para instalar, todos eles serão " -"obtidos. Install tenta automaticamente resolver problemas de dependências " -"com os pacotes listados e irá escrever um sumário e pedir confirmação se " -"algo mais que os seus argumentos serão alterados." +"do pacote a instalar e não quer ir para uma GUI para o selecionar. Podem ser " +"passados qualquer número de pacotes para instalar, todos eles serão obtidos. " +"Install tenta automaticamente resolver problemas de dependências com os " +"pacotes listados e irá escrever um sumário e pedir confirmação se algo mais " +"que os seus argumentos serão alterados." #. type: Content of: <book><chapter><variablelist><varlistentry><term> #: guide.dbk @@ -11998,7 +12070,7 @@ msgid "" msgstr "" "O método <command>dselect</command> do APT disponibiliza o sistema APT " "completo com a GUI de selecção de pacotes <command>dselect</command>. O " -"<command>dselect</command> é usado para seleccionar os pacotes a serem " +"<command>dselect</command> é usado para selecionar os pacotes a serem " "instalados ou removidos e o APT instala-os." #. type: Content of: <book><chapter><para> @@ -12014,7 +12086,7 @@ msgid "" "have access to the latest bug fixes. APT will automatically use packages on " "your CD-ROM before downloading from the Internet." msgstr "" -"Para activar o método APT você precisa de seleccionar [A]ccess no " +"Para activar o método APT você precisa de selecionar [A]ccess no " "<command>dselect</command> e depois escolher o método APT. Ser-lhe-à " "perguntado por um conjunto de <emphasis>Sources</emphasis> que são os " "lugares de onde obter os arquivos. Estes podem ser sites remotos da " @@ -12146,7 +12218,7 @@ msgid "" "<literal>apt-get update</literal> has been run before." msgstr "" "Antes de começar a usar o <command>dselect</command> é necessário actualizar " -"a lista disponível ao seleccionar [U]pdate no menu. Isto é um super-conjunto " +"a lista disponível ao selecionar [U]pdate no menu. Isto é um super-conjunto " "do <literal>apt-get update</literal> que torna a informação obtida " "disponível ao <command>dselect</command>. Deve ser executado o [U]pdate " "mesmo que tenha sido feito <literal>apt-get update</literal> antes." @@ -12964,7 +13036,7 @@ msgstr "" "\n" " Dir\n" " {\n" -" /* Usa o disco para informação de estado e redirecciona o ficheiro de estado a partir de\n" +" /* Usa o disco para informação de estado e redireciona o ficheiro de estado a partir de\n" " the /var/lib/dpkg default */\n" " State \"/disc/\";\n" " State::status \"status\";\n" diff --git a/methods/http.cc b/methods/http.cc index 71aa56751..9cfc91330 100644 --- a/methods/http.cc +++ b/methods/http.cc @@ -23,6 +23,7 @@ #include <apt-pkg/fileutl.h> #include <apt-pkg/hashes.h> #include <apt-pkg/proxy.h> +#include <apt-pkg/string_view.h> #include <apt-pkg/strutl.h> #include <chrono> @@ -93,6 +94,7 @@ void CircleBuf::Reset() is non-blocking.. */ bool CircleBuf::Read(std::unique_ptr<MethodFd> const &Fd) { + size_t ReadThisCycle = 0; while (1) { // Woops, buffer is full @@ -130,7 +132,7 @@ bool CircleBuf::Read(std::unique_ptr<MethodFd> const &Fd) CircleBuf::BwTickReadData += Res; if (Res == 0) - return false; + return ReadThisCycle != 0; if (Res < 0) { if (errno == EAGAIN) @@ -139,6 +141,7 @@ bool CircleBuf::Read(std::unique_ptr<MethodFd> const &Fd) } InP += Res; + ReadThisCycle += Res; } } /*}}}*/ @@ -203,8 +206,6 @@ bool CircleBuf::Write(std::unique_ptr<MethodFd> const &Fd) ssize_t Res; Res = Fd->Write(Buf + (OutP % Size), LeftWrite()); - if (Res == 0) - return false; if (Res < 0) { if (errno == EAGAIN) @@ -214,7 +215,7 @@ bool CircleBuf::Write(std::unique_ptr<MethodFd> const &Fd) } TotalWriten += Res; - + if (Hash != NULL) Hash->Add(Buf + (OutP%Size),Res); @@ -407,7 +408,7 @@ static ResultState UnwrapHTTPConnect(std::string Host, int Port, URI Proxy, std: /*}}}*/ // HttpServerState::HttpServerState - Constructor /*{{{*/ -HttpServerState::HttpServerState(URI Srv,HttpMethod *Owner) : ServerState(Srv, Owner), In(Owner, 64*1024), Out(Owner, 4*1024) +HttpServerState::HttpServerState(URI Srv, HttpMethod *Owner) : ServerState(Srv, Owner), In(Owner, APT_BUFFER_SIZE), Out(Owner, 4 * 1024) { TimeOut = Owner->ConfigFindI("Timeout", TimeOut); ServerFd = MethodFd::FromFd(-1); @@ -699,26 +700,18 @@ ResultState HttpServerState::Die(RequestState &Req) { unsigned int LErrno = errno; + Close(); + // Dump the buffer to the file if (Req.State == RequestState::Data) { - if (Req.File.IsOpen() == false) - return ResultState::SUCCESSFUL; // on GNU/kFreeBSD, apt dies on /dev/null because non-blocking // can't be set if (Req.File.Name() != "/dev/null") SetNonBlock(Req.File.Fd(),false); - while (In.WriteSpace() == true) - { - if (In.Write(MethodFd::FromFd(Req.File.Fd())) == false) - { - _error->Errno("write", _("Error writing to the file")); - return ResultState::TRANSIENT_ERROR; - } - - // Done - if (In.IsLimit() == true) - return ResultState::SUCCESSFUL; + if (In.WriteSpace()) { + _error->Error(_("Data left in buffer")); + return ResultState::TRANSIENT_ERROR; } } @@ -726,7 +719,6 @@ ResultState HttpServerState::Die(RequestState &Req) if (In.IsLimit() == false && Req.State != RequestState::Header && Persistent == true) { - Close(); if (LErrno == 0) { _error->Error(_("Error reading from server. Remote end closed connection")); @@ -745,7 +737,6 @@ ResultState HttpServerState::Die(RequestState &Req) return ResultState::TRANSIENT_ERROR; // We may have got multiple responses back in one packet.. - Close(); return ResultState::SUCCESSFUL; } @@ -792,13 +783,11 @@ ResultState HttpServerState::Go(bool ToFile, RequestState &Req) ToFile == false)) return ResultState::TRANSIENT_ERROR; - // Handle server IO - if (ServerFd->HasPending() && In.ReadSpace() == true) - { - errno = 0; - if (In.Read(ServerFd) == false) - return Die(Req); - } + // Record if we have data pending to read in the server, so that we can + // skip the wait in select(). This can happen if data has already been + // read into a methodfd's buffer - the TCP queue might be empty at that + // point. + bool ServerPending = ServerFd->HasPending(); fd_set rfds,wfds; FD_ZERO(&rfds); @@ -830,7 +819,7 @@ ResultState HttpServerState::Go(bool ToFile, RequestState &Req) // Select struct timeval tv; - tv.tv_sec = TimeOut; + tv.tv_sec = ServerPending ? 0 : TimeOut; tv.tv_usec = 0; int Res = 0; if ((Res = select(MaxFd+1,&rfds,&wfds,0,&tv)) < 0) @@ -841,27 +830,20 @@ ResultState HttpServerState::Go(bool ToFile, RequestState &Req) return ResultState::TRANSIENT_ERROR; } - if (Res == 0) + if (Res == 0 && not ServerPending) { _error->Error(_("Connection timed out")); - return Die(Req); + return ResultState::TRANSIENT_ERROR; } // Handle server IO - if (ServerFd->Fd() != -1 && FD_ISSET(ServerFd->Fd(), &rfds)) + if (ServerPending || (ServerFd->Fd() != -1 && FD_ISSET(ServerFd->Fd(), &rfds))) { errno = 0; if (In.Read(ServerFd) == false) return Die(Req); } - if (ServerFd->Fd() != -1 && FD_ISSET(ServerFd->Fd(), &wfds)) - { - errno = 0; - if (Out.Write(ServerFd) == false) - return Die(Req); - } - // Send data to the file if (FileFD->Fd() != -1 && FD_ISSET(FileFD->Fd(), &wfds)) { @@ -872,6 +854,13 @@ ResultState HttpServerState::Go(bool ToFile, RequestState &Req) } } + if (ServerFd->Fd() != -1 && FD_ISSET(ServerFd->Fd(), &wfds)) + { + errno = 0; + if (Out.Write(ServerFd) == false) + return Die(Req); + } + if (Req.MaximumSize > 0 && Req.File.IsOpen() && Req.File.Failed() == false && Req.File.Tell() > Req.MaximumSize) { Owner->SetFailReason("MaximumSizeExceeded"); @@ -979,15 +968,18 @@ void HttpMethod::SendReq(FetchItem *Itm) "Debian APT-HTTP/1.3 (" PACKAGE_VERSION ")"); #ifdef HAVE_SYSTEMD - char *unit = nullptr; - sd_pid_get_unit(getpid(), &unit); - if (unit != nullptr && *unit != '\0' && not APT::String::Startswith(unit, "user@") // user@ _is_ interactive - && unit != "packagekit.service"s // packagekit likely is interactive - && unit != "dbus.service"s // aptdaemon and qapt don't have systemd services - && ConfigFindB("User-Agent-Non-Interactive", false)) - Req << " non-interactive"; - - free(unit); + if (ConfigFindB("User-Agent-Non-Interactive", false)) + { + using APT::operator""_sv; + char *unit = nullptr; + sd_pid_get_unit(getpid(), &unit); + if (unit != nullptr && *unit != '\0' && not APT::String::Startswith(unit, "user@") // user@ _is_ interactive + && "packagekit.service"_sv != unit // packagekit likely is interactive + && "dbus.service"_sv != unit) // aptdaemon and qapt don't have systemd services + Req << " non-interactive"; + + free(unit); + } #endif Req << "\r\n"; diff --git a/po/apt-all.pot b/po/apt-all.pot index 9cdb3fcdb..395e52cee 100644 --- a/po/apt-all.pot +++ b/po/apt-all.pot @@ -5,9 +5,9 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: apt 2.1.0\n" +"Project-Id-Version: apt 2.1.7\n" "Report-Msgid-Bugs-To: APT Development Team <deity@lists.debian.org>\n" -"POT-Creation-Date: 2020-05-04 15:59+0200\n" +"POT-Creation-Date: 2020-07-08 09:40+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -492,11 +492,6 @@ msgid "Error reading archive member header" msgstr "" #: apt-pkg/contrib/arfile.cc -#, c-format -msgid "Invalid archive member header %s" -msgstr "" - -#: apt-pkg/contrib/arfile.cc msgid "Invalid archive member header" msgstr "" @@ -631,7 +626,7 @@ msgstr "" #: apt-pkg/contrib/extracttar.cc #, c-format -msgid "Unknown TAR header type %u, member %s" +msgid "Unknown TAR header type %u" msgstr "" #: apt-pkg/contrib/fileutl.cc @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: apt 1.0.5\n" "Report-Msgid-Bugs-To: APT Development Team <deity@lists.debian.org>\n" -"POT-Creation-Date: 2020-03-24 11:53+0100\n" +"POT-Creation-Date: 2020-05-12 22:50+0200\n" "PO-Revision-Date: 2006-10-20 21:28+0300\n" "Last-Translator: Ossama M. Khayat <okhayat@yahoo.com>\n" "Language-Team: Arabic <support@arabeyes.org>\n" @@ -502,11 +502,6 @@ msgid "Error reading archive member header" msgstr "" #: apt-pkg/contrib/arfile.cc -#, fuzzy, c-format -msgid "Invalid archive member header %s" -msgstr "توقيع الأرشيف غير صالح" - -#: apt-pkg/contrib/arfile.cc msgid "Invalid archive member header" msgstr "" @@ -641,7 +636,7 @@ msgstr "فشل تحقّق Checksum لملف Tar، الأرشيف فاسد" #: apt-pkg/contrib/extracttar.cc #, c-format -msgid "Unknown TAR header type %u, member %s" +msgid "Unknown TAR header type %u" msgstr "" #: apt-pkg/contrib/fileutl.cc @@ -3660,6 +3655,10 @@ msgstr "" msgid "Empty files can't be valid archives" msgstr "" +#, fuzzy +#~ msgid "Invalid archive member header %s" +#~ msgstr "توقيع الأرشيف غير صالح" + #~ msgid "The path %s is too long" #~ msgstr "المسار %s طويل جداً" @@ -4,7 +4,7 @@ msgid "" msgstr "" "Project-Id-Version: apt 0.7.18\n" "Report-Msgid-Bugs-To: APT Development Team <deity@lists.debian.org>\n" -"POT-Creation-Date: 2020-03-24 11:53+0100\n" +"POT-Creation-Date: 2020-05-12 22:50+0200\n" "PO-Revision-Date: 2010-10-02 23:35+0100\n" "Last-Translator: Iñigo Varela <ivarela@softastur.org>\n" "Language-Team: Asturian (ast)\n" @@ -515,11 +515,6 @@ msgid "Error reading archive member header" msgstr "Fallu al lleer la testera de miembru del ficheru" #: apt-pkg/contrib/arfile.cc -#, c-format -msgid "Invalid archive member header %s" -msgstr "Testera de miembru del archivu %s inválida" - -#: apt-pkg/contrib/arfile.cc msgid "Invalid archive member header" msgstr "Testera de miembru del ficheru inválida" @@ -656,8 +651,9 @@ msgid "Tar checksum failed, archive corrupted" msgstr "Falló la suma de control de tar, ficheru tollíu" #: apt-pkg/contrib/extracttar.cc -#, c-format -msgid "Unknown TAR header type %u, member %s" +#, fuzzy, c-format +#| msgid "Unknown TAR header type %u, member %s" +msgid "Unknown TAR header type %u" msgstr "Testera del TAR triba %u desconocida, miembru %s" #: apt-pkg/contrib/fileutl.cc @@ -3836,6 +3832,9 @@ msgstr "Conexón encaboxada prematuramente" msgid "Empty files can't be valid archives" msgstr "" +#~ msgid "Invalid archive member header %s" +#~ msgstr "Testera de miembru del archivu %s inválida" + #~ msgid "The path %s is too long" #~ msgstr "La trayeutoria %s ye enforma llarga" @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: apt 0.7.21\n" "Report-Msgid-Bugs-To: APT Development Team <deity@lists.debian.org>\n" -"POT-Creation-Date: 2020-03-24 11:53+0100\n" +"POT-Creation-Date: 2020-05-12 22:50+0200\n" "PO-Revision-Date: 2012-06-25 17:23+0300\n" "Last-Translator: Damyan Ivanov <dmn@debian.org>\n" "Language-Team: Bulgarian <dict@fsa-bg.org>\n" @@ -532,11 +532,6 @@ msgid "Error reading archive member header" msgstr "Грешка при четене на заглавната част на елемента на архива" #: apt-pkg/contrib/arfile.cc -#, c-format -msgid "Invalid archive member header %s" -msgstr "Невалидна заглавна част %s на елемента на архива" - -#: apt-pkg/contrib/arfile.cc msgid "Invalid archive member header" msgstr "Невалидна заглавна част на елемента на архива" @@ -673,8 +668,9 @@ msgid "Tar checksum failed, archive corrupted" msgstr "Невярна контролна сума на tar, развален архив" #: apt-pkg/contrib/extracttar.cc -#, c-format -msgid "Unknown TAR header type %u, member %s" +#, fuzzy, c-format +#| msgid "Unknown TAR header type %u, member %s" +msgid "Unknown TAR header type %u" msgstr "Непозната заглавна част на TAR тип %u, елемент %s" #: apt-pkg/contrib/fileutl.cc @@ -3892,6 +3888,9 @@ msgstr "Връзката прекъсна преждевременно" msgid "Empty files can't be valid archives" msgstr "Празни файлове не могат да бъдат валидни архиви" +#~ msgid "Invalid archive member header %s" +#~ msgstr "Невалидна заглавна част %s на елемента на архива" + #~ msgid "The path %s is too long" #~ msgstr "Пътят %s е твърде дълъг" @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: apt 0.5.26\n" "Report-Msgid-Bugs-To: APT Development Team <deity@lists.debian.org>\n" -"POT-Creation-Date: 2020-03-24 11:53+0100\n" +"POT-Creation-Date: 2020-05-12 22:50+0200\n" "PO-Revision-Date: 2004-05-06 15:25+0100\n" "Last-Translator: Safir Šećerović <sapphire@linux.org.ba>\n" "Language-Team: Bosnian <lokal@lugbih.org>\n" @@ -497,11 +497,6 @@ msgid "Error reading archive member header" msgstr "" #: apt-pkg/contrib/arfile.cc -#, c-format -msgid "Invalid archive member header %s" -msgstr "" - -#: apt-pkg/contrib/arfile.cc msgid "Invalid archive member header" msgstr "" @@ -636,7 +631,7 @@ msgstr "Provjera Tar kontrolnog zbira nije uspjela, arhiva oštećena" #: apt-pkg/contrib/extracttar.cc #, c-format -msgid "Unknown TAR header type %u, member %s" +msgid "Unknown TAR header type %u" msgstr "" #: apt-pkg/contrib/fileutl.cc @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: apt 1.4~beta1\n" "Report-Msgid-Bugs-To: APT Development Team <deity@lists.debian.org>\n" -"POT-Creation-Date: 2020-03-24 11:53+0100\n" +"POT-Creation-Date: 2020-05-12 22:50+0200\n" "PO-Revision-Date: 2016-12-05 21:09+0100\n" "Last-Translator: Oriol Debian <oriol.debian@gmail.com>\n" "Language-Team: Catalan <debian-l10n-catalan@lists.debian.org>\n" @@ -565,11 +565,6 @@ msgid "Error reading archive member header" msgstr "S'ha produït un error en llegir la capçalera del membre de l'arxiu" #: apt-pkg/contrib/arfile.cc -#, c-format -msgid "Invalid archive member header %s" -msgstr "La capçalera %s del membre de l'arxiu no és vàlida" - -#: apt-pkg/contrib/arfile.cc msgid "Invalid archive member header" msgstr "La capçalera del membre de l'arxiu no és vàlida" @@ -708,8 +703,9 @@ msgid "Tar checksum failed, archive corrupted" msgstr "La suma de comprovació de tar ha fallat, arxiu corromput" #: apt-pkg/contrib/extracttar.cc -#, c-format -msgid "Unknown TAR header type %u, member %s" +#, fuzzy, c-format +#| msgid "Unknown TAR header type %u, member %s" +msgid "Unknown TAR header type %u" msgstr "Capçalera TAR desconeguda del tipus %u, membre %s" #: apt-pkg/contrib/fileutl.cc @@ -2098,7 +2094,7 @@ msgid_plural "" msgstr[0] "" "El paquet següent s'ha instal·lat automàticament i ja no serà necessari:" msgstr[1] "" -"El paquets següents s'han instal·lat automàticament i ja no serà necessaris:" +"El paquets següents s'han instal·lat automàticament i ja no seran necessaris:" #: apt-private/private-install.cc #, c-format @@ -3982,6 +3978,9 @@ msgstr "La connexió s'ha tancat prematurament" msgid "Empty files can't be valid archives" msgstr "Els fitxers buits no poden ser arxius vàlids" +#~ msgid "Invalid archive member header %s" +#~ msgstr "La capçalera %s del membre de l'arxiu no és vàlida" + #~ msgid "The path %s is too long" #~ msgstr "La ruta %s és massa llarga" @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: apt 1.4.2\n" "Report-Msgid-Bugs-To: APT Development Team <deity@lists.debian.org>\n" -"POT-Creation-Date: 2020-03-24 11:53+0100\n" +"POT-Creation-Date: 2020-05-12 22:50+0200\n" "PO-Revision-Date: 2017-05-06 11:08+0200\n" "Last-Translator: Miroslav Kure <kurem@debian.cz>\n" "Language-Team: Czech <debian-l10n-czech@lists.debian.org>\n" @@ -541,11 +541,6 @@ msgid "Error reading archive member header" msgstr "Chyba při čtení záhlaví prvku archivu" #: apt-pkg/contrib/arfile.cc -#, c-format -msgid "Invalid archive member header %s" -msgstr "Neplatné záhlaví prvku archivu %s" - -#: apt-pkg/contrib/arfile.cc msgid "Invalid archive member header" msgstr "Neplatné záhlaví prvku archivu" @@ -685,8 +680,9 @@ msgid "Tar checksum failed, archive corrupted" msgstr "Kontrolní součet taru selhal, archiv je poškozený" #: apt-pkg/contrib/extracttar.cc -#, c-format -msgid "Unknown TAR header type %u, member %s" +#, fuzzy, c-format +#| msgid "Unknown TAR header type %u, member %s" +msgid "Unknown TAR header type %u" msgstr "Neznámá hlavička TARu typ %u, člen %s" #: apt-pkg/contrib/fileutl.cc @@ -3879,6 +3875,9 @@ msgstr "Spojení bylo předčasně ukončeno" msgid "Empty files can't be valid archives" msgstr "Prázdné soubory nejsou platnými archivy" +#~ msgid "Invalid archive member header %s" +#~ msgstr "Neplatné záhlaví prvku archivu %s" + #~ msgid "The path %s is too long" #~ msgstr "Cesta %s je příliš dlouhá" @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: apt 1.0.5\n" "Report-Msgid-Bugs-To: APT Development Team <deity@lists.debian.org>\n" -"POT-Creation-Date: 2020-03-24 11:53+0100\n" +"POT-Creation-Date: 2020-05-12 22:50+0200\n" "PO-Revision-Date: 2005-06-06 13:46+0100\n" "Last-Translator: Dafydd Harries <daf@muse.19inch.net>\n" "Language-Team: Welsh <cy@pengwyn.linux.org.uk>\n" @@ -510,11 +510,6 @@ msgid "Error reading archive member header" msgstr "Gwall wrth ddarllen pennawd aelod archif" #: apt-pkg/contrib/arfile.cc -#, fuzzy, c-format -msgid "Invalid archive member header %s" -msgstr "Pennawd aelod archif annilys" - -#: apt-pkg/contrib/arfile.cc msgid "Invalid archive member header" msgstr "Pennawd aelod archif annilys" @@ -654,8 +649,9 @@ msgid "Tar checksum failed, archive corrupted" msgstr "Methodd swm gwirio Tar, archif llygredig" #: apt-pkg/contrib/extracttar.cc -#, c-format -msgid "Unknown TAR header type %u, member %s" +#, fuzzy, c-format +#| msgid "Unknown TAR header type %u, member %s" +msgid "Unknown TAR header type %u" msgstr "Math pennawd TAR anhysbys %u, aelod %s" #: apt-pkg/contrib/fileutl.cc @@ -3858,6 +3854,10 @@ msgstr "Caewyd y cysylltiad yn gynnar" msgid "Empty files can't be valid archives" msgstr "" +#, fuzzy +#~ msgid "Invalid archive member header %s" +#~ msgstr "Pennawd aelod archif annilys" + #~ msgid "The path %s is too long" #~ msgstr "Mae'r llwybr %s yn rhy hir" @@ -12,7 +12,7 @@ msgid "" msgstr "" "Project-Id-Version: apt 1.4~rc2\n" "Report-Msgid-Bugs-To: APT Development Team <deity@lists.debian.org>\n" -"POT-Creation-Date: 2020-03-24 11:53+0100\n" +"POT-Creation-Date: 2020-05-12 22:50+0200\n" "PO-Revision-Date: 2017-03-02 23:51+0200\n" "Last-Translator: Joe Hansen <joedalton2@yahoo.dk>\n" "Language-Team: Danish <debian-l10n-danish@lists.debian.org>\n" @@ -551,11 +551,6 @@ msgid "Error reading archive member header" msgstr "Fejl under læsning af arkivelements hoved" #: apt-pkg/contrib/arfile.cc -#, c-format -msgid "Invalid archive member header %s" -msgstr "Ugyldigt arkivelementhoved %s" - -#: apt-pkg/contrib/arfile.cc msgid "Invalid archive member header" msgstr "Ugyldigt arkivelementhoved" @@ -692,8 +687,9 @@ msgid "Tar checksum failed, archive corrupted" msgstr "Tar-kontrolsum fejlede, arkivet er ødelagt" #: apt-pkg/contrib/extracttar.cc -#, c-format -msgid "Unknown TAR header type %u, member %s" +#, fuzzy, c-format +#| msgid "Unknown TAR header type %u, member %s" +msgid "Unknown TAR header type %u" msgstr "Ukendt TAR-hovedtype %u, element %s" #: apt-pkg/contrib/fileutl.cc @@ -3918,6 +3914,9 @@ msgstr "Forbindelsen lukkedes for hurtigt" msgid "Empty files can't be valid archives" msgstr "Tomme filer kan ikke være gyldige arkiver" +#~ msgid "Invalid archive member header %s" +#~ msgstr "Ugyldigt arkivelementhoved %s" + #~ msgid "The path %s is too long" #~ msgstr "Stien %s er for lang" @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: apt 1.6\n" "Report-Msgid-Bugs-To: APT Development Team <deity@lists.debian.org>\n" -"POT-Creation-Date: 2020-03-24 11:53+0100\n" +"POT-Creation-Date: 2020-05-12 22:50+0200\n" "PO-Revision-Date: 2018-01-11 21:11+0100\n" "Last-Translator: Holger Wansing <linux@wansing-online.de>\n" "Language-Team: German <debian-l10n-german@lists.debian.org>\n" @@ -574,11 +574,6 @@ msgid "Error reading archive member header" msgstr "Fehler beim Lesen der Archivdatei-Kopfzeilen" #: apt-pkg/contrib/arfile.cc -#, c-format -msgid "Invalid archive member header %s" -msgstr "Ungültige Archivbestandteil-Kopfzeile %s" - -#: apt-pkg/contrib/arfile.cc msgid "Invalid archive member header" msgstr "Ungültige Archivdatei-Kopfzeilen" @@ -719,8 +714,9 @@ msgid "Tar checksum failed, archive corrupted" msgstr "Tar-Prüfsumme fehlgeschlagen, Archiv beschädigt" #: apt-pkg/contrib/extracttar.cc -#, c-format -msgid "Unknown TAR header type %u, member %s" +#, fuzzy, c-format +#| msgid "Unknown TAR header type %u, member %s" +msgid "Unknown TAR header type %u" msgstr "Unbekannter Tar-Kopfzeilen-Typ %u, Bestandteil %s" #: apt-pkg/contrib/fileutl.cc @@ -4067,6 +4063,9 @@ msgstr "Verbindung vorzeitig beendet" msgid "Empty files can't be valid archives" msgstr "Leere Dateien können kein gültiges Archiv sein." +#~ msgid "Invalid archive member header %s" +#~ msgstr "Ungültige Archivbestandteil-Kopfzeile %s" + #~ msgid "The path %s is too long" #~ msgstr "Der Pfad %s ist zu lang." @@ -4,7 +4,7 @@ msgid "" msgstr "" "Project-Id-Version: apt 1.0.5\n" "Report-Msgid-Bugs-To: APT Development Team <deity@lists.debian.org>\n" -"POT-Creation-Date: 2020-03-24 11:53+0100\n" +"POT-Creation-Date: 2020-05-12 22:50+0200\n" "PO-Revision-Date: 2006-09-19 09:49+0530\n" "Last-Translator: Kinley Tshering <gasepkuenden2k3@hotmail.com>\n" "Language-Team: Dzongkha <pgeyleg@dit.gov.bt>\n" @@ -505,11 +505,6 @@ msgid "Error reading archive member header" msgstr "ཡིག་མཛོད་འཐུས་མི་མགོ་ཡིག་ལྷག་ནིའི་འཛོལ་བ།" #: apt-pkg/contrib/arfile.cc -#, fuzzy, c-format -msgid "Invalid archive member header %s" -msgstr "ནུས་མེད་ཡིག་མཛོད་འཐུས་མི་གི་མགོ་ཡིག་" - -#: apt-pkg/contrib/arfile.cc msgid "Invalid archive member header" msgstr "ནུས་མེད་ཡིག་མཛོད་འཐུས་མི་གི་མགོ་ཡིག་" @@ -643,8 +638,9 @@ msgid "Tar checksum failed, archive corrupted" msgstr "ཊར་ཅེག་སམ་དེ་འཐུས་ཤོར་བྱུང་ཡོད་ ཡིག་མཛོད་ངན་ཅན་བྱུང་ནུག" #: apt-pkg/contrib/extracttar.cc -#, c-format -msgid "Unknown TAR header type %u, member %s" +#, fuzzy, c-format +#| msgid "Unknown TAR header type %u, member %s" +msgid "Unknown TAR header type %u" msgstr "མ་ཤེས་པའི་ ཊཱར་་མགོ་ཡིག་་དབྱེ་བ་ %u་ འཐུས་མི་ %s།" #: apt-pkg/contrib/fileutl.cc @@ -3803,6 +3799,10 @@ msgstr "དུས་སུ་མ་འབབ་པ་རང་མཐུད་ལ msgid "Empty files can't be valid archives" msgstr "" +#, fuzzy +#~ msgid "Invalid archive member header %s" +#~ msgstr "ནུས་མེད་ཡིག་མཛོད་འཐུས་མི་གི་མགོ་ཡིག་" + #~ msgid "The path %s is too long" #~ msgstr "%s་འགྲུལ་ལམ་དེ་གནམ་མེད་ས་མེད་རིངམ་འདུག" @@ -16,7 +16,7 @@ msgid "" msgstr "" "Project-Id-Version: apt 1.0.5\n" "Report-Msgid-Bugs-To: APT Development Team <deity@lists.debian.org>\n" -"POT-Creation-Date: 2020-03-24 11:53+0100\n" +"POT-Creation-Date: 2020-05-12 22:50+0200\n" "PO-Revision-Date: 2008-08-26 18:25+0300\n" "Last-Translator: Θανάσης Νάτσης <natsisthanasis@gmail.com>\n" "Language-Team: Greek <debian-l10n-greek@lists.debian.org>\n" @@ -519,11 +519,6 @@ msgid "Error reading archive member header" msgstr "Σφάλμα κατά την ανάγνωση της επικεφαλίδας του μέλους της αρχειοθήκης" #: apt-pkg/contrib/arfile.cc -#, fuzzy, c-format -msgid "Invalid archive member header %s" -msgstr "Μη έγκυρη επικεφαλίδα μέλος της αρχειοθήκης" - -#: apt-pkg/contrib/arfile.cc msgid "Invalid archive member header" msgstr "Μη έγκυρη επικεφαλίδα μέλος της αρχειοθήκης" @@ -660,8 +655,9 @@ msgid "Tar checksum failed, archive corrupted" msgstr "Το Checksum του tar απέτυχε, η αρχείοθήκη είναι κατεστραμμένη" #: apt-pkg/contrib/extracttar.cc -#, c-format -msgid "Unknown TAR header type %u, member %s" +#, fuzzy, c-format +#| msgid "Unknown TAR header type %u, member %s" +msgid "Unknown TAR header type %u" msgstr "Άγνωστη επικεφαλίδα TAR τύπος %u, μέλος %s" #: apt-pkg/contrib/fileutl.cc @@ -3832,6 +3828,10 @@ msgstr "Η σύνδεση έκλεισε πρόωρα" msgid "Empty files can't be valid archives" msgstr "" +#, fuzzy +#~ msgid "Invalid archive member header %s" +#~ msgstr "Μη έγκυρη επικεφαλίδα μέλος της αρχειοθήκης" + #~ msgid "The path %s is too long" #~ msgstr "Η διαδρομή %s έχει υπερβολικό μήκος" @@ -34,7 +34,7 @@ msgid "" msgstr "" "Project-Id-Version: apt 0.8.10\n" "Report-Msgid-Bugs-To: APT Development Team <deity@lists.debian.org>\n" -"POT-Creation-Date: 2020-03-24 11:53+0100\n" +"POT-Creation-Date: 2020-05-12 22:50+0200\n" "PO-Revision-Date: 2016-01-26 01:51+0100\n" "Last-Translator: Manuel \"Venturi\" Porras Peralta <venturi@openmailbox." "org>\n" @@ -622,11 +622,6 @@ msgid "Error reading archive member header" msgstr "Error leyendo la cabecera de miembro del archivo" #: apt-pkg/contrib/arfile.cc -#, c-format -msgid "Invalid archive member header %s" -msgstr "Cabecera de miembro del archivo inválida %s" - -#: apt-pkg/contrib/arfile.cc msgid "Invalid archive member header" msgstr "Cabecera de miembro del archivo inválida" @@ -771,8 +766,9 @@ msgstr "" "Se produjo un fallo al calcular la suma de control de tar, archivo dañado" #: apt-pkg/contrib/extracttar.cc -#, c-format -msgid "Unknown TAR header type %u, member %s" +#, fuzzy, c-format +#| msgid "Unknown TAR header type %u, member %s" +msgid "Unknown TAR header type %u" msgstr "Cabecera del TAR tipo %u desconocida, miembro %s" #: apt-pkg/contrib/fileutl.cc @@ -4044,6 +4040,9 @@ msgstr "La conexión se cerró prematuramente" msgid "Empty files can't be valid archives" msgstr "Los ficheros vacíos no pueden ser archivos válidos" +#~ msgid "Invalid archive member header %s" +#~ msgstr "Cabecera de miembro del archivo inválida %s" + #~ msgid "The path %s is too long" #~ msgstr "La trayectoria %s es demasiado larga" @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: apt 1.0.5\n" "Report-Msgid-Bugs-To: APT Development Team <deity@lists.debian.org>\n" -"POT-Creation-Date: 2020-03-24 11:53+0100\n" +"POT-Creation-Date: 2020-05-12 22:50+0200\n" "PO-Revision-Date: 2009-05-17 00:41+0200\n" "Last-Translator: Piarres Beobide <pi@beobide.net>\n" "Language-Team: Euskara <debian-l10n-basque@lists.debian.org>\n" @@ -505,11 +505,6 @@ msgid "Error reading archive member header" msgstr "Errorea artxiboko kidearen goiburua irakurtzean" #: apt-pkg/contrib/arfile.cc -#, fuzzy, c-format -msgid "Invalid archive member header %s" -msgstr "Artxiboko kidearen goiburua baliogabea da" - -#: apt-pkg/contrib/arfile.cc msgid "Invalid archive member header" msgstr "Artxiboko kidearen goiburua baliogabea da" @@ -644,8 +639,9 @@ msgid "Tar checksum failed, archive corrupted" msgstr "Tar egiaztapenak huts egin, hondatutakofitxategia" #: apt-pkg/contrib/extracttar.cc -#, c-format -msgid "Unknown TAR header type %u, member %s" +#, fuzzy, c-format +#| msgid "Unknown TAR header type %u, member %s" +msgid "Unknown TAR header type %u" msgstr "%u TAR goiburu mota ezezaguna, %s kidea" #: apt-pkg/contrib/fileutl.cc @@ -3799,6 +3795,10 @@ msgstr "Konexioa behar baino lehenago itxi da" msgid "Empty files can't be valid archives" msgstr "" +#, fuzzy +#~ msgid "Invalid archive member header %s" +#~ msgstr "Artxiboko kidearen goiburua baliogabea da" + #~ msgid "The path %s is too long" #~ msgstr "%s bidea luzeegia da" @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: apt 0.5.26\n" "Report-Msgid-Bugs-To: APT Development Team <deity@lists.debian.org>\n" -"POT-Creation-Date: 2020-03-24 11:53+0100\n" +"POT-Creation-Date: 2020-05-12 22:50+0200\n" "PO-Revision-Date: 2008-12-11 14:52+0200\n" "Last-Translator: Tapio Lehtonen <tale@debian.org>\n" "Language-Team: Finnish <debian-l10n-finnish@lists.debian.org>\n" @@ -505,11 +505,6 @@ msgid "Error reading archive member header" msgstr "Tapahtui virhe luettaessa arkiston tiedoston otsikkoa" #: apt-pkg/contrib/arfile.cc -#, fuzzy, c-format -msgid "Invalid archive member header %s" -msgstr "Arkiston tiedoston otsikko on virheellinen" - -#: apt-pkg/contrib/arfile.cc msgid "Invalid archive member header" msgstr "Arkiston tiedoston otsikko on virheellinen" @@ -643,8 +638,9 @@ msgid "Tar checksum failed, archive corrupted" msgstr "Tar-ohjelman laskema tarkistussumma ei täsmää, arkisto on turmeltunut" #: apt-pkg/contrib/extracttar.cc -#, c-format -msgid "Unknown TAR header type %u, member %s" +#, fuzzy, c-format +#| msgid "Unknown TAR header type %u, member %s" +msgid "Unknown TAR header type %u" msgstr "Tuntematon TAR-otsikon tyyppi %u, tiedosto %s" #: apt-pkg/contrib/fileutl.cc @@ -3791,6 +3787,10 @@ msgstr "Yhteys katkesi ennenaikaisesti" msgid "Empty files can't be valid archives" msgstr "" +#, fuzzy +#~ msgid "Invalid archive member header %s" +#~ msgstr "Arkiston tiedoston otsikko on virheellinen" + #~ msgid "The path %s is too long" #~ msgstr "Polku %s on liian pitkä" @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: apt 1.0.5\n" "Report-Msgid-Bugs-To: APT Development Team <deity@lists.debian.org>\n" -"POT-Creation-Date: 2020-03-24 11:53+0100\n" +"POT-Creation-Date: 2020-05-12 22:50+0200\n" "PO-Revision-Date: 2019-01-21 09:19+0100\n" "Last-Translator: Julien Patriarca <leatherface@debian.org>\n" "Language-Team: French <debian-l10n-french@lists.debian.org>\n" @@ -568,11 +568,6 @@ msgid "Error reading archive member header" msgstr "Erreur de lecture de l'en-tête du membre d'archive" #: apt-pkg/contrib/arfile.cc -#, c-format -msgid "Invalid archive member header %s" -msgstr "En-tête du membre d'archive %s non valable" - -#: apt-pkg/contrib/arfile.cc msgid "Invalid archive member header" msgstr "En-tête du membre d'archive non valable" @@ -716,8 +711,9 @@ msgid "Tar checksum failed, archive corrupted" msgstr "Échec dans la somme de contrôle de tar, l'archive est corrompue" #: apt-pkg/contrib/extracttar.cc -#, c-format -msgid "Unknown TAR header type %u, member %s" +#, fuzzy, c-format +#| msgid "Unknown TAR header type %u, member %s" +msgid "Unknown TAR header type %u" msgstr "Type d'en-tête %u inconnu pour TAR, partie %s" #: apt-pkg/contrib/fileutl.cc @@ -4065,6 +4061,9 @@ msgstr "Connexion fermée prématurément" msgid "Empty files can't be valid archives" msgstr "Les fichiers vides ne peuvent être des archives valables" +#~ msgid "Invalid archive member header %s" +#~ msgstr "En-tête du membre d'archive %s non valable" + #~ msgid "The path %s is too long" #~ msgstr "Le chemin %s est trop long" @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: apt 1.0.5\n" "Report-Msgid-Bugs-To: APT Development Team <deity@lists.debian.org>\n" -"POT-Creation-Date: 2020-03-24 11:53+0100\n" +"POT-Creation-Date: 2020-05-12 22:50+0200\n" "PO-Revision-Date: 2011-05-12 15:28+0100\n" "Last-Translator: Miguel Anxo Bouzada <mbouzada@gmail.com>\n" "Language-Team: galician <proxecto@trasno.net>\n" @@ -527,11 +527,6 @@ msgid "Error reading archive member header" msgstr "Produciuse un erro ao ler a cabeceira do membro do arquivo" #: apt-pkg/contrib/arfile.cc -#, c-format -msgid "Invalid archive member header %s" -msgstr "Cabeceira do membro do arquivo incorrecta %s" - -#: apt-pkg/contrib/arfile.cc msgid "Invalid archive member header" msgstr "Cabeceira do membro do arquivo incorrecta" @@ -670,8 +665,9 @@ msgid "Tar checksum failed, archive corrupted" msgstr "A suma de comprobación do arquivo tar non coincide, está danado" #: apt-pkg/contrib/extracttar.cc -#, c-format -msgid "Unknown TAR header type %u, member %s" +#, fuzzy, c-format +#| msgid "Unknown TAR header type %u, member %s" +msgid "Unknown TAR header type %u" msgstr "Tipo de cabeceira TAR %u descoñecido, membro %s" #: apt-pkg/contrib/fileutl.cc @@ -3873,6 +3869,9 @@ msgstr "A conexión pechouse prematuramente" msgid "Empty files can't be valid archives" msgstr "Os ficheiros baleiros non poden ser arquivadores válidos" +#~ msgid "Invalid archive member header %s" +#~ msgstr "Cabeceira do membro do arquivo incorrecta %s" + #~ msgid "The path %s is too long" #~ msgstr "A ruta %s é longa de máis" @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: apt 1.0.5\n" "Report-Msgid-Bugs-To: APT Development Team <deity@lists.debian.org>\n" -"POT-Creation-Date: 2020-03-24 11:53+0100\n" +"POT-Creation-Date: 2020-05-12 22:50+0200\n" "PO-Revision-Date: 2016-04-10 19:46+0200\n" "Last-Translator: Gabor Kelemen <kelemeng@ubuntu.com>\n" "Language-Team: Hungarian <gnome-hu-list@gnome.org>\n" @@ -556,11 +556,6 @@ msgid "Error reading archive member header" msgstr "Hiba az archívumtag-fejléc olvasásakor" #: apt-pkg/contrib/arfile.cc -#, c-format -msgid "Invalid archive member header %s" -msgstr "Érvénytelen archívumtag-fejléc: %s" - -#: apt-pkg/contrib/arfile.cc msgid "Invalid archive member header" msgstr "Érvénytelen archívumtag-fejléc" @@ -701,8 +696,9 @@ msgid "Tar checksum failed, archive corrupted" msgstr "Tar ellenőrzőösszeg nem egyezik, az archívum megsérült" #: apt-pkg/contrib/extracttar.cc -#, c-format -msgid "Unknown TAR header type %u, member %s" +#, fuzzy, c-format +#| msgid "Unknown TAR header type %u, member %s" +msgid "Unknown TAR header type %u" msgstr "Ismeretlen a(z) %u TAR fejléctípus, %s tag" #: apt-pkg/contrib/fileutl.cc @@ -3942,6 +3938,9 @@ msgstr "A kapcsolat idő előtt lezárult" msgid "Empty files can't be valid archives" msgstr "Az üres fájlok biztosan nem érvényes csomagok" +#~ msgid "Invalid archive member header %s" +#~ msgstr "Érvénytelen archívumtag-fejléc: %s" + #~ msgid "The path %s is too long" #~ msgstr "A(z) %s útvonal túl hosszú" @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: apt\n" "Report-Msgid-Bugs-To: APT Development Team <deity@lists.debian.org>\n" -"POT-Creation-Date: 2020-03-24 11:53+0100\n" +"POT-Creation-Date: 2020-05-12 22:50+0200\n" "PO-Revision-Date: 2019-03-04 11:05+0100\n" "Last-Translator: Milo Casagrande <milo@milo.name>\n" "Language-Team: Italian <tp@lists.linux.it>\n" @@ -562,11 +562,6 @@ msgid "Error reading archive member header" msgstr "Errore nel leggere l'intestazione membro dell'archivio" #: apt-pkg/contrib/arfile.cc -#, c-format -msgid "Invalid archive member header %s" -msgstr "Intestazione membro dell'archivio %s non valida" - -#: apt-pkg/contrib/arfile.cc msgid "Invalid archive member header" msgstr "Intestazione membro dell'archivio non valida" @@ -711,8 +706,9 @@ msgid "Tar checksum failed, archive corrupted" msgstr "Checksum di tar non riuscito, archivio danneggiato" #: apt-pkg/contrib/extracttar.cc -#, c-format -msgid "Unknown TAR header type %u, member %s" +#, fuzzy, c-format +#| msgid "Unknown TAR header type %u, member %s" +msgid "Unknown TAR header type %u" msgstr "Intestazione TAR di tipo %u sconosciuta, membro %s" #: apt-pkg/contrib/fileutl.cc @@ -4009,6 +4005,9 @@ msgstr "Connessione chiusa prematuramente" msgid "Empty files can't be valid archives" msgstr "File vuoti non possono essere archivi validi" +#~ msgid "Invalid archive member header %s" +#~ msgstr "Intestazione membro dell'archivio %s non valida" + #~ msgid "The path %s is too long" #~ msgstr "Il percorso %s è troppo lungo" @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: apt 1.4\n" "Report-Msgid-Bugs-To: APT Development Team <deity@lists.debian.org>\n" -"POT-Creation-Date: 2020-03-24 11:53+0100\n" +"POT-Creation-Date: 2020-05-12 22:50+0200\n" "PO-Revision-Date: 2017-01-06 04:50+0900\n" "Last-Translator: Takuma Yamada <tyamada@takumayamada.com>\n" "Language-Team: Japanese <debian-japanese@lists.debian.org>\n" @@ -558,11 +558,6 @@ msgid "Error reading archive member header" msgstr "アーカイブメンバーヘッダの読み込みに失敗しました" #: apt-pkg/contrib/arfile.cc -#, c-format -msgid "Invalid archive member header %s" -msgstr "不正なアーカイブメンバーヘッダ %s" - -#: apt-pkg/contrib/arfile.cc msgid "Invalid archive member header" msgstr "不正なアーカイブメンバーヘッダ" @@ -702,8 +697,9 @@ msgid "Tar checksum failed, archive corrupted" msgstr "tar チェックサム検証が失敗しました。アーカイブが壊れています" #: apt-pkg/contrib/extracttar.cc -#, c-format -msgid "Unknown TAR header type %u, member %s" +#, fuzzy, c-format +#| msgid "Unknown TAR header type %u, member %s" +msgid "Unknown TAR header type %u" msgstr "未知の TAR ヘッダタイプ %u、メンバー %s" #: apt-pkg/contrib/fileutl.cc @@ -3926,6 +3922,9 @@ msgstr "途中で接続がクローズされました" msgid "Empty files can't be valid archives" msgstr "空のファイルは有効なアーカイブと認められません" +#~ msgid "Invalid archive member header %s" +#~ msgstr "不正なアーカイブメンバーヘッダ %s" + #~ msgid "The path %s is too long" #~ msgstr "パス %s は長すぎます" @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: apt 1.0.5\n" "Report-Msgid-Bugs-To: APT Development Team <deity@lists.debian.org>\n" -"POT-Creation-Date: 2020-03-24 11:53+0100\n" +"POT-Creation-Date: 2020-05-12 22:50+0200\n" "PO-Revision-Date: 2006-10-10 09:48+0700\n" "Last-Translator: Khoem Sokhem <khoemsokhem@khmeros.info>\n" "Language-Team: Khmer <support@khmeros.info>\n" @@ -507,11 +507,6 @@ msgid "Error reading archive member header" msgstr "កំហុសក្នុងការអានបឋមកថាសមាជិកប័ណ្ណសារ" #: apt-pkg/contrib/arfile.cc -#, fuzzy, c-format -msgid "Invalid archive member header %s" -msgstr "បឋមកថាសមាជិកប័ណ្ណសារ" - -#: apt-pkg/contrib/arfile.cc msgid "Invalid archive member header" msgstr "បឋមកថាសមាជិកប័ណ្ណសារ" @@ -645,8 +640,9 @@ msgid "Tar checksum failed, archive corrupted" msgstr "Tar ឆេកសាំបានបរាជ័យ ប័ណ្ណសារបានខូច" #: apt-pkg/contrib/extracttar.cc -#, c-format -msgid "Unknown TAR header type %u, member %s" +#, fuzzy, c-format +#| msgid "Unknown TAR header type %u, member %s" +msgid "Unknown TAR header type %u" msgstr "មិនស្គាល់ប្រភេទបឋមកថា TAR %u ដែលជាសមាជិក %s" #: apt-pkg/contrib/fileutl.cc @@ -3775,6 +3771,10 @@ msgstr "បានបិទការតភ្ជាប់មុន msgid "Empty files can't be valid archives" msgstr "" +#, fuzzy +#~ msgid "Invalid archive member header %s" +#~ msgstr "បឋមកថាសមាជិកប័ណ្ណសារ" + #~ msgid "The path %s is too long" #~ msgstr "ផ្លូវ %s វែងពេក" @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: apt 1.0.5\n" "Report-Msgid-Bugs-To: APT Development Team <deity@lists.debian.org>\n" -"POT-Creation-Date: 2020-03-24 11:53+0100\n" +"POT-Creation-Date: 2020-05-12 22:50+0200\n" "PO-Revision-Date: 2010-08-30 02:31+0900\n" "Last-Translator: Changwoo Ryu <cwryu@debian.org>\n" "Language-Team: Korean <debian-l10n-korean@lists.debian.org>\n" @@ -507,11 +507,6 @@ msgid "Error reading archive member header" msgstr "아카이브 멤버 헤더를 읽는데 오류가 발생했습니다" #: apt-pkg/contrib/arfile.cc -#, c-format -msgid "Invalid archive member header %s" -msgstr "아카이브 멤버 헤더 %s이(가) 잘못되었습니다" - -#: apt-pkg/contrib/arfile.cc msgid "Invalid archive member header" msgstr "아카이브 멤버 헤더가 잘못되었습니다" @@ -645,8 +640,9 @@ msgid "Tar checksum failed, archive corrupted" msgstr "tar 체크섬 실패, 아카이브가 손상되었습니다" #: apt-pkg/contrib/extracttar.cc -#, c-format -msgid "Unknown TAR header type %u, member %s" +#, fuzzy, c-format +#| msgid "Unknown TAR header type %u, member %s" +msgid "Unknown TAR header type %u" msgstr "알 수 없는 TAR 헤더 타입 %u, 멤버 %s" #: apt-pkg/contrib/fileutl.cc @@ -3795,6 +3791,9 @@ msgstr "연결이 너무 빨리 끊어졌습니다" msgid "Empty files can't be valid archives" msgstr "" +#~ msgid "Invalid archive member header %s" +#~ msgstr "아카이브 멤버 헤더 %s이(가) 잘못되었습니다" + #~ msgid "The path %s is too long" #~ msgstr "경로 %s이(가) 너무 깁니다" @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: apt 1.0.5\n" "Report-Msgid-Bugs-To: APT Development Team <deity@lists.debian.org>\n" -"POT-Creation-Date: 2020-03-24 11:53+0100\n" +"POT-Creation-Date: 2020-05-12 22:50+0200\n" "PO-Revision-Date: 2008-05-08 12:48+0200\n" "Last-Translator: Erdal Ronahi <erdal.ronahi@gmail.com>\n" "Language-Team: ku <ubuntu-l10n-kur@lists.ubuntu.com>\n" @@ -496,11 +496,6 @@ msgid "Error reading archive member header" msgstr "" #: apt-pkg/contrib/arfile.cc -#, c-format -msgid "Invalid archive member header %s" -msgstr "" - -#: apt-pkg/contrib/arfile.cc msgid "Invalid archive member header" msgstr "" @@ -635,7 +630,7 @@ msgstr "" #: apt-pkg/contrib/extracttar.cc #, c-format -msgid "Unknown TAR header type %u, member %s" +msgid "Unknown TAR header type %u" msgstr "" #: apt-pkg/contrib/fileutl.cc @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: apt 1.0.5\n" "Report-Msgid-Bugs-To: APT Development Team <deity@lists.debian.org>\n" -"POT-Creation-Date: 2020-03-24 11:53+0100\n" +"POT-Creation-Date: 2020-05-12 22:50+0200\n" "PO-Revision-Date: 2008-08-02 01:47-0400\n" "Last-Translator: Gintautas Miliauskas <gintas@akl.lt>\n" "Language-Team: Lithuanian <komp_lt@konferencijos.lt>\n" @@ -502,11 +502,6 @@ msgid "Error reading archive member header" msgstr "" #: apt-pkg/contrib/arfile.cc -#, c-format -msgid "Invalid archive member header %s" -msgstr "" - -#: apt-pkg/contrib/arfile.cc msgid "Invalid archive member header" msgstr "" @@ -640,8 +635,9 @@ msgid "Tar checksum failed, archive corrupted" msgstr "Tar kontrolinė suma klaidinga, archyvas sugadintas" #: apt-pkg/contrib/extracttar.cc -#, c-format -msgid "Unknown TAR header type %u, member %s" +#, fuzzy, c-format +#| msgid "Unknown TAR header type %u, member %s" +msgid "Unknown TAR header type %u" msgstr "Nežinomas TAR antraštės tipas %u. narys %s" #: apt-pkg/contrib/fileutl.cc @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: apt 1.0.5\n" "Report-Msgid-Bugs-To: APT Development Team <deity@lists.debian.org>\n" -"POT-Creation-Date: 2020-03-24 11:53+0100\n" +"POT-Creation-Date: 2020-05-12 22:50+0200\n" "PO-Revision-Date: 2008-11-20 23:27+0530\n" "Last-Translator: Sampada <sampadanakhare@gmail.com>\n" "Language-Team: Marathi, janabhaaratii, C-DAC, Mumbai, India " @@ -505,11 +505,6 @@ msgid "Error reading archive member header" msgstr "अर्काईव्ह मेंबर शीर्षक वाचण्यास त्रुटी" #: apt-pkg/contrib/arfile.cc -#, fuzzy, c-format -msgid "Invalid archive member header %s" -msgstr "अयोग्य अर्काईव्ह मेंबर शीर्षक" - -#: apt-pkg/contrib/arfile.cc msgid "Invalid archive member header" msgstr "अयोग्य अर्काईव्ह मेंबर शीर्षक" @@ -643,8 +638,9 @@ msgid "Tar checksum failed, archive corrupted" msgstr "टार(टेपअर्काईव्ह) चेकसम चुकला, बिघडलेली अर्काईव्ह" #: apt-pkg/contrib/extracttar.cc -#, c-format -msgid "Unknown TAR header type %u, member %s" +#, fuzzy, c-format +#| msgid "Unknown TAR header type %u, member %s" +msgid "Unknown TAR header type %u" msgstr "अपरिचित TAR शीर्षक प्रकार %u, मेंबर %s" #: apt-pkg/contrib/fileutl.cc @@ -3774,6 +3770,10 @@ msgstr "जोडणी अकाली बंद झाली" msgid "Empty files can't be valid archives" msgstr "" +#, fuzzy +#~ msgid "Invalid archive member header %s" +#~ msgstr "अयोग्य अर्काईव्ह मेंबर शीर्षक" + #~ msgid "The path %s is too long" #~ msgstr "मार्ग %s हा खूप लांब आहे" @@ -12,7 +12,7 @@ msgid "" msgstr "" "Project-Id-Version: apt 1.0.5\n" "Report-Msgid-Bugs-To: APT Development Team <deity@lists.debian.org>\n" -"POT-Creation-Date: 2020-03-24 11:53+0100\n" +"POT-Creation-Date: 2020-05-12 22:50+0200\n" "PO-Revision-Date: 2018-10-30 20:53+0100\n" "Last-Translator: Petter Reinholdtsen <pere@hungry.com>\n" "Language-Team: Norwegian Bokmål <i18n-no@lister.ping.uio.no>\n" @@ -531,11 +531,6 @@ msgid "Error reading archive member header" msgstr "Feil ved lesing av arkivmedlemshode" #: apt-pkg/contrib/arfile.cc -#, c-format -msgid "Invalid archive member header %s" -msgstr "Ugyldig arkivmedlemshode %s" - -#: apt-pkg/contrib/arfile.cc msgid "Invalid archive member header" msgstr "Ugyldig arkivmedlemshode" @@ -669,8 +664,9 @@ msgid "Tar checksum failed, archive corrupted" msgstr "Tar-sjekksummen mislykkes, arkivet er ødelagt" #: apt-pkg/contrib/extracttar.cc -#, c-format -msgid "Unknown TAR header type %u, member %s" +#, fuzzy, c-format +#| msgid "Unknown TAR header type %u, member %s" +msgid "Unknown TAR header type %u" msgstr "Ukjent TAR-hode: type %u, medlem %s" #: apt-pkg/contrib/fileutl.cc @@ -3863,6 +3859,9 @@ msgstr "Forbindelsen ble uventet stengt" msgid "Empty files can't be valid archives" msgstr "Tomme filer kan ikke være gyldige arkiver" +#~ msgid "Invalid archive member header %s" +#~ msgstr "Ugyldig arkivmedlemshode %s" + #~ msgid "The path %s is too long" #~ msgstr "Stien %s er for lang" @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: apt 1.0.5\n" "Report-Msgid-Bugs-To: APT Development Team <deity@lists.debian.org>\n" -"POT-Creation-Date: 2020-03-24 11:53+0100\n" +"POT-Creation-Date: 2020-05-12 22:50+0200\n" "PO-Revision-Date: 2006-06-12 14:35+0545\n" "Last-Translator: Shiva Pokharel <pokharelshiva@hotmail.com>\n" "Language-Team: Nepali <info@mpp.org.np>\n" @@ -503,11 +503,6 @@ msgid "Error reading archive member header" msgstr "संग्रह सदस्य हेडर पढ्दा त्रुटि " #: apt-pkg/contrib/arfile.cc -#, fuzzy, c-format -msgid "Invalid archive member header %s" -msgstr "अवैध संग्रह सदस्य हेडर" - -#: apt-pkg/contrib/arfile.cc msgid "Invalid archive member header" msgstr "अवैध संग्रह सदस्य हेडर" @@ -641,8 +636,9 @@ msgid "Tar checksum failed, archive corrupted" msgstr "टार चेकसम असफल भयो, संग्रह दूषित भयो" #: apt-pkg/contrib/extracttar.cc -#, c-format -msgid "Unknown TAR header type %u, member %s" +#, fuzzy, c-format +#| msgid "Unknown TAR header type %u, member %s" +msgid "Unknown TAR header type %u" msgstr "अज्ञात टार हेडर प्रकार %u, सदस्य %s" #: apt-pkg/contrib/fileutl.cc @@ -3774,6 +3770,10 @@ msgstr "जडान असमायिक बन्द भयो" msgid "Empty files can't be valid archives" msgstr "" +#, fuzzy +#~ msgid "Invalid archive member header %s" +#~ msgstr "अवैध संग्रह सदस्य हेडर" + #~ msgid "The path %s is too long" #~ msgstr "बाटो %s अति लामो छ " @@ -10,10 +10,10 @@ # msgid "" msgstr "" -"Project-Id-Version: apt 2.0.0\n" +"Project-Id-Version: apt 2.1.4\n" "Report-Msgid-Bugs-To: APT Development Team <deity@lists.debian.org>\n" -"POT-Creation-Date: 2020-03-27 09:53+0100\n" -"PO-Revision-Date: 2020-03-12 18:02+0100\n" +"POT-Creation-Date: 2020-05-12 22:50+0200\n" +"PO-Revision-Date: 2020-05-24 14:43+0200\n" "Last-Translator: Frans Spiesschaert <Frans.Spiesschaert@yucom.be>\n" "Language-Team: Debian Dutch l10n Team <debian-l10n-dutch@lists.debian.org>\n" "Language: nl\n" @@ -566,16 +566,11 @@ msgstr "Ongeldige archiefondertekening" #: apt-pkg/contrib/arfile.cc msgid "Error reading archive member header" -msgstr "Fout bij het lezen van de koptekst van het archiefonderdeel" - -#: apt-pkg/contrib/arfile.cc -#, c-format -msgid "Invalid archive member header %s" -msgstr "Ongeldige koptekst voor archiefonderdeel %s" +msgstr "Fout bij het lezen van de header van het archiefonderdeel" #: apt-pkg/contrib/arfile.cc msgid "Invalid archive member header" -msgstr "Ongeldige koptekst in archiefonderdeel" +msgstr "Ongeldige header in archiefonderdeel" #: apt-pkg/contrib/arfile.cc msgid "Archive is too short" @@ -583,7 +578,7 @@ msgstr "Archief is te kort" #: apt-pkg/contrib/arfile.cc msgid "Failed to read the archive headers" -msgstr "Lezen van de archiefkopteksten is mislukt" +msgstr "Lezen van de archiefheaders is mislukt" #: apt-pkg/contrib/cdromutl.cc #, c-format @@ -717,8 +712,8 @@ msgstr "Tar-controlesom klopt niet, het archief is beschadigd" #: apt-pkg/contrib/extracttar.cc #, c-format -msgid "Unknown TAR header type %u, member %s" -msgstr "Onbekend TAR-kopteksttype %u, onderdeel %s" +msgid "Unknown TAR header type %u" +msgstr "Onbekend TAR-headertype %u" #: apt-pkg/contrib/fileutl.cc #, c-format @@ -1577,8 +1572,7 @@ msgstr "" #: apt-pkg/policy.cc #, c-format msgid "Invalid record in the preferences file %s, no Package header" -msgstr "" -"Ongeldig record in het voorkeurenbestand %s, 'Package'-koptekst ontbreekt" +msgstr "Ongeldig record in het voorkeurenbestand %s, geen 'Package'-header" #: apt-pkg/policy.cc #, c-format @@ -3018,7 +3012,7 @@ msgstr "" #: cmdline/apt-helper.cc msgid "analyse a pattern" -msgstr "" +msgstr "een patroon analyseren" #: cmdline/apt-internal-planner.cc msgid "" @@ -3305,7 +3299,7 @@ msgstr "Bron-extensielijst is te lang" #: ftparchive/apt-ftparchive.cc msgid "Error writing header to contents file" -msgstr "Fout bij het wegschrijven van de koptekst naar het inhoudsbestand" +msgstr "Fout bij het wegschrijven van de header naar het inhoudsbestand" #: ftparchive/apt-ftparchive.cc #, c-format @@ -3593,23 +3587,23 @@ msgstr " %s heeft ook geen voorrangsvermelding voor binaire pakketten\n" #: methods/basehttp.cc msgid "Waiting for headers" -msgstr "Wachten op de kopteksten" +msgstr "Wachten op de headers" #: methods/basehttp.cc msgid "The HTTP server sent an invalid reply header" -msgstr "De HTTP-server verstuurde een ongeldige 'reply'-koptekst" +msgstr "De HTTP-server verstuurde een ongeldige 'reply'-header" #: methods/basehttp.cc msgid "Bad header line" -msgstr "Foute koptekstregel" +msgstr "Foute header-regel" #: methods/basehttp.cc msgid "The HTTP server sent an invalid Content-Length header" -msgstr "De HTTP-server verstuurde een ongeldige 'Content-Length'-koptekst" +msgstr "De HTTP-server verstuurde een ongeldige header 'Content-Length'" #: methods/basehttp.cc msgid "The HTTP server sent an invalid Content-Range header" -msgstr "De HTTP-server verstuurde een ongeldige 'Content-Range'-koptekst" +msgstr "De HTTP-server verstuurde een ongeldige header 'Content-Range'" #: methods/basehttp.cc msgid "This HTTP server has broken range support" @@ -3621,7 +3615,7 @@ msgstr "Onbekend datumformaat" #: methods/basehttp.cc msgid "Bad header data" -msgstr "Foute koptekstdata" +msgstr "Foute headerdata" #: methods/basehttp.cc msgid "Connection failed" @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: apt 1.0.5\n" "Report-Msgid-Bugs-To: APT Development Team <deity@lists.debian.org>\n" -"POT-Creation-Date: 2020-03-24 11:53+0100\n" +"POT-Creation-Date: 2020-05-12 22:50+0200\n" "PO-Revision-Date: 2005-02-14 23:30+0100\n" "Last-Translator: Havard Korsvoll <korsvoll@skulelinux.no>\n" "Language-Team: Norwegian nynorsk <i18n-nn@lister.ping.uio.no>\n" @@ -510,11 +510,6 @@ msgid "Error reading archive member header" msgstr "Feil ved lesing av arkivmedlemshovud" #: apt-pkg/contrib/arfile.cc -#, fuzzy, c-format -msgid "Invalid archive member header %s" -msgstr "Ugyldig arkivmedlemshovud" - -#: apt-pkg/contrib/arfile.cc msgid "Invalid archive member header" msgstr "Ugyldig arkivmedlemshovud" @@ -648,8 +643,9 @@ msgid "Tar checksum failed, archive corrupted" msgstr "Tar-sjekksummen mislukkast, arkivet er ydelagt" #: apt-pkg/contrib/extracttar.cc -#, c-format -msgid "Unknown TAR header type %u, member %s" +#, fuzzy, c-format +#| msgid "Unknown TAR header type %u, member %s" +msgid "Unknown TAR header type %u" msgstr "Ukjend TAR-hovud type %u, medlem %s" #: apt-pkg/contrib/fileutl.cc @@ -3788,6 +3784,10 @@ msgstr "Sambandet vart uventa stengd" msgid "Empty files can't be valid archives" msgstr "" +#, fuzzy +#~ msgid "Invalid archive member header %s" +#~ msgstr "Ugyldig arkivmedlemshovud" + #~ msgid "The path %s is too long" #~ msgstr "Stigen %s er for lang" @@ -11,7 +11,7 @@ msgid "" msgstr "" "Project-Id-Version: apt 0.9.7.3\n" "Report-Msgid-Bugs-To: APT Development Team <deity@lists.debian.org>\n" -"POT-Creation-Date: 2020-03-24 11:53+0100\n" +"POT-Creation-Date: 2020-05-12 22:50+0200\n" "PO-Revision-Date: 2012-07-28 21:53+0200\n" "Last-Translator: Michał Kułach <michal.kulach@gmail.com>\n" "Language-Team: Polish <debian-l10n-polish@lists.debian.org>\n" @@ -534,11 +534,6 @@ msgid "Error reading archive member header" msgstr "Błąd przy czytaniu nagłówka składnika archiwum" #: apt-pkg/contrib/arfile.cc -#, c-format -msgid "Invalid archive member header %s" -msgstr "Nieprawidłowy nagłówek składnika archiwum: %s" - -#: apt-pkg/contrib/arfile.cc msgid "Invalid archive member header" msgstr "Nieprawidłowy nagłówek składnika archiwum" @@ -674,8 +669,9 @@ msgid "Tar checksum failed, archive corrupted" msgstr "Niepoprawna suma kontrolna tar, archiwum jest uszkodzone" #: apt-pkg/contrib/extracttar.cc -#, c-format -msgid "Unknown TAR header type %u, member %s" +#, fuzzy, c-format +#| msgid "Unknown TAR header type %u, member %s" +msgid "Unknown TAR header type %u" msgstr "Nieznany typ nagłówka TAR %u, składnik %s" #: apt-pkg/contrib/fileutl.cc @@ -1779,12 +1775,12 @@ msgstr "Uwaga, wybieranie \"%s\" zamiast \"%s\"\n" #: apt-private/private-cmndline.cc msgid "Most used commands:" -msgstr "" +msgstr "Najczęściej używane polecenia" #: apt-private/private-cmndline.cc #, c-format msgid "See %s for more information about the available commands." -msgstr "" +msgstr "Po więcej informacji o dostępnych poleceniach zobacz %s" #: apt-private/private-cmndline.cc msgid "" @@ -2888,7 +2884,7 @@ msgstr "Pobiera pakiet binarny do bieżącego katalogu" #: cmdline/apt-get.cc msgid "Download and display the changelog for the given package" -msgstr "Pobiera i wyświetla dziennika zmian wybranych pakietów" +msgstr "Pobiera i wyświetla dziennik zmian wybranych pakietów" #: cmdline/apt-helper.cc msgid "Need one URL as argument" @@ -3920,6 +3916,9 @@ msgstr "Połączenie zostało przedwcześnie zamknięte" msgid "Empty files can't be valid archives" msgstr "Puste pliki nie mogą być prawidłowymi archiwami" +#~ msgid "Invalid archive member header %s" +#~ msgstr "Nieprawidłowy nagłówek składnika archiwum: %s" + #~ msgid "The path %s is too long" #~ msgstr "Ścieżka %s jest zbyt długa" @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: apt 1.0.5\n" "Report-Msgid-Bugs-To: APT Development Team <deity@lists.debian.org>\n" -"POT-Creation-Date: 2020-03-24 11:53+0100\n" +"POT-Creation-Date: 2020-05-12 22:50+0200\n" "PO-Revision-Date: 2012-06-29 15:45+0100\n" "Last-Translator: Miguel Figueiredo <elmig@debianpt.org>\n" "Language-Team: Portuguese <traduz@debianpt.org>\n" @@ -533,11 +533,6 @@ msgid "Error reading archive member header" msgstr "Erro na leitura de cabeçalho membro de arquivo" #: apt-pkg/contrib/arfile.cc -#, c-format -msgid "Invalid archive member header %s" -msgstr "Cabeçalho membro de arquivo inválido %s" - -#: apt-pkg/contrib/arfile.cc msgid "Invalid archive member header" msgstr "Cabeçalho membro de arquivo inválido" @@ -674,8 +669,9 @@ msgid "Tar checksum failed, archive corrupted" msgstr "A soma de controlo do tar falhou, arquivo corrompido" #: apt-pkg/contrib/extracttar.cc -#, c-format -msgid "Unknown TAR header type %u, member %s" +#, fuzzy, c-format +#| msgid "Unknown TAR header type %u, member %s" +msgid "Unknown TAR header type %u" msgstr "Tipo de cabeçalho TAR %u desconhecido, membro %s" #: apt-pkg/contrib/fileutl.cc @@ -3896,6 +3892,9 @@ msgstr "Ligação encerrada prematuramente" msgid "Empty files can't be valid archives" msgstr "Ficheiros vazios não podem ser arquivos válidos" +#~ msgid "Invalid archive member header %s" +#~ msgstr "Cabeçalho membro de arquivo inválido %s" + #~ msgid "The path %s is too long" #~ msgstr "O caminho %s é demasiado longo" diff --git a/po/pt_BR.po b/po/pt_BR.po index 8a3a35100..c8c43278b 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: apt 1.0.5\n" "Report-Msgid-Bugs-To: APT Development Team <deity@lists.debian.org>\n" -"POT-Creation-Date: 2020-03-24 11:53+0100\n" +"POT-Creation-Date: 2020-05-12 22:50+0200\n" "PO-Revision-Date: 2008-11-17 02:33-0200\n" "Last-Translator: Felipe Augusto van de Wiel (faw) <faw@debian.org>\n" "Language-Team: Brazilian Portuguese <debian-l10n-portuguese@lists.debian." @@ -510,11 +510,6 @@ msgid "Error reading archive member header" msgstr "Erro na leitura de cabeçalho membro de arquivo" #: apt-pkg/contrib/arfile.cc -#, fuzzy, c-format -msgid "Invalid archive member header %s" -msgstr "Cabeçalho membro de arquivo inválido" - -#: apt-pkg/contrib/arfile.cc msgid "Invalid archive member header" msgstr "Cabeçalho membro de arquivo inválido" @@ -651,8 +646,9 @@ msgid "Tar checksum failed, archive corrupted" msgstr "Checksum do arquivo tar falhou, arquivo corrompido" #: apt-pkg/contrib/extracttar.cc -#, c-format -msgid "Unknown TAR header type %u, member %s" +#, fuzzy, c-format +#| msgid "Unknown TAR header type %u, member %s" +msgid "Unknown TAR header type %u" msgstr "Tipo de cabeçalho TAR %u desconhecido, membro %s" #: apt-pkg/contrib/fileutl.cc @@ -3818,6 +3814,10 @@ msgstr "Conexão encerrada prematuramente" msgid "Empty files can't be valid archives" msgstr "" +#, fuzzy +#~ msgid "Invalid archive member header %s" +#~ msgstr "Cabeçalho membro de arquivo inválido" + #~ msgid "The path %s is too long" #~ msgstr "O caminho %s é muito longo" @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: apt 1.0.5\n" "Report-Msgid-Bugs-To: APT Development Team <deity@lists.debian.org>\n" -"POT-Creation-Date: 2020-03-24 11:53+0100\n" +"POT-Creation-Date: 2020-05-12 22:50+0200\n" "PO-Revision-Date: 2008-11-15 02:21+0200\n" "Last-Translator: Eddy Petrișor <eddy.petrisor@gmail.com>\n" "Language-Team: Romanian <debian-l10n-romanian@lists.debian.org>\n" @@ -511,11 +511,6 @@ msgid "Error reading archive member header" msgstr "Eroare la citirea antetului membrului arhivei" #: apt-pkg/contrib/arfile.cc -#, fuzzy, c-format -msgid "Invalid archive member header %s" -msgstr "Antet de membru de arhivă necorespunzător" - -#: apt-pkg/contrib/arfile.cc msgid "Invalid archive member header" msgstr "Antet de membru de arhivă necorespunzător" @@ -653,8 +648,9 @@ msgstr "" "Suma de control a arhivei tar nu s-a verificat, arhiva este deteriorată" #: apt-pkg/contrib/extracttar.cc -#, c-format -msgid "Unknown TAR header type %u, member %s" +#, fuzzy, c-format +#| msgid "Unknown TAR header type %u, member %s" +msgid "Unknown TAR header type %u" msgstr "Tip antet TAR %u necunoscut, membrul %s" #: apt-pkg/contrib/fileutl.cc @@ -3829,6 +3825,10 @@ msgstr "Conexiune închisă prematur" msgid "Empty files can't be valid archives" msgstr "" +#, fuzzy +#~ msgid "Invalid archive member header %s" +#~ msgstr "Antet de membru de arhivă necorespunzător" + #~ msgid "The path %s is too long" #~ msgstr "Calea %s este prea lungă" @@ -15,7 +15,7 @@ msgid "" msgstr "" "Project-Id-Version: apt 2.0.0\n" "Report-Msgid-Bugs-To: APT Development Team <deity@lists.debian.org>\n" -"POT-Creation-Date: 2020-03-24 11:53+0100\n" +"POT-Creation-Date: 2020-05-12 22:50+0200\n" "PO-Revision-Date: 2020-03-09 22:43+0300\n" "Last-Translator: Алексей Шилин <rootlexx@mail.ru>\n" "Language-Team: русский <debian-l10n-russian@lists.debian.org>\n" @@ -563,11 +563,6 @@ msgid "Error reading archive member header" msgstr "Ошибка чтения заголовка элемента архива" #: apt-pkg/contrib/arfile.cc -#, c-format -msgid "Invalid archive member header %s" -msgstr "Неправильный заголовок элемента архива %s" - -#: apt-pkg/contrib/arfile.cc msgid "Invalid archive member header" msgstr "Неправильный заголовок элемента архива" @@ -708,8 +703,9 @@ msgid "Tar checksum failed, archive corrupted" msgstr "Неправильная контрольная сумма Tar — архив повреждён" #: apt-pkg/contrib/extracttar.cc -#, c-format -msgid "Unknown TAR header type %u, member %s" +#, fuzzy, c-format +#| msgid "Unknown TAR header type %u, member %s" +msgid "Unknown TAR header type %u" msgstr "Неизвестный тип %u, элемент %s в заголовке TAR" #: apt-pkg/contrib/fileutl.cc @@ -3981,6 +3977,9 @@ msgstr "Соединение закрыто преждевременно" msgid "Empty files can't be valid archives" msgstr "Пустые файлы не могут быть допустимыми архивами" +#~ msgid "Invalid archive member header %s" +#~ msgstr "Неправильный заголовок элемента архива %s" + #~ msgid "The path %s is too long" #~ msgstr "Слишком длинный путь %s" @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: apt 1.0.5\n" "Report-Msgid-Bugs-To: APT Development Team <deity@lists.debian.org>\n" -"POT-Creation-Date: 2020-03-24 11:53+0100\n" +"POT-Creation-Date: 2020-05-12 22:50+0200\n" "PO-Revision-Date: 2012-06-28 20:49+0100\n" "Last-Translator: Ivan Masár <helix84@centrum.sk>\n" "Language-Team: Slovak <sk-i18n@lists.linux.sk>\n" @@ -524,11 +524,6 @@ msgid "Error reading archive member header" msgstr "Chyba pri čítaní záhlavia prvku archívu" #: apt-pkg/contrib/arfile.cc -#, c-format -msgid "Invalid archive member header %s" -msgstr "Neplatná hlavička prvku archívu %s" - -#: apt-pkg/contrib/arfile.cc msgid "Invalid archive member header" msgstr "Neplatné záhlavie prvku archívu" @@ -664,8 +659,9 @@ msgid "Tar checksum failed, archive corrupted" msgstr "Kontrolný súčet pre tar zlyhal, archív je poškodený" #: apt-pkg/contrib/extracttar.cc -#, c-format -msgid "Unknown TAR header type %u, member %s" +#, fuzzy, c-format +#| msgid "Unknown TAR header type %u, member %s" +msgid "Unknown TAR header type %u" msgstr "Neznáma TAR hlavička typu %u, člen %s" #: apt-pkg/contrib/fileutl.cc @@ -3855,6 +3851,9 @@ msgstr "Spojenie bolo predčasne ukončené" msgid "Empty files can't be valid archives" msgstr "Prázdne súbory nemôžu byť platné archívy" +#~ msgid "Invalid archive member header %s" +#~ msgstr "Neplatná hlavička prvku archívu %s" + #~ msgid "The path %s is too long" #~ msgstr "Cesta %s je príliš dlhá" @@ -4,7 +4,7 @@ msgid "" msgstr "" "Project-Id-Version: apt 0.5.5\n" "Report-Msgid-Bugs-To: APT Development Team <deity@lists.debian.org>\n" -"POT-Creation-Date: 2020-03-24 11:53+0100\n" +"POT-Creation-Date: 2020-05-12 22:50+0200\n" "PO-Revision-Date: 2012-06-27 21:29+0000\n" "Last-Translator: Andrej Znidarsic <andrej.znidarsic@gmail.com>\n" "Language-Team: Slovenian <sl@li.org>\n" @@ -521,11 +521,6 @@ msgid "Error reading archive member header" msgstr "Napaka med branjem glave člana arhiva" #: apt-pkg/contrib/arfile.cc -#, c-format -msgid "Invalid archive member header %s" -msgstr "Neveljavna glava arhiva člana %s" - -#: apt-pkg/contrib/arfile.cc msgid "Invalid archive member header" msgstr "Neveljavna glava člana arhiva" @@ -661,8 +656,9 @@ msgid "Tar checksum failed, archive corrupted" msgstr "Nadzorna vsota tar ni uspela, arhiv je pokvarjen" #: apt-pkg/contrib/extracttar.cc -#, c-format -msgid "Unknown TAR header type %u, member %s" +#, fuzzy, c-format +#| msgid "Unknown TAR header type %u, member %s" +msgid "Unknown TAR header type %u" msgstr "Neznana vrsta glave TAR %u, član %s" #: apt-pkg/contrib/fileutl.cc @@ -3861,6 +3857,9 @@ msgstr "Povezava se je prezgodaj zaprla" msgid "Empty files can't be valid archives" msgstr "Prazne datoteke ne morejo biti veljavni arhivi" +#~ msgid "Invalid archive member header %s" +#~ msgstr "Neveljavna glava arhiva člana %s" + #~ msgid "The path %s is too long" #~ msgstr "Pot %s je predolga" @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: apt 1.0.5\n" "Report-Msgid-Bugs-To: APT Development Team <deity@lists.debian.org>\n" -"POT-Creation-Date: 2020-03-24 11:53+0100\n" +"POT-Creation-Date: 2020-05-12 22:50+0200\n" "PO-Revision-Date: 2015-08-19 21:33+0200\n" "Last-Translator: Anders Jonsson <anders.jonsson@norsjovallen.se>\n" "Language-Team: Swedish <debian-l10n-swedish@debian.org>\n" @@ -536,11 +536,6 @@ msgid "Error reading archive member header" msgstr "Fel vid läsning av rubrik för arkivdel" #: apt-pkg/contrib/arfile.cc -#, c-format -msgid "Invalid archive member header %s" -msgstr "Ogiltig arkivdelsrubrik %s" - -#: apt-pkg/contrib/arfile.cc msgid "Invalid archive member header" msgstr "Ogiltigt arkivdelsrubrik" @@ -675,8 +670,9 @@ msgid "Tar checksum failed, archive corrupted" msgstr "Tar-kontrollsumma misslyckades, arkivet skadat" #: apt-pkg/contrib/extracttar.cc -#, c-format -msgid "Unknown TAR header type %u, member %s" +#, fuzzy, c-format +#| msgid "Unknown TAR header type %u, member %s" +msgid "Unknown TAR header type %u" msgstr "Okänd TAR-rubriktyp %u, del %s" #: apt-pkg/contrib/fileutl.cc @@ -3898,6 +3894,9 @@ msgstr "Anslutningen stängdes i förtid" msgid "Empty files can't be valid archives" msgstr "Tomma filer kan inte vara giltiga arkiv" +#~ msgid "Invalid archive member header %s" +#~ msgstr "Ogiltig arkivdelsrubrik %s" + #~ msgid "The path %s is too long" #~ msgstr "Sökvägen %s är för lång" @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: apt 1.0.5\n" "Report-Msgid-Bugs-To: APT Development Team <deity@lists.debian.org>\n" -"POT-Creation-Date: 2020-03-24 11:53+0100\n" +"POT-Creation-Date: 2020-05-12 22:50+0200\n" "PO-Revision-Date: 2014-12-12 13:00+0700\n" "Last-Translator: Theppitak Karoonboonyanan <thep@debian.org>\n" "Language-Team: Thai <thai-l10n@googlegroups.com>\n" @@ -513,11 +513,6 @@ msgid "Error reading archive member header" msgstr "เกิดข้อผิดพลาดขณะอ่านข้อมูลส่วนหัวของสมาชิกแฟ้มจัดเก็บ" #: apt-pkg/contrib/arfile.cc -#, c-format -msgid "Invalid archive member header %s" -msgstr "ข้อมูลส่วนหัว %s ของสมาชิกแฟ้มจัดเก็บไม่ถูกต้อง" - -#: apt-pkg/contrib/arfile.cc msgid "Invalid archive member header" msgstr "ข้อมูลส่วนหัวของสมาชิกแฟ้มจัดเก็บไม่ถูกต้อง" @@ -651,8 +646,9 @@ msgid "Tar checksum failed, archive corrupted" msgstr "checksum ของแฟ้ม tar ผิดพลาด แฟ้มจัดเก็บเสียหาย" #: apt-pkg/contrib/extracttar.cc -#, c-format -msgid "Unknown TAR header type %u, member %s" +#, fuzzy, c-format +#| msgid "Unknown TAR header type %u, member %s" +msgid "Unknown TAR header type %u" msgstr "พบชนิด %u ของข้อมูลส่วนหัว TAR ที่ไม่รู้จัก ที่สมาชิก %s" #: apt-pkg/contrib/fileutl.cc @@ -3779,6 +3775,9 @@ msgstr "การเชื่อมต่อถูกปิดก่อนเว msgid "Empty files can't be valid archives" msgstr "แฟ้มว่างเปล่าไม่สามารถเป็นแฟ้มจัดเก็บที่ใช้การได้" +#~ msgid "Invalid archive member header %s" +#~ msgstr "ข้อมูลส่วนหัว %s ของสมาชิกแฟ้มจัดเก็บไม่ถูกต้อง" + #~ msgid "The path %s is too long" #~ msgstr "พาธ %s ยาวเกินไป" @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: apt 1.0.5\n" "Report-Msgid-Bugs-To: APT Development Team <deity@lists.debian.org>\n" -"POT-Creation-Date: 2020-03-24 11:53+0100\n" +"POT-Creation-Date: 2020-05-12 22:50+0200\n" "PO-Revision-Date: 2007-03-29 21:36+0800\n" "Last-Translator: Eric Pareja <xenos@upm.edu.ph>\n" "Language-Team: Tagalog <debian-tl@banwa.upm.edu.ph>\n" @@ -514,11 +514,6 @@ msgid "Error reading archive member header" msgstr "Error sa pagbasa ng header ng miyembro ng arkibo" #: apt-pkg/contrib/arfile.cc -#, fuzzy, c-format -msgid "Invalid archive member header %s" -msgstr "Hindi tanggap na header ng miyembro ng arkibo" - -#: apt-pkg/contrib/arfile.cc msgid "Invalid archive member header" msgstr "Hindi tanggap na header ng miyembro ng arkibo" @@ -656,8 +651,9 @@ msgid "Tar checksum failed, archive corrupted" msgstr "Bigo ang checksum ng tar, sira ang arkibo" #: apt-pkg/contrib/extracttar.cc -#, c-format -msgid "Unknown TAR header type %u, member %s" +#, fuzzy, c-format +#| msgid "Unknown TAR header type %u, member %s" +msgid "Unknown TAR header type %u" msgstr "Hindi kilalang uri ng TAR header %u, miyembrong %s" #: apt-pkg/contrib/fileutl.cc @@ -3811,6 +3807,10 @@ msgstr "Nagsara ng maaga ang koneksyon" msgid "Empty files can't be valid archives" msgstr "" +#, fuzzy +#~ msgid "Invalid archive member header %s" +#~ msgstr "Hindi tanggap na header ng miyembro ng arkibo" + #~ msgid "The path %s is too long" #~ msgstr "Sobrang haba ang path na %s" @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: apt 1.0.5\n" "Report-Msgid-Bugs-To: APT Development Team <deity@lists.debian.org>\n" -"POT-Creation-Date: 2020-03-24 11:53+0100\n" +"POT-Creation-Date: 2020-05-12 22:50+0200\n" "PO-Revision-Date: 2018-01-03 16:32+0300\n" "Last-Translator: Mert Dirik <mertdirik@gmail.com>\n" "Language-Team: Debian l10n Turkish <debian-l10n-turkish@lists.debian.org>\n" @@ -553,11 +553,6 @@ msgid "Error reading archive member header" msgstr "Arşiv üyesi başlığı okuma hatası" #: apt-pkg/contrib/arfile.cc -#, c-format -msgid "Invalid archive member header %s" -msgstr "Geçersiz arşiv üyesi başlığı %s" - -#: apt-pkg/contrib/arfile.cc msgid "Invalid archive member header" msgstr "Geçersiz arşiv üyesi başlığı" @@ -698,8 +693,9 @@ msgid "Tar checksum failed, archive corrupted" msgstr "Tar sağlama toplamı başarısız, arşiv bozulmuş" #: apt-pkg/contrib/extracttar.cc -#, c-format -msgid "Unknown TAR header type %u, member %s" +#, fuzzy, c-format +#| msgid "Unknown TAR header type %u, member %s" +msgid "Unknown TAR header type %u" msgstr "Bilinmeyen TAR başlığı türü %u, üye %s" #: apt-pkg/contrib/fileutl.cc @@ -3932,6 +3928,9 @@ msgstr "Bağlantı vaktinden önce kapandı" msgid "Empty files can't be valid archives" msgstr "Boş dosyalar geçerli birer arşiv dosyası olamazlar" +#~ msgid "Invalid archive member header %s" +#~ msgstr "Geçersiz arşiv üyesi başlığı %s" + #~ msgid "The path %s is too long" #~ msgstr "%s yolu çok uzun" @@ -12,7 +12,7 @@ msgid "" msgstr "" "Project-Id-Version: apt 1.0.5\n" "Report-Msgid-Bugs-To: APT Development Team <deity@lists.debian.org>\n" -"POT-Creation-Date: 2020-03-24 11:53+0100\n" +"POT-Creation-Date: 2020-05-12 22:50+0200\n" "PO-Revision-Date: 2012-09-25 20:19+0300\n" "Last-Translator: A. Bondarenko <artem.brz@gmail.com>\n" "Language-Team: Українська <uk@li.org>\n" @@ -529,11 +529,6 @@ msgid "Error reading archive member header" msgstr "Неможливо прочитати заголовок 'member' в архіві" #: apt-pkg/contrib/arfile.cc -#, fuzzy, c-format -msgid "Invalid archive member header %s" -msgstr "Невірний заголовок 'member' %s в архіві" - -#: apt-pkg/contrib/arfile.cc #, fuzzy msgid "Invalid archive member header" msgstr "Невірний заголовок 'member' в архіві" @@ -673,8 +668,9 @@ msgid "Tar checksum failed, archive corrupted" msgstr "Контрольна сума tar архіва невірна, архів пошкоджений" #: apt-pkg/contrib/extracttar.cc -#, c-format -msgid "Unknown TAR header type %u, member %s" +#, fuzzy, c-format +#| msgid "Unknown TAR header type %u, member %s" +msgid "Unknown TAR header type %u" msgstr "Невідомий тип заголовку TAR - %u, член %s" #: apt-pkg/contrib/fileutl.cc @@ -3916,6 +3912,10 @@ msgstr "З'єднання завершено передчасно" msgid "Empty files can't be valid archives" msgstr "Пусті файли не можуть бути правильними архівами" +#, fuzzy +#~ msgid "Invalid archive member header %s" +#~ msgstr "Невірний заголовок 'member' %s в архіві" + #~ msgid "The path %s is too long" #~ msgstr "Шлях %s занадто довгий" @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: apt 1.0.8\n" "Report-Msgid-Bugs-To: APT Development Team <deity@lists.debian.org>\n" -"POT-Creation-Date: 2020-03-24 11:53+0100\n" +"POT-Creation-Date: 2020-05-12 22:50+0200\n" "PO-Revision-Date: 2014-09-12 13:48+0700\n" "Last-Translator: Trần Ngọc Quân <vnwildman@gmail.com>\n" "Language-Team: Vietnamese <translation-team-vi@lists.sourceforge.net>\n" @@ -526,11 +526,6 @@ msgid "Error reading archive member header" msgstr "Gặp lỗi khi đọc phần đầu thành viên kho" #: apt-pkg/contrib/arfile.cc -#, c-format -msgid "Invalid archive member header %s" -msgstr "Phần đầu thành viên kho lưu không hợp lệ %s" - -#: apt-pkg/contrib/arfile.cc msgid "Invalid archive member header" msgstr "Phần đầu thành viên kho không hợp lê" @@ -666,8 +661,9 @@ msgid "Tar checksum failed, archive corrupted" msgstr "Gặp lỗi khi tổng kiểm “tar”, kho bị hỏng" #: apt-pkg/contrib/extracttar.cc -#, c-format -msgid "Unknown TAR header type %u, member %s" +#, fuzzy, c-format +#| msgid "Unknown TAR header type %u, member %s" +msgid "Unknown TAR header type %u" msgstr "Không rõ kiểu phần đầu tar %u, thành viên %s" #: apt-pkg/contrib/fileutl.cc @@ -3889,6 +3885,9 @@ msgstr "Kết nối bị đóng bất ngờ" msgid "Empty files can't be valid archives" msgstr "Các tập tin trống rỗng không phải là kho lưu hợp lệ" +#~ msgid "Invalid archive member header %s" +#~ msgstr "Phần đầu thành viên kho lưu không hợp lệ %s" + #~ msgid "The path %s is too long" #~ msgstr "Đường dẫn %s quá dài" diff --git a/po/zh_CN.po b/po/zh_CN.po index c13c99ca1..f8f510622 100644 --- a/po/zh_CN.po +++ b/po/zh_CN.po @@ -11,7 +11,7 @@ msgid "" msgstr "" "Project-Id-Version: apt 2.0.1\n" "Report-Msgid-Bugs-To: APT Development Team <deity@lists.debian.org>\n" -"POT-Creation-Date: 2020-03-24 11:53+0100\n" +"POT-Creation-Date: 2020-05-12 22:50+0200\n" "PO-Revision-Date: 2020-03-26 17:38-0400\n" "Last-Translator: Boyuan Yang <073plan@gmail.com>\n" "Language-Team: Chinese (simplified) <debian-l10n-chinese@lists.debian.org>\n" @@ -522,11 +522,6 @@ msgid "Error reading archive member header" msgstr "读取归档成员文件头出错" #: apt-pkg/contrib/arfile.cc -#, c-format -msgid "Invalid archive member header %s" -msgstr "归档文件中成员文件头 %s 无效" - -#: apt-pkg/contrib/arfile.cc msgid "Invalid archive member header" msgstr "归档文件中成员文件头无效" @@ -660,8 +655,9 @@ msgid "Tar checksum failed, archive corrupted" msgstr "Tar 的校验和不符,文件已损坏" #: apt-pkg/contrib/extracttar.cc -#, c-format -msgid "Unknown TAR header type %u, member %s" +#, fuzzy, c-format +#| msgid "Unknown TAR header type %u, member %s" +msgid "Unknown TAR header type %u" msgstr "未知的 TAR 数据头类型 %u,成员 %s" #: apt-pkg/contrib/fileutl.cc @@ -3761,6 +3757,9 @@ msgstr "连接被永久关闭" msgid "Empty files can't be valid archives" msgstr "空文件不是有效归档" +#~ msgid "Invalid archive member header %s" +#~ msgstr "归档文件中成员文件头 %s 无效" + #~ msgid "The path %s is too long" #~ msgstr "路径名 %s 太长" diff --git a/po/zh_TW.po b/po/zh_TW.po index 896716ca1..4a8128058 100644 --- a/po/zh_TW.po +++ b/po/zh_TW.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: apt 1.2.X\n" "Report-Msgid-Bugs-To: APT Development Team <deity@lists.debian.org>\n" -"POT-Creation-Date: 2020-03-24 11:53+0100\n" +"POT-Creation-Date: 2020-05-12 22:50+0200\n" "PO-Revision-Date: 2009-01-28 10:41+0800\n" "Last-Translator: Tetralet <tetralet@gmail.com>\n" "Language-Team: Debian-user in Chinese [Big5] <debian-chinese-big5@lists." @@ -504,11 +504,6 @@ msgid "Error reading archive member header" msgstr "讀取套件檔的成員標頭訊息時發生錯誤" #: apt-pkg/contrib/arfile.cc -#, fuzzy, c-format -msgid "Invalid archive member header %s" -msgstr "無效的套件檔成員標頭" - -#: apt-pkg/contrib/arfile.cc msgid "Invalid archive member header" msgstr "無效的套件檔成員標頭" @@ -642,8 +637,9 @@ msgid "Tar checksum failed, archive corrupted" msgstr "Tar checksum 失敗,套件檔已損毀" #: apt-pkg/contrib/extracttar.cc -#, c-format -msgid "Unknown TAR header type %u, member %s" +#, fuzzy, c-format +#| msgid "Unknown TAR header type %u, member %s" +msgid "Unknown TAR header type %u" msgstr "未知的 TAR 標頭類型 %u,成員 %s" #: apt-pkg/contrib/fileutl.cc @@ -3753,6 +3749,10 @@ msgstr "連線突然終止" msgid "Empty files can't be valid archives" msgstr "" +#, fuzzy +#~ msgid "Invalid archive member header %s" +#~ msgstr "無效的套件檔成員標頭" + #~ msgid "The path %s is too long" #~ msgstr "路徑 %s 過長" diff --git a/test/integration/framework b/test/integration/framework index 44dedb10b..e30fa066c 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -585,10 +585,14 @@ configdpkg() { # the arch apt treats as native might be foreign for dpkg for ARCH in ${ARCHS}; do if [ "${ARCH}" != "${DPKGARCH}" ]; then - if ! dpkg --add-architecture ${ARCH} >/dev/null 2>&1; then - # old-style used e.g. in Ubuntu-P – and as it seems travis - echo "DPKG::options:: \"--foreign-architecture\";" >> rootdir/etc/apt/apt.conf.d/00foreigndpkg - echo "DPKG::options:: \"${ARCH}\";" >> rootdir/etc/apt/apt.conf.d/00foreigndpkg + if ! dpkg --add-architecture ${ARCH} >rootdir/tmp/dpkgaddarch.output 2>&1; then + if grep -q 'pkg-config-dpkghook' rootdir/tmp/dpkgaddarch.output; then + msgwarn 'Ignoring failure of dpkg --add-architecture as it is likely due to pkg-config-dpkghook (see #824774)' + else + # old-style used e.g. in Ubuntu-P – and as it seems travis + echo "DPKG::options:: \"--foreign-architecture\";" >> rootdir/etc/apt/apt.conf.d/00foreigndpkg + echo "DPKG::options:: \"${ARCH}\";" >> rootdir/etc/apt/apt.conf.d/00foreigndpkg + fi fi fi done diff --git a/test/integration/test-bug-549968-install-depends-of-not-installed b/test/integration/test-bug-549968-install-depends-of-not-installed index fab67c4e9..90ce58a33 100755 --- a/test/integration/test-bug-549968-install-depends-of-not-installed +++ b/test/integration/test-bug-549968-install-depends-of-not-installed @@ -17,7 +17,7 @@ setupaptarchive testsuccessequal "Reading package lists... Building dependency tree... MarkInstall coolstuff:i386 < none -> 1.0 @un puN IPb > FU=1 - Ignore MarkInstall of extracoolstuff:i386 < none | 1.0 @hn puH > as its mode (Keep) is protected + coolstuff:i386 Recommends on extracoolstuff:i386 < none | 1.0 @hn puH > can't be satisfied! (dep) Package 'extracoolstuff' is not installed, so not removed Recommended packages: extracoolstuff diff --git a/test/integration/test-bug-604222-new-and-autoremove b/test/integration/test-bug-604222-new-and-autoremove index 6009ca0d2..aaeac09a8 100755 --- a/test/integration/test-bug-604222-new-and-autoremove +++ b/test/integration/test-bug-604222-new-and-autoremove @@ -59,12 +59,10 @@ The following package was automatically installed and is no longer required: libvtk5.4 Use '$AUTOREMOVE' to remove it. The following additional packages will be installed: - libavcodec52 libopenal-dev libvtk5.4 + libavcodec52 libopenal-dev The following NEW packages will be installed: dummy-archive libavcodec52 libopenal-dev -The following packages will be upgraded: - libvtk5.4 -1 upgraded, 3 newly installed, 0 to remove and 0 not upgraded. +0 upgraded, 3 newly installed, 0 to remove and 1 not upgraded. After this operation, 129 kB of additional disk space will be used. E: Trivial Only specified but this is not a trivial operation." aptget install dummy-archive --trivial-only testequal "Reading package lists... @@ -73,12 +71,10 @@ Reading state information... 1 package was automatically installed and is no longer required. Use '$AUTOREMOVE' to remove it. The following additional packages will be installed: - libavcodec52 libopenal-dev libvtk5.4 + libavcodec52 libopenal-dev The following NEW packages will be installed: dummy-archive libavcodec52 libopenal-dev -The following packages will be upgraded: - libvtk5.4 -1 upgraded, 3 newly installed, 0 to remove and 0 not upgraded. +0 upgraded, 3 newly installed, 0 to remove and 1 not upgraded. After this operation, 129 kB of additional disk space will be used. E: Trivial Only specified but this is not a trivial operation." aptget install dummy-archive --trivial-only -o APT::Get::HideAutoRemove=small @@ -88,12 +84,11 @@ rm -f rootdir/var/lib/apt/extended_states CONFLICTING='Reading package lists... Building dependency tree... MarkInstall dummy-archive:i386 < none -> 0.invalid.0 @un puN Ib > FU=1 - MarkInstall libvtk5-dev:i386 < none -> 5.4.2-8 @un uN Ib > FU=0 - MarkInstall libvtk5.4:i386 < none -> 5.4.2-8 @un uN > FU=0 - MarkKeep libvtk5-dev:i386 < none -> 5.4.2-8 @un uN > FU=0 - MarkKeep libvtk5-dev:i386 < none -> 5.4.2-8 @un uN > FU=0 + MarkInstall libavcodec52:i386 < none -> 4:0.5.2-6 @un puN > FU=0 + MarkInstall libopenal-dev:i386 < none -> 1:1.12.854-2 @un puN > FU=0 + Ignore MarkGarbage of libopenal-dev:i386 < none -> 1:1.12.854-2 @un puN > as its mode (Install) is protected Ignore MarkGarbage of libavcodec52:i386 < none -> 4:0.5.2-6 @un puN > as its mode (Install) is protected - MarkDelete libvtk5.4:i386 < none -> 5.4.2-8 @un ugN > FU=0 + Ignore MarkGarbage of libopenal-dev:i386 < none -> 1:1.12.854-2 @un puN > as its mode (Install) is protected Ignore MarkGarbage of libavcodec52:i386 < none -> 4:0.5.2-6 @un puN > as its mode (Install) is protected The following additional packages will be installed: libavcodec52 libopenal-dev diff --git a/test/integration/test-bug-618848-always-respect-user-requests b/test/integration/test-bug-618848-always-respect-user-requests index 230683a99..1e144f1ee 100755 --- a/test/integration/test-bug-618848-always-respect-user-requests +++ b/test/integration/test-bug-618848-always-respect-user-requests @@ -13,11 +13,12 @@ insertpackage 'unstable' 'exim4-daemon-heavy' 'all' '1.0' 'Depends: libdb4.8' setupaptarchive -testsuccessequal 'Reading package lists... +testsuccessequal "Reading package lists... Building dependency tree... MarkDelete libdb4.8:i386 < 1.0 @ii pmK > FU=1 MarkDelete exim4-daemon-light:i386 < 1.0 @ii mK Ib > FU=0 MarkInstall exim4-daemon-heavy:i386 < none -> 1.0 @un uN Ib > FU=0 + exim4-daemon-heavy:i386 Depends on libdb4.8:i386 < 1.0 @ii pmR > can't be satisfied! (dep) MarkDelete exim4:i386 < 1.0 @ii mK Ib > FU=0 The following packages will be REMOVED: exim4 exim4-daemon-light libdb4.8 @@ -27,4 +28,4 @@ Remv exim4 [1.0] MarkDelete exim4-daemon-light:i386 < 1.0 @ii K > FU=1 Remv exim4-daemon-light [1.0] MarkDelete libdb4.8:i386 < 1.0 @ii K > FU=1 -Remv libdb4.8 [1.0]' aptget remove libdb4.8 -s -o Debug::pkgDepCache::Marker=1 +Remv libdb4.8 [1.0]" aptget remove libdb4.8 -s -o Debug::pkgDepCache::Marker=1 diff --git a/test/integration/test-bug-735967-lib32-to-i386-unavailable b/test/integration/test-bug-735967-lib32-to-i386-unavailable index 9dbd17bfd..b836451fd 100755 --- a/test/integration/test-bug-735967-lib32-to-i386-unavailable +++ b/test/integration/test-bug-735967-lib32-to-i386-unavailable @@ -53,7 +53,7 @@ The following information may help to resolve the situation: The following packages have unmet dependencies: libfoo : Depends: libfoo-bin but it is not installable -E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.' aptget install foo -s +E: Unable to correct problems, you have held broken packages.' aptget install foo -s # activate multiarch configarchitecture 'amd64' 'i386' diff --git a/test/integration/test-bug-960705-propagate-protected-to-satisfied-conflict b/test/integration/test-bug-960705-propagate-protected-to-satisfied-conflict new file mode 100755 index 000000000..ad1501b66 --- /dev/null +++ b/test/integration/test-bug-960705-propagate-protected-to-satisfied-conflict @@ -0,0 +1,53 @@ +#!/bin/sh +set -e + +TESTDIR="$(readlink -f "$(dirname "$0")")" +. "$TESTDIR/framework" +setupenvironment +configarchitecture 'amd64' + +insertpackage 'unstable' 'runit-init' 'all' '1' 'Conflicts: systemd-sysv, sysvinit-core, runit-init' +# note how the rest do not know of runit-init +insertpackage 'unstable' 'sysvinit-core' 'all' '1' 'Conflicts: systemd-sysv, sysvinit-core' +insertpackage 'unstable,installed' 'systemd-sysv' 'all' '1' 'Conflicts: systemd-sysv, sysvinit-core' +insertpackage 'unstable,installed' 'init' 'all' '1' 'Pre-Depends: systemd-sysv | sysvinit-core +Important: yes' + +setupaptarchive + +testsuccessequal "Reading package lists... +Building dependency tree... + Removing: systemd-sysv:amd64 as upgrade is not an option for runit-init:amd64 (1) + MarkDelete systemd-sysv:amd64 < 1 @ii mK > FU=0 + MarkInstall runit-init:amd64 < none -> 1 @un puN > FU=1 +Starting pkgProblemResolver with broken count: 1 +Starting 2 pkgProblemResolver with broken count: 1 +Investigating (0) init:amd64 < 1 @ii mK Ib > +Broken init:amd64 PreDepends on systemd-sysv:amd64 < 1 @ii pmR > + Considering systemd-sysv:amd64 0 as a solution to init:amd64 5100 + Added systemd-sysv:amd64 to the remove list +Broken init:amd64 PreDepends on sysvinit-core:amd64 < none @un pH > + Considering sysvinit-core:amd64 0 as a solution to init:amd64 5100 + Ignore MarkKeep of systemd-sysv:amd64 < 1 @ii pmR > as its mode (Delete) is protected +Investigating (1) init:amd64 < 1 @ii mK Ib > +Broken init:amd64 PreDepends on systemd-sysv:amd64 < 1 @ii pmR > + Considering systemd-sysv:amd64 5100 as a solution to init:amd64 5100 +Broken init:amd64 PreDepends on sysvinit-core:amd64 < none @un pH > + Considering sysvinit-core:amd64 0 as a solution to init:amd64 5100 + Or group remove for init:amd64 + MarkDelete init:amd64 < 1 @ii mK Ib > FU=0 +Done +The following packages will be REMOVED: + init systemd-sysv +The following NEW packages will be installed: + runit-init +WARNING: The following essential packages will be removed. +This should NOT be done unless you know exactly what you are doing! + init systemd-sysv (due to init) + MarkDelete init:amd64 < 1 @ii K > FU=1 +0 upgraded, 1 newly installed, 2 to remove and 0 not upgraded. +Remv init [1] + MarkDelete systemd-sysv:amd64 < 1 | none @ii H > FU=1 +Remv systemd-sysv [1] +Inst runit-init (1 unstable [all]) +Conf runit-init (1 unstable [all])" apt install runit-init -so Debug::pkgProblemResolver=1 -o Debug::pkgDepCache::Marker=1 -o Debug::pkgDepCache::AutoInstall=1 diff --git a/test/integration/test-bug-960705-propagate-protected-to-satisfied-depends b/test/integration/test-bug-960705-propagate-protected-to-satisfied-depends new file mode 100755 index 000000000..ca6bf8d7c --- /dev/null +++ b/test/integration/test-bug-960705-propagate-protected-to-satisfied-depends @@ -0,0 +1,45 @@ +#!/bin/sh +set -e + +TESTDIR="$(readlink -f "$(dirname "$0")")" +. "$TESTDIR/framework" +setupenvironment +configarchitecture 'amd64' + +# without requires-foo it is sadly not as clear cut what should happen +insertpackage 'unstable' 'foobar' 'all' '1' 'Depends: foo | bar, requires-foo, conflicts-foo | fine-foo' +insertpackage 'unstable' 'foo' 'all' '1' 'Depends: foo-depends' +insertpackage 'unstable' 'foo-depends' 'all' '1' +insertpackage 'unstable' 'bar' 'all' '1' +insertpackage 'unstable' 'requires-foo' 'all' '1' 'Depends: foo' +insertpackage 'unstable' 'conflicts-foo' 'all' '1' 'Conflicts: foo' +insertpackage 'unstable' 'fine-foo' 'all' '1' + + +setupaptarchive + +testsuccessequal "Reading package lists... +Building dependency tree... + Installing foo:amd64 as Depends of foobar:amd64 + Installing foo-depends:amd64 as Depends of foo:amd64 + Installing requires-foo:amd64 as Depends of foobar:amd64 + Installing conflicts-foo:amd64 as Depends of foobar:amd64 + Installing fine-foo:amd64 as Depends of foobar:amd64 +Starting pkgProblemResolver with broken count: 0 +Starting 2 pkgProblemResolver with broken count: 0 +Done +The following additional packages will be installed: + fine-foo foo foo-depends requires-foo +The following NEW packages will be installed: + fine-foo foo foo-depends foobar requires-foo +0 upgraded, 5 newly installed, 0 to remove and 0 not upgraded. +Inst fine-foo (1 unstable [all]) +Inst foo-depends (1 unstable [all]) +Inst foo (1 unstable [all]) +Inst requires-foo (1 unstable [all]) +Inst foobar (1 unstable [all]) +Conf fine-foo (1 unstable [all]) +Conf foo-depends (1 unstable [all]) +Conf foo (1 unstable [all]) +Conf requires-foo (1 unstable [all]) +Conf foobar (1 unstable [all])" apt install foobar -so Debug::pkgProblemResolver=1 -o Debug::pkgDepCache::AutoInstall=1 diff --git a/test/integration/test-bug-961266-hold-means-hold b/test/integration/test-bug-961266-hold-means-hold new file mode 100755 index 000000000..89c18ba85 --- /dev/null +++ b/test/integration/test-bug-961266-hold-means-hold @@ -0,0 +1,124 @@ +#!/bin/sh +set -e + +TESTDIR="$(readlink -f "$(dirname "$0")")" +. "$TESTDIR/framework" +setupenvironment +configarchitecture 'amd64' 'i386' + +insertinstalledpackage 'git' 'amd64' '1:2.25.1-1' 'Multi-Arch: foreign' +insertinstalledpackage 'git-cvs' 'amd64' '1:2.25.1-1' 'Depends: git (>> 1:2.25.1), git (<< 1:2.25.1-.)' + + +insertpackage 'unstable' 'git' 'amd64,i386' '1:2.26.2-1' 'Multi-Arch: foreign' +insertpackage 'unstable' 'git-cvs' 'amd64,i386' '1:2.26.2-1' 'Depends: git (>> 1:2.26.2), git (<< 1:2.26.2-.)' +insertpackage 'unstable' 'git-ng' 'amd64,i386' '1:2.26.2-1' 'Depends: git (>> 1:2.26.2), git (<< 1:2.26.2-.)' + +setupaptarchive + +msgmsg 'The setup is' 'fine' +UPGRADE='Reading package lists... +Building dependency tree... +Calculating upgrade... +The following packages will be upgraded: + git git-cvs +2 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. +Inst git-cvs [1:2.25.1-1] (1:2.26.2-1 unstable [amd64]) [] +Inst git [1:2.25.1-1] (1:2.26.2-1 unstable [amd64]) +Conf git-cvs (1:2.26.2-1 unstable [amd64]) +Conf git (1:2.26.2-1 unstable [amd64])' +testsuccessequal "$UPGRADE" apt upgrade -s +testsuccessequal "$UPGRADE" aptget upgrade -s +testsuccessequal "$UPGRADE" apt full-upgrade -s +testsuccessequal "$UPGRADE" aptget dist-upgrade -s + +testsuccessequal 'Reading package lists... +Building dependency tree... +The following additional packages will be installed: + git git-cvs +The following NEW packages will be installed: + git-ng +The following packages will be upgraded: + git git-cvs +2 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. +Inst git-cvs [1:2.25.1-1] (1:2.26.2-1 unstable [amd64]) [] +Inst git [1:2.25.1-1] (1:2.26.2-1 unstable [amd64]) +Inst git-ng (1:2.26.2-1 unstable [amd64]) +Conf git-cvs (1:2.26.2-1 unstable [amd64]) +Conf git (1:2.26.2-1 unstable [amd64]) +Conf git-ng (1:2.26.2-1 unstable [amd64])' apt install git-ng -s + + +msgmsg 'Now mix it up by' 'holding git' +testsuccessequal 'git set on hold.' aptmark hold git +testsuccessequal 'git' aptmark showholds + +NOUPGRADE='Reading package lists... +Building dependency tree... +Calculating upgrade... +The following packages have been kept back: + git git-cvs +0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.' + +testsuccessequal "$NOUPGRADE" apt upgrade -s +testsuccessequal "$NOUPGRADE" apt full-upgrade -s +testsuccessequal "$NOUPGRADE" aptget dist-upgrade -s +testsuccessequal "$NOUPGRADE" aptget upgrade -s + +testfailureequal 'Reading package lists... +Building dependency tree... +Some packages could not be installed. This may mean that you have +requested an impossible situation or if you are using the unstable +distribution that some required packages have not yet been created +or been moved out of Incoming. +The following information may help to resolve the situation: + +The following packages have unmet dependencies: + git-ng : Depends: git (> 1:2.26.2) +E: Unable to correct problems, you have held broken packages.' apt install git-ng -s + + +msgmsg 'Now mix it up by' 'holding git-cvs' +testsuccessequal 'Canceled hold on git.' aptmark unhold git +testsuccessequal 'git-cvs set on hold.' aptmark hold git-cvs +testsuccessequal 'git-cvs' aptmark showholds + +testsuccessequal "$NOUPGRADE" apt upgrade -s +testsuccessequal "$NOUPGRADE" apt full-upgrade -s +testsuccessequal "$NOUPGRADE" aptget upgrade -s +testsuccessequal "$NOUPGRADE" aptget dist-upgrade -s + +testfailureequal 'Reading package lists... +Building dependency tree... +Some packages could not be installed. This may mean that you have +requested an impossible situation or if you are using the unstable +distribution that some required packages have not yet been created +or been moved out of Incoming. +The following information may help to resolve the situation: + +The following packages have unmet dependencies: + git-cvs : Depends: git (< 1:2.25.1-.) +E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.' apt install git-ng -s + + +msgmsg 'Now mix it up by' 'holding both' +testsuccessequal 'git set on hold.' aptmark hold git +testsuccessequal 'git +git-cvs' aptmark showholds + +testsuccessequal "$NOUPGRADE" apt upgrade -s +testsuccessequal "$NOUPGRADE" apt full-upgrade -s +testsuccessequal "$NOUPGRADE" aptget upgrade -s +testsuccessequal "$NOUPGRADE" aptget dist-upgrade -s + +testfailureequal 'Reading package lists... +Building dependency tree... +Some packages could not be installed. This may mean that you have +requested an impossible situation or if you are using the unstable +distribution that some required packages have not yet been created +or been moved out of Incoming. +The following information may help to resolve the situation: + +The following packages have unmet dependencies: + git-ng : Depends: git (> 1:2.26.2) +E: Unable to correct problems, you have held broken packages.' apt install git-ng -s diff --git a/test/integration/test-dpkg-i-apt-install-fix-broken b/test/integration/test-dpkg-i-apt-install-fix-broken new file mode 100755 index 000000000..8d800ffb7 --- /dev/null +++ b/test/integration/test-dpkg-i-apt-install-fix-broken @@ -0,0 +1,34 @@ +#!/bin/sh +set -e + +TESTDIR="$(readlink -f "$(dirname "$0")")" +. "$TESTDIR/framework" +setupenvironment +configarchitecture 'amd64' + +buildsimplenativepackage 'autopkgtest-satdep' 'amd64' '1' 'stable' 'Depends: debhelper-compat (= 12)' +buildsimplenativepackage 'debhelper' 'all' '1' 'stable' 'Provides: debhelper-compat (= 12)' + +setupaptarchive + +testfailure dpkg -i incoming/autopkgtest-*.deb +testsuccessequal 'Reading package lists... +Building dependency tree... +Correcting dependencies... MarkInstall autopkgtest-satdep:amd64 < 1 @iU mK Nb Ib > FU=0 + MarkInstall debhelper:amd64 < none -> 1 @un uN > FU=0 +Starting pkgProblemResolver with broken count: 0 +Starting 2 pkgProblemResolver with broken count: 0 +Done + Done +Starting pkgProblemResolver with broken count: 0 +Starting 2 pkgProblemResolver with broken count: 0 +Done +The following additional packages will be installed: + debhelper +The following NEW packages will be installed: + debhelper +0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. +1 not fully installed or removed. +Inst debhelper (1 stable [all]) +Conf debhelper (1 stable [all]) +Conf autopkgtest-satdep (1 stable [amd64])' apt install -fso Debug::pkgProblemResolver=1 -o DEbug::pkgDepCache::Marker=1 diff --git a/test/integration/test-dpkg-protected b/test/integration/test-dpkg-protected new file mode 100755 index 000000000..3d0994d89 --- /dev/null +++ b/test/integration/test-dpkg-protected @@ -0,0 +1,20 @@ +#!/bin/sh +set -e + +TESTDIR="$(readlink -f "$(dirname "$0")")" +. "$TESTDIR/framework" +setupenvironment +configarchitecture 'amd64' + +insertinstalledpackage 'protected-package' 'native' '1' 'Protected: yes' + +setupaptarchive + + +if dpkg --assert-protected-field 2>/dev/null; then + testsuccess aptget remove protected-package "$@" -o Debug::pkgDpkgPm=1 -y --allow-remove-essential + cp rootdir/tmp/testsuccess.output rootdir/tmp/output + testsuccess grep -- '--force-remove-protected' rootdir/tmp/output +else + msgskip "dpkg does not support protected field" +fi diff --git a/test/integration/test-explore-or-groups-in-markinstall b/test/integration/test-explore-or-groups-in-markinstall index 5669e47b3..ba3376cf6 100755 --- a/test/integration/test-explore-or-groups-in-markinstall +++ b/test/integration/test-explore-or-groups-in-markinstall @@ -9,16 +9,17 @@ configarchitecture 'amd64' insertpackage 'unstable' 'okay' 'all' '1' insertpackage 'unstable' 'upgrade' 'all' '2' insertpackage 'unstable' 'unneeded' 'all' '1' +insertpackage 'unstable' 'unneeded2' 'all' '1' 'Depends: bad-level1' insertpackage 'unstable' 'later' 'all' '1' insertpackage 'unstable' 'bad-level0' 'all' '1' 'Depends: unneeded, unknown' insertpackage 'unstable' 'bad-level1' 'all' '1' 'Depends: bad-level0' insertpackage 'unstable' 'bad-upgrade-level0' 'all' '2' 'Depends: unneeded, unknown' -insertpackage 'unstable' 'bad-upgrade-level1' 'all' '2' 'Depends: bad-upgrade-level0 (>= 2)' +insertpackage 'unstable' 'bad-upgrade-level1' 'all' '2' 'Depends: bad-upgrade-level0 (>= 2), unneeded2' insertpackage 'unstable' 'bad-conflict-level0' 'all' '1' 'Depends: unneeded Conflicts: bad-conflict-level2' insertpackage 'unstable' 'bad-conflict-level1' 'all' '1' 'Depends: bad-conflict-level0' -insertpackage 'unstable' 'bad-conflict-level2' 'all' '1' 'Depends: bad-conflict-level1' +insertpackage 'unstable' 'bad-conflict-level2' 'all' '1' 'Depends: bad-conflict-level1, unneeded2' insertinstalledpackage 'upgrade' 'all' '1' insertinstalledpackage 'bad-upgrade' 'all' '1' @@ -41,16 +42,24 @@ insertfoos 'r' 'Recommends' setupaptarchive -testsuccessheadequal() { - msggroup 'testsuccessheadequal' +_testsuccessheadtailequal() { + local TYPE="$1" + shift + msggroup "testsuccess${TYPE}equal" local HEADLINES="$1" local CMP="$2" shift 2 testsuccesswithglobalerror 'testsuccess' 'EW' "$@" - cp "${TMPWORKINGDIRECTORY}/rootdir/tmp/testsuccess.output" "${TMPWORKINGDIRECTORY}/rootdir/tmp/testsuccessheadequal.output" - testsuccessequal "$CMP" head -n "$HEADLINES" "${TMPWORKINGDIRECTORY}/rootdir/tmp/testsuccessheadequal.output" + cp "${TMPWORKINGDIRECTORY}/rootdir/tmp/testsuccess.output" "${TMPWORKINGDIRECTORY}/rootdir/tmp/testsuccess${TYPE}equal.output" + testsuccessequal "$CMP" "${TYPE}" -n "$HEADLINES" "${TMPWORKINGDIRECTORY}/rootdir/tmp/testsuccess${TYPE}equal.output" msggroup } +testsuccessheadequal() { + _testsuccessheadtailequal 'head' "$@" +} +testsuccesstailequal() { + _testsuccessheadtailequal 'tail' "$@" +} checkfoos() { msgmsg 'Install checks with foos dependency type' "$2" for level in 0 1 2; do @@ -61,6 +70,7 @@ The following additional packages will be installed: The following NEW packages will be installed: foo-${1}-level${level} okay 0 upgraded, 2 newly installed, 0 to remove and 3 not upgraded." apt install foo-${1}-level${level} -s + if [ "$level" = '0' ]; then NOT=2; else NOT=1; fi testsuccessheadequal 9 "Reading package lists... Building dependency tree... The following additional packages will be installed: @@ -69,7 +79,7 @@ The following NEW packages will be installed: foo-${1}-upgrade-level${level} The following packages will be upgraded: upgrade -1 upgraded, 1 newly installed, 0 to remove and $((2-${level})) not upgraded." apt install foo-${1}-upgrade-level${level} -s +1 upgraded, 1 newly installed, 0 to remove and $NOT not upgraded." apt install foo-${1}-upgrade-level${level} -s done testsuccessheadequal 7 "Reading package lists... @@ -82,3 +92,58 @@ The following NEW packages will be installed: } checkfoos 'd' 'Depends' checkfoos 'r' 'Recommends' + +TEST_WITH_APTITUDE=false +msgtest 'Check if aptitude is available for additional tests' +if dpkg-checkbuilddeps -d 'aptitude' /dev/null >/dev/null 2>&1; then + TEST_WITH_APTITUDE=true + # we don't document aptitude config options + sed -i -e '/^#x-apt-configure-index/ d' "$(getaptconfig)" + msgpass +else + msgskip 'not installed' +fi + +if $TEST_WITH_APTITUDE; then + OKAYAPTITUDE='0 packages upgraded, 2 newly installed, 0 to remove and 3 not upgraded. +Need to get 0 B of archives. After unpacking 86.0 kB will be used. +Would download/install/remove packages.' + testsuccesstailequal 3 "$OKAYAPTITUDE" aptitude install foo-d-level2 -sy + testsuccesstailequal 3 "$OKAYAPTITUDE" aptitude install foo-r-level2 -sy + testsuccesstailequal 3 "$OKAYAPTITUDE" aptitude install foo-d-conflict -sy + testsuccesstailequal 3 "$OKAYAPTITUDE" aptitude install foo-r-conflict -sy +fi + +BADSOLVETEXT='Reading package lists... +Building dependency tree... +Some packages could not be installed. This may mean that you have +requested an impossible situation or if you are using the unstable +distribution that some required packages have not yet been created +or been moved out of Incoming. +The following information may help to resolve the situation: +' + +testfailureequal "$BADSOLVETEXT +The following packages have unmet dependencies: + bad-level0 : Depends: unknown but it is not installable + bad-upgrade-level0 : Depends: unknown but it is not installable +E: Unable to correct problems, you have held broken packages." apt install bad-upgrade-level1 -s +testfailureequal "$BADSOLVETEXT +The following packages have unmet dependencies: + bad-conflict-level0 : Conflicts: bad-conflict-level2 but 1 is to be installed + bad-level0 : Depends: unknown but it is not installable +E: Unable to correct problems, you have held broken packages." apt install bad-conflict-level2 -s + +if $TEST_WITH_APTITUDE; then + testsuccesstailequal 6 'The following packages have been kept back: + bad-upgrade-level1 +No packages will be installed, upgraded, or removed. +0 packages upgraded, 0 newly installed, 0 to remove and 3 not upgraded. +Need to get 0 B of archives. After unpacking 0 B will be used. +Would download/install/remove packages.' aptitude install bad-upgrade-level1 -sy + # aptitude does not show the kept back message in this case… + testsuccesstailequal 4 'No packages will be installed, upgraded, or removed. +0 packages upgraded, 0 newly installed, 0 to remove and 3 not upgraded. +Need to get 0 B of archives. After unpacking 0 B will be used. +Would download/install/remove packages.' aptitude install bad-conflict-level2 -sy +fi diff --git a/test/integration/test-external-dependency-solver-protocol b/test/integration/test-external-dependency-solver-protocol index 2c451d5f9..0091263b7 100755 --- a/test/integration/test-external-dependency-solver-protocol +++ b/test/integration/test-external-dependency-solver-protocol @@ -292,3 +292,28 @@ echo 'Error: instant-exit Message: This solver exits instantly' exit 1" 'E: External solver failed with: This solver exits instantly E: Sub-process exit1withmsg returned an error code (1)' + +configarchitecture 'amd64' 'i386' +for arch in 'amd64' 'i386' 'armel' 'armhf'; do + insertinstalledpackage "dummy-httpd-$arch" "$arch" '1' 'Provides: httpd' +done +buildsimplenativepackage 'dummy-webserver' 'all' '1' 'unstable' 'Provides: httpd +Multi-Arch: foreign' +testfailure apt install -s dummy-webserver +testsuccess apt install -s ./incoming/dummy-webserver_1_all.deb +testsuccess apt install -s ./incoming/dummy-webserver_1_all.deb --solver apt +testfailure apt install -s ./incoming/dummy-webserver_1_all.deb --solver dump + +testsuccess aptcache showpkg dummy-webserver --with-source ./incoming/dummy-webserver_1_all.deb +cp -a rootdir/tmp/testsuccess.output showpkg.output +testequal 'Reverse Depends: +Dependencies: +1 - +Provides: +1 - ./incoming/dummy-webserver_1_all.deb (= 1) httpd:armhf (= ) httpd:armel (= ) httpd:i386 (= ) httpd (= ) +Reverse Provides: ' tail -n 6 showpkg.output +testsuccessequal 'Provides: httpd +Provides: httpd +Provides: httpd +Provides: httpd +Provides: httpd' grep 'Provides:' "$APT_EDSP_DUMP_FILENAME" diff --git a/test/integration/test-github-111-invalid-armember b/test/integration/test-github-111-invalid-armember new file mode 100755 index 000000000..1e095eef3 --- /dev/null +++ b/test/integration/test-github-111-invalid-armember @@ -0,0 +1,88 @@ +#!/bin/sh +set -e + +TESTDIR="$(readlink -f "$(dirname "$0")")" +. "$TESTDIR/framework" +setupenvironment +configarchitecture "amd64" +setupaptarchive + +# this used to crash, but it should treat it as an invalid member header +touch ' ' +ar -q test.deb ' ' +testsuccessequal "E: Invalid archive member header" ${APTTESTHELPERSBINDIR}/testdeb test.deb + + +rm test.deb +touch 'x' +ar -q test.deb 'x' +testsuccessequal "E: This is not a valid DEB archive, missing 'debian-binary' member" ${APTTESTHELPERSBINDIR}/testdeb test.deb + + +# <name><size> [ other fields] - name is not nul terminated here, it ends in . +msgmsg "Unterminated ar member name" +printf '!<arch>\0120123456789ABCDE.A123456789A.01234.01234.0123456.012345678.0.' > test.deb +testsuccessequal "E: Invalid archive member header" ${APTTESTHELPERSBINDIR}/testdeb test.deb + + +# unused source code for generating $tar below +maketar() { + cat > maketar.c << EOF + #include <stdio.h> + #include <string.h> + struct tar { + char Name[100]; + char Mode[8]; + char UserID[8]; + char GroupID[8]; + char Size[12]; + char MTime[12]; + char Checksum[8]; + char LinkFlag; + char LinkName[100]; + char MagicNumber[8]; + char UserName[32]; + char GroupName[32]; + char Major[8]; + char Minor[8]; + }; + + int main(void) + { + union { + struct tar t; + char buf[512]; + } t; + for (int i = 0; i < sizeof(t.buf); i++) + t.buf[i] = '7'; + memcpy(t.t.Name, "unterminatedName", 16); + memcpy(t.t.UserName, "userName", 8); + memcpy(t.t.GroupName, "thisIsAGroupNamethisIsAGroupName", 32); + t.t.LinkFlag = 'X'; // I AM BROKEN + memcpy(t.t.Size, "000000000000", sizeof(t.t.Size)); + memset(t.t.Checksum,' ',sizeof(t.t.Checksum)); + + unsigned long sum = 0; + for (int i = 0; i < sizeof(t.buf); i++) + sum += t.buf[i]; + + int written = sprintf(t.t.Checksum, "%lo", sum); + for (int i = written; i < sizeof(t.t.Checksum); i++) + t.t.Checksum[i] = ' '; + fwrite(t.buf, sizeof(t.buf), 1, stdout); + } +EOF + + gcc maketar.c -o maketar -Wall + ./maketar +} + + +# +tar="unterminatedName77777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777700000000000077777777777773544 X777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777userName777777777777777777777777thisIsAGroupNamethisIsAGroupName777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777" +printf '%s' "$tar" | gzip > control.tar.gz +cp control.tar.gz data.tar.gz +touch debian-binary +rm test.deb +ar -q test.deb debian-binary control.tar.gz data.tar.gz +testsuccessequal "W: Unknown TAR header type 88" ${APTTESTHELPERSBINDIR}/testdeb test.deb diff --git a/test/integration/test-multiarch-allowed b/test/integration/test-multiarch-allowed index b74853993..a091635f0 100755 --- a/test/integration/test-multiarch-allowed +++ b/test/integration/test-multiarch-allowed @@ -66,13 +66,12 @@ testfailureequal "$BADPREFIX The following packages have unmet dependencies: foo : Conflicts: foo:i386 but 1 is to be installed foo:i386 : Conflicts: foo but 1 is to be installed -E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages." aptget install needsfoo:i386 foo:amd64 -s +E: Unable to correct problems, you have held broken packages." aptget install needsfoo:i386 foo:amd64 -s testfailureequal "$BADPREFIX The following packages have unmet dependencies: foo : Conflicts: foo:i386 but 1 is to be installed foo:i386 : Conflicts: foo but 1 is to be installed -E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages." aptget install needsfoo foo:i386 -s -exit +E: Unable to correct problems, you have held broken packages." aptget install needsfoo foo:i386 -s solveableinsinglearch1() { testsuccessequal "Reading package lists... diff --git a/test/integration/test-no-fds-leaked-to-maintainer-scripts b/test/integration/test-no-fds-leaked-to-maintainer-scripts index 85b3d0ee1..4606408fc 100755 --- a/test/integration/test-no-fds-leaked-to-maintainer-scripts +++ b/test/integration/test-no-fds-leaked-to-maintainer-scripts @@ -40,7 +40,7 @@ testsuccess aptget install -y fdleaks -qq < /dev/null checkfdleak() { msgtest 'Check if fds were not' "leaked: expect $1" - if [ "$(grep 'root root' rootdir/tmp/testsuccess.output | wc -l)" = "$1" ]; then + if [ "$(grep -e 'root root' -e "$(id -un) $(id -gn)" rootdir/tmp/testsuccess.output | wc -l)" = "$1" ]; then msgpass else echo diff --git a/test/integration/test-resolver-delays-remove-decisions b/test/integration/test-resolver-delays-remove-decisions new file mode 100755 index 000000000..d8dfd7c9a --- /dev/null +++ b/test/integration/test-resolver-delays-remove-decisions @@ -0,0 +1,107 @@ +#!/bin/sh +set -e + +TESTDIR="$(readlink -f "$(dirname "$0")")" +. "$TESTDIR/framework" +setupenvironment +configarchitecture 'amd64' 'i386' + +insertinstalledpackage 'stuff' 'all' '1' + +insertpackage 'unstable' 'foobar' 'all' '1' 'Depends: foo | bar' +insertpackage 'unstable' 'foo' 'all' '1' 'Conflicts: stuff +Depends: foo-dep' +insertpackage 'unstable' 'foo-dep' 'all' '1' 'Depends: uninstallable' + +insertpackage 'unstable' 'bar' 'all' '1' + +setupaptarchive + +# We are needlessly removing "stuff" if we don't delay its marking here +# as we do not question the remove later on +testsuccessequal "Reading package lists... +Building dependency tree... + MarkInstall foobar:amd64 < none -> 1 @un puN Ib > FU=1 + Installing foo:amd64 as Depends of foobar:amd64 + Delayed Removing: stuff:amd64 as upgrade is not an option for foo:amd64 (1) + MarkInstall foo:amd64 < none -> 1 @un uN Ib > FU=0 + Installing foo-dep:amd64 as Depends of foo:amd64 + foo-dep:amd64 Depends on uninstallable:amd64 < none @un H > can't be satisfied! + foo:amd64 Depends on foo-dep:amd64 < none @un H > can't be satisfied! (dep) + Installing bar:amd64 as Depends of foobar:amd64 + MarkInstall bar:amd64 < none -> 1 @un uN > FU=0 +Starting pkgProblemResolver with broken count: 0 +Starting 2 pkgProblemResolver with broken count: 0 +Done +The following additional packages will be installed: + bar +The following NEW packages will be installed: + bar foobar +0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. +Inst bar (1 unstable [all]) +Inst foobar (1 unstable [all]) +Conf bar (1 unstable [all]) +Conf foobar (1 unstable [all])" apt install foobar -s -o Debug::pkgProblemResolver=1 -o Debug::pkgDepCache::Marker=1 -o Debug::pkgDepCache::AutoInstall=1 + +insertinstalledpackage 'uninstallable' 'all' '1' + +testsuccessequal "Reading package lists... +Building dependency tree... + MarkInstall foobar:amd64 < none -> 1 @un puN Ib > FU=1 + Installing foo:amd64 as Depends of foobar:amd64 + Delayed Removing: stuff:amd64 as upgrade is not an option for foo:amd64 (1) + MarkInstall foo:amd64 < none -> 1 @un uN Ib > FU=0 + Installing foo-dep:amd64 as Depends of foo:amd64 + MarkInstall foo-dep:amd64 < none -> 1 @un uN > FU=0 + MarkDelete stuff:amd64 < 1 @ii mK > FU=0 +Starting pkgProblemResolver with broken count: 0 +Starting 2 pkgProblemResolver with broken count: 0 +Done +The following additional packages will be installed: + foo foo-dep +The following packages will be REMOVED: + stuff +The following NEW packages will be installed: + foo foo-dep foobar + MarkDelete stuff:amd64 < 1 @ii K > FU=1 +0 upgraded, 3 newly installed, 1 to remove and 0 not upgraded. +Remv stuff [1] +Inst foo-dep (1 unstable [all]) +Inst foo (1 unstable [all]) +Inst foobar (1 unstable [all]) +Conf foo-dep (1 unstable [all]) +Conf foo (1 unstable [all]) +Conf foobar (1 unstable [all])" apt install foobar -s -o Debug::pkgProblemResolver=1 -o Debug::pkgDepCache::Marker=1 -o Debug::pkgDepCache::AutoInstall=1 + +# Same solution but the installs are considered protected now as there is no other solution +testsuccessequal "Reading package lists... +Building dependency tree... + MarkInstall foobar:amd64 < none -> 1 @un puN Ib > FU=1 + Installing foo:amd64 as Depends of foobar:amd64 + Removing: stuff:amd64 as upgrade is not an option for foo:amd64 (1) + MarkDelete stuff:amd64 < 1 @ii mK > FU=0 + MarkInstall foo:amd64 < none -> 1 @un puN Ib > FU=0 + Installing foo-dep:amd64 as Depends of foo:amd64 + MarkInstall foo-dep:amd64 < none -> 1 @un puN > FU=0 + MarkInstall uninstallable:amd64 < 1 @ii pmK > FU=0 +Starting pkgProblemResolver with broken count: 0 +Starting 2 pkgProblemResolver with broken count: 0 +Done + Ignore MarkGarbage of foo:amd64 < none -> 1 @un puN > as its mode (Install) is protected + Ignore MarkGarbage of foo:amd64 < none -> 1 @un puN > as its mode (Install) is protected +Package 'bar' is not installed, so not removed +The following additional packages will be installed: + foo foo-dep +The following packages will be REMOVED: + stuff +The following NEW packages will be installed: + foo foo-dep foobar + MarkDelete stuff:amd64 < 1 | none @ii H > FU=1 +0 upgraded, 3 newly installed, 1 to remove and 0 not upgraded. +Remv stuff [1] +Inst foo-dep (1 unstable [all]) +Inst foo (1 unstable [all]) +Inst foobar (1 unstable [all]) +Conf foo-dep (1 unstable [all]) +Conf foo (1 unstable [all]) +Conf foobar (1 unstable [all])" apt install foobar bar- -q=0 -s -o Debug::pkgProblemResolver=1 -o Debug::pkgDepCache::Marker=1 -o Debug::pkgDepCache::AutoInstall=1 diff --git a/test/integration/test-resolver-provider-exchange b/test/integration/test-resolver-provider-exchange new file mode 100755 index 000000000..3f5310fa6 --- /dev/null +++ b/test/integration/test-resolver-provider-exchange @@ -0,0 +1,107 @@ +#!/bin/sh +set -e + +TESTDIR="$(readlink -f "$(dirname "$0")")" +. "$TESTDIR/framework" +setupenvironment +configarchitecture 'amd64' + +insertinstalledpackage 'fuse' 'all' '2' +insertpackage 'unstable' 'fuse3' 'all' '3' 'Conflicts: fuse +Provides: fuse' + +insertpackage 'unstable' 'foobar-d' 'all' '1' 'Depends: fuse' +insertpackage 'unstable' 'foobar-d2' 'all' '1' 'Depends: fuse +Conflicts: fuse3' +insertpackage 'unstable' 'foobar-d3' 'all' '1' 'Depends: fuse3' +insertpackage 'unstable' 'foobar-r' 'all' '1' 'Recommends: fuse' +insertpackage 'unstable' 'foobar-r2' 'all' '1' 'Recommends: fuse +Conflicts: fuse3' +insertpackage 'unstable' 'foobar-r3' 'all' '1' 'Recommends: fuse3' + +setupaptarchive + +installfoobars() { + testsuccessequal 'Reading package lists... +Building dependency tree... +The following NEW packages will be installed: + foobar-d +0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. +Inst foobar-d (1 unstable [all]) +Conf foobar-d (1 unstable [all])' apt install -s foobar-d + testsuccessequal 'Reading package lists... +Building dependency tree... +The following NEW packages will be installed: + foobar-d2 +0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. +Inst foobar-d2 (1 unstable [all]) +Conf foobar-d2 (1 unstable [all])' apt install -s foobar-d2 + testsuccessequal "Reading package lists... +Building dependency tree... +The following additional packages will be installed: + fuse3 +The following packages will be REMOVED: + fuse +The following NEW packages will be installed: + foobar-d3 fuse3 +0 upgraded, 2 newly installed, 1 to remove and 0 not upgraded. +Remv fuse [2]$1 +Inst fuse3 (3 unstable [all]) +Inst foobar-d3 (1 unstable [all]) +Conf fuse3 (3 unstable [all]) +Conf foobar-d3 (1 unstable [all])" apt install -s foobar-d3 + + testsuccessequal 'Reading package lists... +Building dependency tree... +The following NEW packages will be installed: + foobar-r +0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. +Inst foobar-r (1 unstable [all]) +Conf foobar-r (1 unstable [all])' apt install -s foobar-r + testsuccessequal 'Reading package lists... +Building dependency tree... +The following NEW packages will be installed: + foobar-r2 +0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. +Inst foobar-r2 (1 unstable [all]) +Conf foobar-r2 (1 unstable [all])' apt install -s foobar-r2 + if [ -z "$1" ]; then + testsuccessequal "Reading package lists... +Building dependency tree... +The following additional packages will be installed: + fuse3 +The following packages will be REMOVED: + fuse +The following NEW packages will be installed: + foobar-r3 fuse3 +0 upgraded, 2 newly installed, 1 to remove and 0 not upgraded. +Remv fuse [2]$1 +Inst foobar-r3 (1 unstable [all]) +Inst fuse3 (3 unstable [all]) +Conf foobar-r3 (1 unstable [all]) +Conf fuse3 (3 unstable [all])" apt install -s foobar-r3 + else + testsuccessequal "Reading package lists... +Building dependency tree... +The following additional packages will be installed: + fuse3 +The following packages will be REMOVED: + fuse +The following NEW packages will be installed: + foobar-r3 fuse3 +0 upgraded, 2 newly installed, 1 to remove and 0 not upgraded. +Remv fuse [2]$1 +Inst fuse3 (3 unstable [all]) +Inst foobar-r3 (1 unstable [all]) +Conf fuse3 (3 unstable [all]) +Conf foobar-r3 (1 unstable [all])" apt install -s foobar-r3 + fi +} +msgmsg 'fuse has no installed dependers' +installfoobars + +for i in $(seq 0 10); do + insertinstalledpackage "stuff$i" 'all' '1' 'Depends: fuse' +done +msgmsg 'fuse has many dependers installed' +installfoobars ' [stuff10:amd64 stuff0:amd64 stuff1:amd64 stuff2:amd64 stuff3:amd64 stuff4:amd64 stuff5:amd64 stuff6:amd64 stuff7:amd64 stuff8:amd64 stuff9:amd64 ]' diff --git a/test/libapt/authconf_test.cc b/test/libapt/authconf_test.cc index 04d54e9be..f703351cc 100644 --- a/test/libapt/authconf_test.cc +++ b/test/libapt/authconf_test.cc @@ -20,7 +20,7 @@ TEST(NetRCTest, Parsing) EXPECT_EQ("file.not", U.Host); EXPECT_EQ("/open", U.Path); - createTemporaryFile("doublesignedfile", fd, nullptr, R"apt( + openTemporaryFile("doublesignedfile", fd, R"apt( machine example.netter login bar password foo machine example.net login foo password bar @@ -138,7 +138,7 @@ machine socks5h://example.last/debian login debian password rules)apt"); TEST(NetRCTest, BadFileNoMachine) { FileFd fd; - createTemporaryFile("doublesignedfile", fd, nullptr, R"apt( + openTemporaryFile("doublesignedfile", fd, R"apt( foo example.org login foo1 password bar machin example.org login foo2 password bar machine2 example.org login foo3 password bar @@ -152,7 +152,7 @@ machine2 example.org login foo3 password bar TEST(NetRCTest, BadFileEndsMachine) { FileFd fd; - createTemporaryFile("doublesignedfile", fd, nullptr, R"apt( + openTemporaryFile("doublesignedfile", fd, R"apt( machine example.org login foo1 password bar machine)apt"); @@ -176,7 +176,7 @@ machine)apt"); TEST(NetRCTest, BadFileEndsLogin) { FileFd fd; - createTemporaryFile("doublesignedfile", fd, nullptr, R"apt( + openTemporaryFile("doublesignedfile", fd, R"apt( machine example.org login foo1 password bar machine example.net login)apt"); @@ -200,7 +200,7 @@ machine example.net login)apt"); TEST(NetRCTest, BadFileEndsPassword) { FileFd fd; - createTemporaryFile("doublesignedfile", fd, nullptr, R"apt( + openTemporaryFile("doublesignedfile", fd, R"apt( machine example.org login foo1 password bar machine example.net password)apt"); @@ -225,7 +225,7 @@ machine example.net password)apt"); TEST(NetRCTest, MatchesOnlyHTTPS) { FileFd fd; - createTemporaryFile("doublesignedfile", fd, nullptr, R"apt( + openTemporaryFile("doublesignedfile", fd, R"apt( machine https.example login foo1 password bar machine http://http.example login foo1 password bar )apt"); diff --git a/test/libapt/cdrom_test.cc b/test/libapt/cdrom_test.cc index b21492cb7..e2ec05ab8 100644 --- a/test/libapt/cdrom_test.cc +++ b/test/libapt/cdrom_test.cc @@ -91,16 +91,14 @@ TEST(CDROMTest,ReduceSourcelist) } TEST(CDROMTest, FindMountPointForDevice) { - std::string tempfile; - FileFd fd; - createTemporaryFile("mountpoints", fd, &tempfile, + auto const file = createTemporaryFile("mountpoints", "rootfs / rootfs rw 0 0\n" "sysfs /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0\n" "sysfs0 /sys0 sysfs rw,nosuid,nodev,noexec,relatime 0 0\n" "/dev/disk/by-uuid/fadcbc52-6284-4874-aaaa-dcee1f05fe21 / ext4 rw,relatime,errors=remount-ro,data=ordered 0 0\n" "/dev/sda1 /boot/efi vfat rw,nosuid,nodev,noexec,relatime,fmask=0000,dmask=0000,allow_utime=0022,codepage=437,iocharset=utf8,shortname=lower,quiet,utf8,errors=remount-ro,rw,nosuid,nodev,noexec,relatime,fmask=0000,dmask=0000,allow_utime=0022,codepage=437,iocharset=utf8,shortname=lower,quiet,utf8,errors=remount-ro,rw,nosuid,nodev,noexec,relatime,fmask=0000,dmask=0000,allow_utime=0022,codepage=437,iocharset=utf8,shortname=lower,quiet,utf8,errors=remount-ro,rw,nosuid,nodev,noexec,relatime,fmask=0000,dmask=0000,allow_utime=0022,codepage=437,iocharset=utf8,shortname=lower,quiet,utf8,errors=remount-ro 0 0\n" "tmpfs /tmp tmpfs rw,nosuid,nodev,relatime 0 0\n"); - _config->Set("Dir::state::Mountpoints", tempfile); + _config->Set("Dir::state::Mountpoints", file.Name()); EXPECT_EQ("/", FindMountPointForDevice("rootfs")); EXPECT_EQ("/", FindMountPointForDevice("/dev/disk/by-uuid/fadcbc52-6284-4874-aaaa-dcee1f05fe21")); @@ -108,7 +106,4 @@ TEST(CDROMTest, FindMountPointForDevice) EXPECT_EQ("/sys0", FindMountPointForDevice("sysfs0")); EXPECT_EQ("/boot/efi", FindMountPointForDevice("/dev/sda1")); EXPECT_EQ("/tmp", FindMountPointForDevice("tmpfs")); - - if (tempfile.empty() == false) - unlink(tempfile.c_str()); } diff --git a/test/libapt/configuration_test.cc b/test/libapt/configuration_test.cc index 8d6c404b3..4d297a9f2 100644 --- a/test/libapt/configuration_test.cc +++ b/test/libapt/configuration_test.cc @@ -198,9 +198,8 @@ TEST(ConfigurationTest,Merge) TEST(ConfigurationTest, Parsing) { Configuration Cnf; - std::string tempfile; - FileFd fd; - createTemporaryFile("doublesignedfile", fd, &tempfile, R"apt( + { + auto const file = createTemporaryFile("doublesignedfile", R"apt( SimpleOption "true"; /* SimpleOption "false"; */ Answer::Simple "42"; @@ -213,9 +212,8 @@ List::Option2 { "Multi"; }; Trailing "true"; /* Commented::Out "true"; */ )apt"); - EXPECT_TRUE(ReadConfigFile(Cnf, tempfile)); - if (tempfile.empty() == false) - unlink(tempfile.c_str()); + EXPECT_TRUE(ReadConfigFile(Cnf, file.Name())); + } EXPECT_TRUE(Cnf.FindB("SimpleOption")); EXPECT_EQ(42, Cnf.FindI("Answer::Simple")); EXPECT_TRUE(Cnf.Exists("List::Option")); diff --git a/test/libapt/extracttar_test.cc b/test/libapt/extracttar_test.cc index 67e0461c2..ae74341e6 100644 --- a/test/libapt/extracttar_test.cc +++ b/test/libapt/extracttar_test.cc @@ -12,24 +12,32 @@ class Stream : public pkgDirStream public: int count; Stream () { count = 0; } - virtual bool DoItem(Item &Itm,int &Fd) { (void)Itm; (void)Fd; count++; return true; } - virtual bool Fail(Item &Itm,int Fd) { (void)Itm; (void)Fd; return true; } - virtual bool FinishedFile(Item &Itm,int Fd) { (void)Itm; (void)Fd; return true; } - virtual bool Process(Item &Itm,const unsigned char * Data, unsigned long Size,unsigned long Pos) { (void)Itm; (void) Data; (void) Size; (void) Pos; return true; } - virtual ~Stream() {} + bool DoItem(Item &Itm,int &Fd) APT_OVERRIDE { (void)Itm; (void)Fd; count++; return true; } + bool Fail(Item &Itm,int Fd) APT_OVERRIDE { (void)Itm; (void)Fd; return true; } + bool FinishedFile(Item &Itm,int Fd) APT_OVERRIDE { (void)Itm; (void)Fd; return true; } + ~Stream() {} }; TEST(ExtractTar, ExtractTar) { - EXPECT_EQ(system("tar c /etc/passwd 2>/dev/null | gzip > tar.tgz"), 0); + FileFd tgz; + ASSERT_NE(nullptr, GetTempFile("extracttar", false, &tgz)); + ASSERT_TRUE(tgz.Close()); + ASSERT_FALSE(tgz.Name().empty()); + // FIXME: We should do the right thing… but its a test and nobody will ever… + // Proposal: The first one who sees this assert fail will have to write a patch. + ASSERT_EQ(std::string::npos, tgz.Name().find('\'')); + EXPECT_EQ(0, system(("tar c /etc/passwd 2>/dev/null | gzip > " + tgz.Name()).c_str())); - FileFd fd("tar.tgz", FileFd::ReadOnly); - unlink("tar.tgz"); + FileFd fd(tgz.Name(), FileFd::ReadOnly); + RemoveFile("ExtractTarTest", tgz.Name()); + ASSERT_TRUE(fd.IsOpen()); ExtractTar tar(fd, -1, "gzip"); // Run multiple times, because we want to check not only that extraction // works, but also that it works multiple times (important for python-apt) for (int i = 0; i < 5; i++) { + SCOPED_TRACE(i); Stream stream; fd.Seek(0); tar.Go(stream); diff --git a/test/libapt/file-helpers.cc b/test/libapt/file-helpers.cc index aa16a2e30..85fc6838e 100644 --- a/test/libapt/file-helpers.cc +++ b/test/libapt/file-helpers.cc @@ -53,31 +53,31 @@ void helperCreateLink(std::string const &dir, std::string const &targetname, std link.append(linkname); ASSERT_EQ(0, symlink(target.c_str(), link.c_str())); } -void helperCreateTemporaryFile(std::string const &id, FileFd &fd, std::string * const filename, char const * const content) -{ - std::string name("apt-test-"); - name.append(id); - size_t const giventmp = name.find(".XXXXXX."); - if (giventmp == std::string::npos) - name.append(".XXXXXX"); - char * tempfile = strdup(name.c_str()); - ASSERT_STRNE(NULL, tempfile); - int tempfile_fd; - if (giventmp == std::string::npos) - tempfile_fd = mkstemp(tempfile); - else - tempfile_fd = mkstemps(tempfile, name.length() - (giventmp + 7)); - ASSERT_NE(-1, tempfile_fd); - if (filename != NULL) - *filename = tempfile; - else - unlink(tempfile); - free(tempfile); - EXPECT_TRUE(fd.OpenDescriptor(tempfile_fd, FileFd::ReadWrite, true)); - if (content != NULL) +void openTemporaryFile(std::string const &id, FileFd &fd, char const * const content, bool const ImmediateUnlink) +{ + EXPECT_NE(nullptr, GetTempFile("apt-" + id, ImmediateUnlink, &fd)); + EXPECT_TRUE(ImmediateUnlink || not fd.Name().empty()); + if (content != nullptr) { - ASSERT_TRUE(fd.Write(content, strlen(content))); + EXPECT_TRUE(fd.Write(content, strlen(content))); + EXPECT_TRUE(fd.Sync()); fd.Seek(0); } } +ScopedFileDeleter::ScopedFileDeleter(std::string const &filename) : _filename{filename} {} +ScopedFileDeleter::ScopedFileDeleter(ScopedFileDeleter &&sfd) = default; +ScopedFileDeleter& ScopedFileDeleter::operator=(ScopedFileDeleter &&sfd) = default; +ScopedFileDeleter::~ScopedFileDeleter() { + if (not _filename.empty()) + RemoveFile("ScopedFileDeleter", _filename.c_str()); +} +[[nodiscard]] ScopedFileDeleter createTemporaryFile(std::string const &id, char const * const content) +{ + FileFd fd; + openTemporaryFile(id, fd, content, false); + EXPECT_TRUE(fd.IsOpen()); + EXPECT_TRUE(fd.Close()); + EXPECT_FALSE(fd.Name().empty()); + return ScopedFileDeleter{fd.Name()}; +} diff --git a/test/libapt/file-helpers.h b/test/libapt/file-helpers.h index f639c1cbc..4ce0fb2a3 100644 --- a/test/libapt/file-helpers.h +++ b/test/libapt/file-helpers.h @@ -22,8 +22,20 @@ void helperCreateDirectory(std::string const &dir, std::string const &name); #define createLink(dir, targetname, linkname) \ ASSERT_NO_FATAL_FAILURE(helperCreateLink(dir, targetname, linkname)) void helperCreateLink(std::string const &dir, std::string const &targetname, std::string const &linkname); -#define createTemporaryFile(id, fd, filename, content) \ - ASSERT_NO_FATAL_FAILURE(helperCreateTemporaryFile(id, fd, filename, content)) -void helperCreateTemporaryFile(std::string const &id, FileFd &fd, std::string * const filename, char const * const content); + +class ScopedFileDeleter { + std::string _filename; +public: + ScopedFileDeleter(std::string const &filename); + ScopedFileDeleter(ScopedFileDeleter const &) = delete; + ScopedFileDeleter(ScopedFileDeleter &&); + ScopedFileDeleter& operator=(ScopedFileDeleter const &) = delete; + ScopedFileDeleter& operator=(ScopedFileDeleter &&); + ~ScopedFileDeleter(); + + std::string Name() const { return _filename; } +}; +void openTemporaryFile(std::string const &id, FileFd &fd, char const * const content = nullptr, bool const ImmediateUnlink = true); +ScopedFileDeleter createTemporaryFile(std::string const &id, char const * const content = nullptr); #endif diff --git a/test/libapt/fileutl_test.cc b/test/libapt/fileutl_test.cc index 788ab76b2..ecab2eb50 100644 --- a/test/libapt/fileutl_test.cc +++ b/test/libapt/fileutl_test.cc @@ -23,15 +23,12 @@ static void TestFileFd(mode_t const a_umask, mode_t const ExpectedFilePermission strprintf(trace, "TestFileFd: Compressor: %s umask: %#o permission: %#o mode: %d", compressor.Name.c_str(), a_umask, ExpectedFilePermission, filemode); SCOPED_TRACE(trace); - static const char* fname = "apt-filefd-test.txt"; - if (FileExists(fname) == true) - { - EXPECT_EQ(0, unlink(fname)); - } + auto const file = createTemporaryFile("filefd-test"); + EXPECT_TRUE(RemoveFile("TestFileFd", file.Name())); FileFd f; umask(a_umask); - EXPECT_TRUE(f.Open(fname, filemode, compressor)); + EXPECT_TRUE(f.Open(file.Name(), filemode, compressor)); EXPECT_TRUE(f.IsOpen()); EXPECT_FALSE(f.Failed()); EXPECT_EQ(umask(a_umask), a_umask); @@ -45,7 +42,7 @@ static void TestFileFd(mode_t const a_umask, mode_t const ExpectedFilePermission EXPECT_FALSE(f.IsOpen()); EXPECT_FALSE(f.Failed()); - EXPECT_TRUE(f.Open(fname, FileFd::ReadOnly, compressor)); + EXPECT_TRUE(f.Open(file.Name(), FileFd::ReadOnly, compressor)); EXPECT_TRUE(f.IsOpen()); EXPECT_FALSE(f.Failed()); EXPECT_FALSE(f.Eof()); @@ -172,8 +169,7 @@ static void TestFileFd(mode_t const a_umask, mode_t const ExpectedFilePermission // regression test for permission bug LP: #1304657 struct stat buf; - EXPECT_EQ(0, stat(fname, &buf)); - EXPECT_EQ(0, unlink(fname)); + EXPECT_EQ(0, stat(file.Name().c_str(), &buf)); EXPECT_EQ(ExpectedFilePermission, buf.st_mode & 0777); } @@ -385,24 +381,19 @@ static void TestFailingAtomicKeepsFile(char const * const label, std::string con } TEST(FileUtlTest, FailingAtomic) { - FileFd fd; - std::string filename; - createTemporaryFile("failingatomic", fd, &filename, TESTSTRING); - TestFailingAtomicKeepsFile("init", filename); + auto const file = createTemporaryFile("failingatomic", TESTSTRING); + TestFailingAtomicKeepsFile("init", file.Name()); FileFd f; - EXPECT_TRUE(f.Open(filename, FileFd::ReadWrite | FileFd::Atomic)); + EXPECT_TRUE(f.Open(file.Name(), FileFd::ReadWrite | FileFd::Atomic)); f.EraseOnFailure(); EXPECT_FALSE(f.Failed()); EXPECT_TRUE(f.IsOpen()); - TestFailingAtomicKeepsFile("before-fail", filename); + TestFailingAtomicKeepsFile("before-fail", file.Name()); EXPECT_TRUE(f.Write("Bad file write", 10)); f.OpFail(); EXPECT_TRUE(f.Failed()); - TestFailingAtomicKeepsFile("after-fail", filename); + TestFailingAtomicKeepsFile("after-fail", file.Name()); EXPECT_TRUE(f.Close()); - TestFailingAtomicKeepsFile("closed", filename); - - if (filename.empty() == false) - unlink(filename.c_str()); + TestFailingAtomicKeepsFile("closed", file.Name()); } diff --git a/test/libapt/hashsums_test.cc b/test/libapt/hashsums_test.cc index a8a826821..2d8079e5a 100644 --- a/test/libapt/hashsums_test.cc +++ b/test/libapt/hashsums_test.cc @@ -29,15 +29,10 @@ static void getSummationString(char const * const type, std::string &sum) summation is a compressor – and open the 'compressed' file later on directly to read out the summation sum calculated by it */ APT::Configuration::Compressor compress(type, ".ext", type, NULL, NULL, 99); - std::string name("apt-test-"); - name.append("hashsums").append(".XXXXXX"); - char * tempfile = strdup(name.c_str()); - int tempfile_fd = mkstemp(tempfile); - close(tempfile_fd); - ASSERT_NE(-1, tempfile_fd); FileFd fd; - ASSERT_TRUE(fd.Open(tempfile, FileFd::WriteOnly | FileFd::Empty, compress)); + auto const file = createTemporaryFile("hashsums"); + ASSERT_TRUE(fd.Open(file.Name(), FileFd::WriteOnly | FileFd::Empty, compress)); ASSERT_TRUE(fd.IsOpen()); FileFd input("/etc/os-release", FileFd::ReadOnly); ASSERT_TRUE(input.IsOpen()); @@ -48,12 +43,10 @@ static void getSummationString(char const * const type, std::string &sum) ASSERT_FALSE(fd.Failed()); input.Close(); fd.Close(); - ASSERT_TRUE(fd.Open(tempfile, FileFd::ReadOnly, FileFd::None)); + ASSERT_TRUE(fd.Open(file.Name(), FileFd::ReadOnly, FileFd::None)); ASSERT_TRUE(fd.IsOpen()); ASSERT_NE(0u, fd.FileSize()); ASSERT_FALSE(fd.Failed()); - unlink(tempfile); - free(tempfile); char readback[2000]; unsigned long long actual; ASSERT_TRUE(fd.Read(readback, sizeof(readback)/sizeof(readback[0]), &actual)); diff --git a/test/libapt/openmaybeclearsignedfile_test.cc b/test/libapt/openmaybeclearsignedfile_test.cc index 0a4d4438a..4db89679a 100644 --- a/test/libapt/openmaybeclearsignedfile_test.cc +++ b/test/libapt/openmaybeclearsignedfile_test.cc @@ -13,12 +13,21 @@ /* The test files are created with the 'Joe Sixpack' and 'Marvin Paranoid' test key included in the integration testing framework */ -TEST(OpenMaybeClearSignedFileTest,SimpleSignedFile) +static void EXPECT_SUCCESSFUL_PARSE(std::string const &tempfile) { - std::string tempfile; FileFd fd; + EXPECT_TRUE(OpenMaybeClearSignedFile(tempfile, fd)); + EXPECT_TRUE(fd.IsOpen()); + char buffer[100]; + EXPECT_TRUE(fd.ReadLine(buffer, sizeof(buffer))); + EXPECT_STREQ(buffer, "Test"); + EXPECT_TRUE(fd.Eof()); +} + +TEST(OpenMaybeClearSignedFileTest,SimpleSignedFile) +{ // Using c++11 raw-strings would be nifty, but travis doesn't support it… - createTemporaryFile("simplesignedfile", fd, &tempfile, "-----BEGIN PGP SIGNED MESSAGE-----\n" + auto const file = createTemporaryFile("simplesignedfile", "-----BEGIN PGP SIGNED MESSAGE-----\n" "Hash: SHA512\n" "\n" "Test\n" @@ -33,23 +42,14 @@ TEST(OpenMaybeClearSignedFileTest,SimpleSignedFile) "JQt/+gJCPxHUJphy8sccBKhW29CLELJIIafvU30E1nWn9szh2Xjq\n" "=TB1F\n" "-----END PGP SIGNATURE-----\n"); - EXPECT_TRUE(StartsWithGPGClearTextSignature(tempfile)); - EXPECT_TRUE(OpenMaybeClearSignedFile(tempfile, fd)); - if (tempfile.empty() == false) - unlink(tempfile.c_str()); - EXPECT_TRUE(fd.IsOpen()); - char buffer[100]; - EXPECT_TRUE(fd.ReadLine(buffer, sizeof(buffer))); - EXPECT_STREQ(buffer, "Test"); - EXPECT_TRUE(fd.Eof()); + EXPECT_TRUE(StartsWithGPGClearTextSignature(file.Name())); + EXPECT_SUCCESSFUL_PARSE(file.Name()); } TEST(OpenMaybeClearSignedFileTest,WhitespaceSignedFile) { - std::string tempfile; - FileFd fd; // no raw-string here to protect the whitespace from cleanup - createTemporaryFile("simplesignedfile", fd, &tempfile, "-----BEGIN PGP SIGNED MESSAGE----- \t \n" + auto const file = createTemporaryFile("simplesignedfile", "-----BEGIN PGP SIGNED MESSAGE----- \t \n" "Hash: SHA512 \n" " \n" "Test \n" @@ -64,22 +64,13 @@ TEST(OpenMaybeClearSignedFileTest,WhitespaceSignedFile) "JQt/+gJCPxHUJphy8sccBKhW29CLELJIIafvU30E1nWn9szh2Xjq \n" "=TB1F \n" "-----END PGP SIGNATURE-----"); - EXPECT_TRUE(StartsWithGPGClearTextSignature(tempfile)); - EXPECT_TRUE(OpenMaybeClearSignedFile(tempfile, fd)); - if (tempfile.empty() == false) - unlink(tempfile.c_str()); - EXPECT_TRUE(fd.IsOpen()); - char buffer[100]; - EXPECT_TRUE(fd.ReadLine(buffer, sizeof(buffer))); - EXPECT_STREQ(buffer, "Test"); - EXPECT_TRUE(fd.Eof()); + EXPECT_TRUE(StartsWithGPGClearTextSignature(file.Name())); + EXPECT_SUCCESSFUL_PARSE(file.Name()); } TEST(OpenMaybeClearSignedFileTest,SignedFileWithContentHeaders) { - std::string tempfile; - FileFd fd; - createTemporaryFile("headerssignedfile", fd, &tempfile, "-----BEGIN PGP SIGNED MESSAGE-----\n" + auto const file = createTemporaryFile("headerssignedfile", "-----BEGIN PGP SIGNED MESSAGE-----\n" "Version: 0.8.15~exp1\n" "Hash: SHA512\n" "Comment: I love you!\n" @@ -100,22 +91,13 @@ TEST(OpenMaybeClearSignedFileTest,SignedFileWithContentHeaders) "JQt/+gJCPxHUJphy8sccBKhW29CLELJIIafvU30E1nWn9szh2Xjq\n" "=TB1F\n" "-----END PGP SIGNATURE-----\n"); - EXPECT_TRUE(StartsWithGPGClearTextSignature(tempfile)); - EXPECT_TRUE(OpenMaybeClearSignedFile(tempfile, fd)); - if (tempfile.empty() == false) - unlink(tempfile.c_str()); - EXPECT_TRUE(fd.IsOpen()); - char buffer[100]; - EXPECT_TRUE(fd.ReadLine(buffer, sizeof(buffer))); - EXPECT_STREQ(buffer, "Test"); - EXPECT_TRUE(fd.Eof()); + EXPECT_TRUE(StartsWithGPGClearTextSignature(file.Name())); + EXPECT_SUCCESSFUL_PARSE(file.Name()); } TEST(OpenMaybeClearSignedFileTest,SignedFileWithTwoSignatures) { - std::string tempfile; - FileFd fd; - createTemporaryFile("doublesignedfile", fd, &tempfile, "-----BEGIN PGP SIGNED MESSAGE-----\n" + auto const file = createTemporaryFile("doublesignedfile", "-----BEGIN PGP SIGNED MESSAGE-----\n" "Hash: SHA512\n" "\n" "Test\n" @@ -141,23 +123,29 @@ TEST(OpenMaybeClearSignedFileTest,SignedFileWithTwoSignatures) "ASc9hsAZRG0xHuRU0F94V/XrkWw8QYAobJ/yxvs4L0EuA4optbSqawDB\n" "=CP8j\n" "-----END PGP SIGNATURE-----\n"); - EXPECT_TRUE(StartsWithGPGClearTextSignature(tempfile)); - EXPECT_TRUE(OpenMaybeClearSignedFile(tempfile, fd)); - if (tempfile.empty() == false) - unlink(tempfile.c_str()); - EXPECT_TRUE(fd.IsOpen()); - char buffer[100]; - EXPECT_TRUE(fd.ReadLine(buffer, sizeof(buffer))); - EXPECT_STREQ(buffer, "Test"); - EXPECT_TRUE(fd.Eof()); + EXPECT_TRUE(StartsWithGPGClearTextSignature(file.Name())); + EXPECT_SUCCESSFUL_PARSE(file.Name()); } -TEST(OpenMaybeClearSignedFileTest,TwoSimpleSignedFile) + +static void EXPECT_FAILED_PARSE(std::string const &tempfile, std::string const &error) { - std::string tempfile; + EXPECT_TRUE(_error->empty()); FileFd fd; + EXPECT_FALSE(OpenMaybeClearSignedFile(tempfile, fd)); + EXPECT_FALSE(_error->empty()); + EXPECT_FALSE(fd.IsOpen()); + ASSERT_TRUE(_error->PendingError()); + + std::string msg; + EXPECT_TRUE(_error->PopMessage(msg)); + EXPECT_EQ(msg, error); +} + +TEST(OpenMaybeClearSignedFileTest,TwoSimpleSignedFile) +{ // read only the first message - createTemporaryFile("twosimplesignedfile", fd, &tempfile, "-----BEGIN PGP SIGNED MESSAGE-----\n" + auto const file = createTemporaryFile("twosimplesignedfile", "-----BEGIN PGP SIGNED MESSAGE-----\n" "Hash: SHA512\n" "\n" "Test\n" @@ -188,41 +176,21 @@ TEST(OpenMaybeClearSignedFileTest,TwoSimpleSignedFile) "=TB1F\n" "-----END PGP SIGNATURE-----"); EXPECT_TRUE(_error->empty()); - EXPECT_TRUE(StartsWithGPGClearTextSignature(tempfile)); - EXPECT_FALSE(OpenMaybeClearSignedFile(tempfile, fd)); - if (tempfile.empty() == false) - unlink(tempfile.c_str()); - EXPECT_FALSE(_error->empty()); - EXPECT_FALSE(fd.IsOpen()); - + EXPECT_TRUE(StartsWithGPGClearTextSignature(file.Name())); // technically they are signed, but we just want one message - EXPECT_TRUE(_error->PendingError()); - std::string msg; - EXPECT_TRUE(_error->PopMessage(msg)); - EXPECT_EQ("Clearsigned file '" + tempfile + "' contains unsigned lines.", msg); + EXPECT_FAILED_PARSE(file.Name(), "Clearsigned file '" + file.Name() + "' contains unsigned lines."); } TEST(OpenMaybeClearSignedFileTest,UnsignedFile) { - std::string tempfile; - FileFd fd; - createTemporaryFile("unsignedfile", fd, &tempfile, "Test"); - EXPECT_FALSE(StartsWithGPGClearTextSignature(tempfile)); - EXPECT_TRUE(OpenMaybeClearSignedFile(tempfile, fd)); - if (tempfile.empty() == false) - unlink(tempfile.c_str()); - EXPECT_TRUE(fd.IsOpen()); - char buffer[100]; - EXPECT_TRUE(fd.ReadLine(buffer, sizeof(buffer))); - EXPECT_STREQ(buffer, "Test"); - EXPECT_TRUE(fd.Eof()); + auto const file = createTemporaryFile("unsignedfile", "Test"); + EXPECT_FALSE(StartsWithGPGClearTextSignature(file.Name())); + EXPECT_SUCCESSFUL_PARSE(file.Name()); } TEST(OpenMaybeClearSignedFileTest,GarbageTop) { - std::string tempfile; - FileFd fd; - createTemporaryFile("garbagetop", fd, &tempfile, "Garbage\n" + auto const file = createTemporaryFile("garbagetop", "Garbage\n" "-----BEGIN PGP SIGNED MESSAGE-----\n" "Hash: SHA512\n" "\n" @@ -238,25 +206,13 @@ TEST(OpenMaybeClearSignedFileTest,GarbageTop) "JQt/+gJCPxHUJphy8sccBKhW29CLELJIIafvU30E1nWn9szh2Xjq\n" "=TB1F\n" "-----END PGP SIGNATURE-----\n"); - EXPECT_FALSE(StartsWithGPGClearTextSignature(tempfile)); - EXPECT_TRUE(_error->empty()); - EXPECT_FALSE(OpenMaybeClearSignedFile(tempfile, fd)); - if (tempfile.empty() == false) - unlink(tempfile.c_str()); - EXPECT_FALSE(fd.IsOpen()); - ASSERT_FALSE(_error->empty()); - ASSERT_TRUE(_error->PendingError()); - - std::string msg; - EXPECT_TRUE(_error->PopMessage(msg)); - EXPECT_EQ("Clearsigned file '" + tempfile + "' does not start with a signed message block.", msg); + EXPECT_FALSE(StartsWithGPGClearTextSignature(file.Name())); + EXPECT_FAILED_PARSE(file.Name(), "Clearsigned file '" + file.Name() + "' does not start with a signed message block."); } TEST(OpenMaybeClearSignedFileTest,GarbageHeader) { - std::string tempfile; - FileFd fd; - createTemporaryFile("garbageheader", fd, &tempfile, "-----BEGIN PGP SIGNED MESSAGE----- Garbage\n" + auto const file = createTemporaryFile("garbageheader", "-----BEGIN PGP SIGNED MESSAGE----- Garbage\n" "Hash: SHA512\n" "\n" "Test\n" @@ -271,11 +227,10 @@ TEST(OpenMaybeClearSignedFileTest,GarbageHeader) "JQt/+gJCPxHUJphy8sccBKhW29CLELJIIafvU30E1nWn9szh2Xjq\n" "=TB1F\n" "-----END PGP SIGNATURE-----\n"); - EXPECT_FALSE(StartsWithGPGClearTextSignature(tempfile)); + EXPECT_FALSE(StartsWithGPGClearTextSignature(file.Name())); // beware: the file will be successfully opened as unsigned file - EXPECT_TRUE(OpenMaybeClearSignedFile(tempfile, fd)); - if (tempfile.empty() == false) - unlink(tempfile.c_str()); + FileFd fd; + EXPECT_TRUE(OpenMaybeClearSignedFile(file.Name(), fd)); EXPECT_TRUE(fd.IsOpen()); char buffer[100]; EXPECT_TRUE(fd.ReadLine(buffer, sizeof(buffer))); @@ -285,9 +240,7 @@ TEST(OpenMaybeClearSignedFileTest,GarbageHeader) TEST(OpenMaybeClearSignedFileTest,GarbageBottom) { - std::string tempfile; - FileFd fd; - createTemporaryFile("garbagebottom", fd, &tempfile, "-----BEGIN PGP SIGNED MESSAGE-----\n" + auto const file = createTemporaryFile("garbagebottom", "-----BEGIN PGP SIGNED MESSAGE-----\n" "Hash: SHA512\n" "\n" "Test\n" @@ -303,68 +256,34 @@ TEST(OpenMaybeClearSignedFileTest,GarbageBottom) "=TB1F\n" "-----END PGP SIGNATURE-----\n" "Garbage"); - EXPECT_TRUE(StartsWithGPGClearTextSignature(tempfile)); - EXPECT_TRUE(_error->empty()); - EXPECT_FALSE(OpenMaybeClearSignedFile(tempfile, fd)); - if (tempfile.empty() == false) - unlink(tempfile.c_str()); - EXPECT_FALSE(fd.IsOpen()); - ASSERT_FALSE(_error->empty()); - ASSERT_TRUE(_error->PendingError()); - - std::string msg; - EXPECT_TRUE(_error->PopMessage(msg)); - EXPECT_EQ("Clearsigned file '" + tempfile + "' contains unsigned lines.", msg); + EXPECT_TRUE(StartsWithGPGClearTextSignature(file.Name())); + EXPECT_FAILED_PARSE(file.Name(), "Clearsigned file '" + file.Name() + "' contains unsigned lines."); } TEST(OpenMaybeClearSignedFileTest,BogusNoSig) { - std::string tempfile; - FileFd fd; - createTemporaryFile("bogusnosig", fd, &tempfile, "-----BEGIN PGP SIGNED MESSAGE-----\n" + auto const file = createTemporaryFile("bogusnosig", "-----BEGIN PGP SIGNED MESSAGE-----\n" "Hash: SHA512\n" "\n" "Test"); - EXPECT_TRUE(StartsWithGPGClearTextSignature(tempfile)); - EXPECT_TRUE(_error->empty()); - EXPECT_FALSE(OpenMaybeClearSignedFile(tempfile, fd)); - if (tempfile.empty() == false) - unlink(tempfile.c_str()); - EXPECT_FALSE(_error->empty()); - EXPECT_FALSE(fd.IsOpen()); - - std::string msg; - _error->PopMessage(msg); - EXPECT_EQ("Splitting of clearsigned file " + tempfile + " failed as it doesn't contain all expected parts", msg); + EXPECT_TRUE(StartsWithGPGClearTextSignature(file.Name())); + EXPECT_FAILED_PARSE(file.Name(), "Splitting of clearsigned file " + file.Name() + " failed as it doesn't contain all expected parts"); } TEST(OpenMaybeClearSignedFileTest,BogusSigStart) { - std::string tempfile; - FileFd fd; - createTemporaryFile("bogusnosig", fd, &tempfile, "-----BEGIN PGP SIGNED MESSAGE-----\n" + auto const file = createTemporaryFile("bogusnosig", "-----BEGIN PGP SIGNED MESSAGE-----\n" "Hash: SHA512\n" "\n" "Test\n" "-----BEGIN PGP SIGNATURE-----"); - EXPECT_TRUE(StartsWithGPGClearTextSignature(tempfile)); - EXPECT_TRUE(_error->empty()); - EXPECT_FALSE(OpenMaybeClearSignedFile(tempfile, fd)); - if (tempfile.empty() == false) - unlink(tempfile.c_str()); - EXPECT_FALSE(_error->empty()); - EXPECT_FALSE(fd.IsOpen()); - - std::string msg; - _error->PopMessage(msg); - EXPECT_EQ("Signature in file " + tempfile + " wasn't closed", msg); + EXPECT_TRUE(StartsWithGPGClearTextSignature(file.Name())); + EXPECT_FAILED_PARSE(file.Name(), "Signature in file " + file.Name() + " wasn't closed"); } TEST(OpenMaybeClearSignedFileTest,DashedSignedFile) { - std::string tempfile; - FileFd fd; - createTemporaryFile("dashedsignedfile", fd, &tempfile, "-----BEGIN PGP SIGNED MESSAGE-----\n" + auto const file = createTemporaryFile("dashedsignedfile", "-----BEGIN PGP SIGNED MESSAGE-----\n" "Hash: SHA512\n" "\n" "- Test\n" @@ -379,21 +298,12 @@ TEST(OpenMaybeClearSignedFileTest,DashedSignedFile) "JQt/+gJCPxHUJphy8sccBKhW29CLELJIIafvU30E1nWn9szh2Xjq\n" "=TB1F\n" "-----END PGP SIGNATURE-----\n"); - EXPECT_TRUE(StartsWithGPGClearTextSignature(tempfile)); - EXPECT_TRUE(OpenMaybeClearSignedFile(tempfile, fd)); - if (tempfile.empty() == false) - unlink(tempfile.c_str()); - EXPECT_TRUE(fd.IsOpen()); - char buffer[100]; - EXPECT_TRUE(fd.ReadLine(buffer, sizeof(buffer))); - EXPECT_STREQ(buffer, "Test"); - EXPECT_TRUE(fd.Eof()); + EXPECT_TRUE(StartsWithGPGClearTextSignature(file.Name())); + EXPECT_SUCCESSFUL_PARSE(file.Name()); } TEST(OpenMaybeClearSignedFileTest,StrangeDashArmorFile) { - std::string tempfile; - FileFd fd; - createTemporaryFile("strangedashfile", fd, &tempfile, "-----BEGIN PGP SIGNED MESSAGE-----\n" + auto const file = createTemporaryFile("strangedashfile", "-----BEGIN PGP SIGNED MESSAGE-----\n" "Hash: SHA512\n" "-Hash: SHA512\n" "\n" @@ -409,23 +319,12 @@ TEST(OpenMaybeClearSignedFileTest,StrangeDashArmorFile) "JQt/+gJCPxHUJphy8sccBKhW29CLELJIIafvU30E1nWn9szh2Xjq\n" "=TB1F\n" "-----END PGP SIGNATURE-----\n"); - EXPECT_TRUE(StartsWithGPGClearTextSignature(tempfile)); - EXPECT_FALSE(OpenMaybeClearSignedFile(tempfile, fd)); - if (tempfile.empty() == false) - unlink(tempfile.c_str()); - EXPECT_FALSE(_error->empty()); - EXPECT_FALSE(fd.IsOpen()); - - std::string msg; - EXPECT_TRUE(_error->PendingError()); - EXPECT_TRUE(_error->PopMessage(msg)); - EXPECT_EQ("Clearsigned file '" + tempfile + "' contains unexpected line starting with a dash (armor)", msg); + EXPECT_TRUE(StartsWithGPGClearTextSignature(file.Name())); + EXPECT_FAILED_PARSE(file.Name(), "Clearsigned file '" + file.Name() + "' contains unexpected line starting with a dash (armor)"); } TEST(OpenMaybeClearSignedFileTest,StrangeDashMsgFile) { - std::string tempfile; - FileFd fd; - createTemporaryFile("strangedashfile", fd, &tempfile, "-----BEGIN PGP SIGNED MESSAGE-----\n" + auto const file = createTemporaryFile("strangedashfile", "-----BEGIN PGP SIGNED MESSAGE-----\n" "Hash: SHA512\n" "\n" "-Test\n" @@ -440,23 +339,12 @@ TEST(OpenMaybeClearSignedFileTest,StrangeDashMsgFile) "JQt/+gJCPxHUJphy8sccBKhW29CLELJIIafvU30E1nWn9szh2Xjq\n" "=TB1F\n" "-----END PGP SIGNATURE-----\n"); - EXPECT_TRUE(StartsWithGPGClearTextSignature(tempfile)); - EXPECT_FALSE(OpenMaybeClearSignedFile(tempfile, fd)); - if (tempfile.empty() == false) - unlink(tempfile.c_str()); - EXPECT_FALSE(_error->empty()); - EXPECT_FALSE(fd.IsOpen()); - - std::string msg; - EXPECT_TRUE(_error->PendingError()); - EXPECT_TRUE(_error->PopMessage(msg)); - EXPECT_EQ("Clearsigned file '" + tempfile + "' contains unexpected line starting with a dash (msg)", msg); + EXPECT_TRUE(StartsWithGPGClearTextSignature(file.Name())); + EXPECT_FAILED_PARSE(file.Name(), "Clearsigned file '" + file.Name() + "' contains unexpected line starting with a dash (msg)"); } TEST(OpenMaybeClearSignedFileTest,StrangeDashSigFile) { - std::string tempfile; - FileFd fd; - createTemporaryFile("strangedashfile", fd, &tempfile, "-----BEGIN PGP SIGNED MESSAGE-----\n" + auto const file = createTemporaryFile("strangedashfile", "-----BEGIN PGP SIGNED MESSAGE-----\n" "Hash: SHA512\n" "\n" "Test\n" @@ -471,15 +359,6 @@ TEST(OpenMaybeClearSignedFileTest,StrangeDashSigFile) "JQt/+gJCPxHUJphy8sccBKhW29CLELJIIafvU30E1nWn9szh2Xjq\n" "=TB1F\n" "-----END PGP SIGNATURE-----\n"); - EXPECT_TRUE(StartsWithGPGClearTextSignature(tempfile)); - EXPECT_FALSE(OpenMaybeClearSignedFile(tempfile, fd)); - if (tempfile.empty() == false) - unlink(tempfile.c_str()); - EXPECT_FALSE(_error->empty()); - EXPECT_FALSE(fd.IsOpen()); - - std::string msg; - EXPECT_TRUE(_error->PendingError()); - EXPECT_TRUE(_error->PopMessage(msg)); - EXPECT_EQ("Clearsigned file '" + tempfile + "' contains unexpected line starting with a dash (sig)", msg); + EXPECT_TRUE(StartsWithGPGClearTextSignature(file.Name())); + EXPECT_FAILED_PARSE(file.Name(), "Clearsigned file '" + file.Name() + "' contains unexpected line starting with a dash (sig)"); } diff --git a/test/libapt/sourcelist_test.cc b/test/libapt/sourcelist_test.cc index 9441f56be..42fab65a9 100644 --- a/test/libapt/sourcelist_test.cc +++ b/test/libapt/sourcelist_test.cc @@ -14,9 +14,7 @@ TEST(SourceListTest,ParseFileDeb822) { - FileFd fd; - std::string tempfile; - createTemporaryFile("parsefiledeb822.XXXXXX.sources", fd, &tempfile, + auto const file = createTemporaryFile("parsefiledeb822.XXXXXX.sources", "Types: deb\n" "URIs: http://ftp.debian.org/debian\n" "Suites: stable\n" @@ -28,12 +26,8 @@ TEST(SourceListTest,ParseFileDeb822) "URIs: http://ftp.debian.org/debian\n" "Suites: unstable\n" "Components: main non-free\n"); - fd.Close(); pkgSourceList sources; - EXPECT_EQ(true, sources.Read(tempfile)); + EXPECT_TRUE(sources.Read(file.Name())); EXPECT_EQ(2u, sources.size()); - - if (tempfile.empty() == false) - unlink(tempfile.c_str()); } diff --git a/test/libapt/strutil_test.cc b/test/libapt/strutil_test.cc index 5cb6cb9ff..b7132c35f 100644 --- a/test/libapt/strutil_test.cc +++ b/test/libapt/strutil_test.cc @@ -187,7 +187,7 @@ static void ReadMessagesTestWithNewLine(char const * const nl, char const * cons "Description:\n" " ccc"; - createTemporaryFile("readmessage", fd, NULL, (pkgA + nl + pkgB + nl + pkgC + nl).c_str()); + openTemporaryFile("readmessage", fd, (pkgA + nl + pkgB + nl + pkgC + nl).c_str()); std::vector<std::string> list; EXPECT_TRUE(ReadMessages(fd.Fd(), list)); EXPECT_EQ(3u, list.size()); @@ -196,7 +196,7 @@ static void ReadMessagesTestWithNewLine(char const * const nl, char const * cons EXPECT_EQ(pkgC, list[2]); size_t const msgsize = 63990; - createTemporaryFile("readmessage", fd, NULL, NULL); + openTemporaryFile("readmessage", fd); for (size_t j = 0; j < msgsize; ++j) fd.Write(ab, strlen(ab)); for (size_t i = 0; i < 21; ++i) diff --git a/test/libapt/tagfile_test.cc b/test/libapt/tagfile_test.cc index 919b46cdb..06ea01c32 100644 --- a/test/libapt/tagfile_test.cc +++ b/test/libapt/tagfile_test.cc @@ -16,7 +16,7 @@ TEST(TagFileTest,SingleField) { FileFd fd; - createTemporaryFile("singlefield", fd, NULL, "FieldA-12345678: the value of the field"); + openTemporaryFile("singlefield", fd, "FieldA-12345678: the value of the field"); pkgTagFile tfile(&fd); pkgTagSection section; @@ -41,7 +41,7 @@ TEST(TagFileTest,SingleField) EXPECT_FALSE(section.Exists("FieldA-12345678")); EXPECT_FALSE(section.Exists("FieldB-12345678")); - createTemporaryFile("emptyfile", fd, NULL, NULL); + openTemporaryFile("emptyfile", fd); ASSERT_FALSE(tfile.Step(section)); EXPECT_EQ(0u, section.Count()); } @@ -49,7 +49,7 @@ TEST(TagFileTest,SingleField) TEST(TagFileTest,MultipleSections) { FileFd fd; - createTemporaryFile("bigsection", fd, NULL, "Package: pkgA\n" + openTemporaryFile("bigsection", fd, "Package: pkgA\n" "Version: 1\n" "Size: 100\n" "Description: aaa\n" @@ -140,7 +140,7 @@ TEST(TagFileTest,BigSection) content << "Field-" << i << ": " << (2000 + i) << std::endl; FileFd fd; - createTemporaryFile("bigsection", fd, NULL, content.str().c_str()); + openTemporaryFile("bigsection", fd, content.str().c_str()); pkgTagFile tfile(&fd); pkgTagSection section; @@ -230,7 +230,7 @@ TEST(TagFileTest, SpacesEverywhere) TEST(TagFileTest, Comments) { FileFd fd; - createTemporaryFile("commentfile", fd, NULL, "# Leading comments should be ignored.\n" + openTemporaryFile("commentfile", fd, "# Leading comments should be ignored.\n" "\n" "# A wild second comment appears!\n" "\n" @@ -289,7 +289,7 @@ TEST(TagFileTest, Comments) TEST(TagFileTest, EmptyTagName) { FileFd fd; - createTemporaryFile("emptytagname", fd, NULL, "0:\n" + openTemporaryFile("emptytagname", fd, "0:\n" "PACKAGE:0\n" "\n" ":\n" diff --git a/test/libapt/tagsection_test.cc b/test/libapt/tagsection_test.cc index 3f170b25a..80cecca5b 100644 --- a/test/libapt/tagsection_test.cc +++ b/test/libapt/tagsection_test.cc @@ -16,23 +16,9 @@ std::string typoValue = "aa\n" " cc"; std::string typoRawValue = "\n " + typoValue; std::string overrideValue = "1"; -/* - std::cerr << "FILECONTENT: »"; - char buffer[3000]; - while (fd.ReadLine(buffer, sizeof(buffer))) - std::cerr << buffer; - std::cerr << "«" << std::endl;; -*/ -static void setupTestcaseStart(FileFd &fd, pkgTagSection §ion, std::string &content) +static void EXPECT_SECTION_WITH_ALL_CONTENT(pkgTagSection const §ion) { - createTemporaryFile("writesection", fd, NULL, NULL); - content = "Package: " + packageValue + "\n" - "TypoA:\n " + typoValue + "\n" - "Override: " + overrideValue + "\n" - "Override-Backup: " + overrideValue + "\n" - "\n"; - EXPECT_TRUE(section.Scan(content.c_str(), content.length(), true)); EXPECT_TRUE(section.Exists("Package")); EXPECT_TRUE(section.Exists("TypoA")); EXPECT_TRUE(section.Exists("Override")); @@ -45,6 +31,18 @@ static void setupTestcaseStart(FileFd &fd, pkgTagSection §ion, std::string & EXPECT_EQ(1, section.FindI("Override-Backup")); EXPECT_EQ(4u, section.Count()); } + +static void setupTestcaseStart(FileFd &fd, pkgTagSection §ion, std::string &content) +{ + openTemporaryFile("writesection", fd); + content = "Package: " + packageValue + "\n" + "TypoA:\n " + typoValue + "\n" + "Override: " + overrideValue + "\n" + "Override-Backup: " + overrideValue + "\n" + "\n"; + EXPECT_TRUE(section.Scan(content.c_str(), content.length(), true)); + EXPECT_SECTION_WITH_ALL_CONTENT(section); +} TEST(TagSectionTest,WriteUnmodified) { FileFd fd; @@ -55,16 +53,7 @@ TEST(TagSectionTest,WriteUnmodified) EXPECT_TRUE(fd.Seek(0)); pkgTagFile tfile(&fd); ASSERT_TRUE(tfile.Step(section)); - EXPECT_TRUE(section.Exists("Package")); - EXPECT_TRUE(section.Exists("TypoA")); - EXPECT_TRUE(section.Exists("Override")); - EXPECT_TRUE(section.Exists("Override-Backup")); - EXPECT_FALSE(section.Exists("TypoB")); - EXPECT_EQ(packageValue, section.FindS("Package")); - EXPECT_EQ(typoValue, section.FindS("TypoA")); - EXPECT_EQ(1, section.FindI("Override")); - EXPECT_EQ(1, section.FindI("Override-Backup")); - EXPECT_EQ(4u, section.Count()); + EXPECT_SECTION_WITH_ALL_CONTENT(section); } TEST(TagSectionTest,WriteUnmodifiedOrder) { @@ -77,16 +66,7 @@ TEST(TagSectionTest,WriteUnmodifiedOrder) EXPECT_TRUE(fd.Seek(0)); pkgTagFile tfile(&fd); ASSERT_TRUE(tfile.Step(section)); - EXPECT_TRUE(section.Exists("Package")); - EXPECT_TRUE(section.Exists("TypoA")); - EXPECT_TRUE(section.Exists("Override")); - EXPECT_TRUE(section.Exists("Override-Backup")); - EXPECT_FALSE(section.Exists("TypoB")); - EXPECT_EQ(packageValue, section.FindS("Package")); - EXPECT_EQ(typoValue, section.FindS("TypoA")); - EXPECT_EQ(1, section.FindI("Override")); - EXPECT_EQ(1, section.FindI("Override-Backup")); - EXPECT_EQ(4u, section.Count()); + EXPECT_SECTION_WITH_ALL_CONTENT(section); } TEST(TagSectionTest,WriteUnmodifiedOrderReversed) { @@ -99,16 +79,7 @@ TEST(TagSectionTest,WriteUnmodifiedOrderReversed) EXPECT_TRUE(fd.Seek(0)); pkgTagFile tfile(&fd); ASSERT_TRUE(tfile.Step(section)); - EXPECT_TRUE(section.Exists("Package")); - EXPECT_TRUE(section.Exists("TypoA")); - EXPECT_TRUE(section.Exists("Override")); - EXPECT_TRUE(section.Exists("Override-Backup")); - EXPECT_FALSE(section.Exists("TypoB")); - EXPECT_EQ(packageValue, section.FindS("Package")); - EXPECT_EQ(typoValue, section.FindS("TypoA")); - EXPECT_EQ(1, section.FindI("Override")); - EXPECT_EQ(1, section.FindI("Override-Backup")); - EXPECT_EQ(4u, section.Count()); + EXPECT_SECTION_WITH_ALL_CONTENT(section); } TEST(TagSectionTest,WriteUnmodifiedOrderNotAll) { @@ -121,16 +92,7 @@ TEST(TagSectionTest,WriteUnmodifiedOrderNotAll) EXPECT_TRUE(fd.Seek(0)); pkgTagFile tfile(&fd); ASSERT_TRUE(tfile.Step(section)); - EXPECT_TRUE(section.Exists("Package")); - EXPECT_TRUE(section.Exists("TypoA")); - EXPECT_TRUE(section.Exists("Override")); - EXPECT_TRUE(section.Exists("Override-Backup")); - EXPECT_FALSE(section.Exists("TypoB")); - EXPECT_EQ(packageValue, section.FindS("Package")); - EXPECT_EQ(typoValue, section.FindS("TypoA")); - EXPECT_EQ(1, section.FindI("Override")); - EXPECT_EQ(1, section.FindI("Override-Backup")); - EXPECT_EQ(4u, section.Count()); + EXPECT_SECTION_WITH_ALL_CONTENT(section); } TEST(TagSectionTest,WriteNoOrderRename) { |