diff --git a/CMake/CheckCxxTarget.cmake b/CMake/CheckCxxTarget.cmake index 373c0be4c90482dca8bfaca901388f38f585bc63..17c32bfac82de7ff4f37264f16d4a92a1c5b022a 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/apti18n.h.in b/CMake/apti18n.h.in index 1929795906378635d22a13c7b4d575bbd25a799c..de9c84965b54158ca528da0c1b4b36f102d43a43 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(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 e98a166e4892ef0edd6e1c2b6950fc02614c1c90..afd74adb5f801f5468cb4b7595585360e48e3fc5 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 ") -set(PACKAGE_VERSION "2.1.1") +set(PACKAGE_VERSION "2.1.7") string(REGEX MATCH "^[0-9.]+" PROJECT_VERSION ${PACKAGE_VERSION}) if (NOT DEFINED DPKG_DATADIR) diff --git a/apt-pkg/acquire.cc b/apt-pkg/acquire.cc index fffe76f461a3213052728cae46f2da5b2c7a8a18..1cffc0463e991cf9080f42125a170c9989e63db0 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 f2977b9af385946aff38c6a4c903cfbf81cad498..cd09a694493aaeb27ff92739f29d9d89239a77f8 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 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 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 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 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 093364ff1527e39acb09bb59ca3e5a19d472960f..d64bc4ccfd072c2b818dd437746f1c5349034614 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 3967ba980d4f3fb58828be11f76c3d486b2fc8cd..565a2b29877c0cddf590870ec3e82ffa17c2ea17 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 3fc3afedbf8530cea3c0363125eb1837a29d6171..5cb43c6902e8099b1874cabedbf4eb64b7ef70cc 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 9bb0a55c085f2907415baa7334196492d68a10bf..1616c9f1249e556c6c0ebee206ca55bc46129ded 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(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 045dbe17dc1e9cb7d097f557e17652d526d43230..e91c1acc33e7b0dee258fd9e40367772f2091e3d 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 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 7d9bf116e063f67de41c8d6d278584465df0278d..4ca20827356236757ea5b53332ce8a89bf924440 100644 --- a/apt-pkg/contrib/srvrec.cc +++ b/apt-pkg/contrib/srvrec.cc @@ -137,17 +137,12 @@ bool GetSrvRecords(std::string name, std::vector &Result) // sort them by priority std::stable_sort(Result.begin(), Result.end()); - for(std::vector::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 ab957a01af418f092995f9ccccaf5f89bab68c40..240946529ac9c96006bd5a6e2630078a539d7f71 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 6904879b6f27eac234ee2955ae01b0bd2e306091..eac43c3b7655dfed2bd0eef6b1ff90027cb7903d 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 @@ -465,9 +465,14 @@ pid_t debSystem::ExecDpkg(std::vector const &sArgs, int * const inp } /*}}}*/ bool debSystem::MultiArchSupported() const /*{{{*/ +{ + return AssertFeature("multi-arch"); +} + /*}}}*/ +bool debSystem::AssertFeature(std::string const &feature) /*{{{*/ { std::vector 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 2e5a8550cae5d494fea783e3cb3be7b78fb53133..b3d241512ccddf2a596a82e59428c48b5c81b6fe 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 const &sArgs, int * const inputFd, int * const outputFd, bool const DiscardOutput); bool MultiArchSupported() const override; + static bool AssertFeature(std::string const &Feature); std::vector 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 ef73881c875db68c57d32a0af0f43afce0b3aa2f..c496538ccdc0e775cc663fec706af0a2355b6d2b 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 &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 f86ae7d242de478f3bfc5bbd4164458202fdb890..817d9de3c844aab0ded7d079b33d81189095fec9 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(State.DepState), static_cast(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(State.DepState), static_cast(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(State.DepState), static_cast(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(State.DepState), static_cast(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 + IsOk 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]; @@ -918,78 +1061,21 @@ bool pkgDepCache::IsDeleteOkProtectInstallRequests(PkgIterator const &Pkg, return false; } } - 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 - IsOk 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 &toInstall, std::vector &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 &toInstall, std::vector &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 &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 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()); - if ((D->Version != 0 || TrgPkg != Pkg) && - PkgState[Pkg->ID].CandidateVer != PkgState[Pkg->ID].InstallVer && - PkgState[Pkg->ID].CandidateVer != *I) + 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 (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 &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 &toInstall, APT::PackageVector *const toMoveAuto, bool const propagateProctected, bool const FromUser) /*{{{*/ +static bool MarkInstall_InstallDependencies(pkgDepCache &Cache, bool const DebugAutoInstall, bool const DebugMarker, pkgCache::PkgIterator const &Pkg, unsigned long Depth, bool const ForceImportantDeps, std::vector &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) { + failedToInstallSomething = true; if (not propagateProctected && not FromUser) - { - 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; + break; } } toInstall.clear(); - return true; + return not failedToInstallSomething; } /*}}}*/ // DepCache::MarkInstall - Put the package in the install state /*{{{*/ @@ -1330,24 +1534,28 @@ 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 @@ -1359,26 +1567,32 @@ bool pkgDepCache::MarkInstall(PkgIterator const &Pkg, bool AutoInst, 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 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; + } } 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'; @@ -1402,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); @@ -1422,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, FromUser)) - 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) { @@ -1438,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 /*{{{*/ @@ -1813,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 /*{{{*/ @@ -1978,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 858de550567fa265a021418c8e70608de75d7fa9..78f88ba2fe3474c1ebead8c1e4007aa2268a8d58 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 &toInstall, std::vector &toRemove); - APT_HIDDEN bool MarkInstall_RemoveConflictsIfNotUpgradeable(pkgCache::VerIterator const &PV, unsigned long Depth, std::vector &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 &toInstall, APT::PackageVector *const toMoveAuto, bool const propagateProtected, bool const FromUser); + 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 fe6f55dcb83a2f6646e37114ed49fa299b9392a0..7e3993be4b517e0a2c9a8cccc1f4c8edd8d6b030 100644 --- a/apt-pkg/edsp.cc +++ b/apt-pkg/edsp.cc @@ -29,8 +29,10 @@ #include #include +#include #include #include +#include #include #include @@ -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 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(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 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::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 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::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 a619368ecbeb4ce934faa4949756c9421643a7bf..b9d9b15d20f019e9d2f2bfbd03f5d557692ee5ea 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 02448a073cdcd1bc0f250946e78c3269c675d574..7eb5ab10bec82481283e1ac2e456808bacf95387 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 a979a404b878c73d24034e6febfbd53c58d7f943..a16bc686a6efac2ea237d21215be9cd9a8e07b61 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 4c2068c00059e965f5be7e288f23e816cccc374c..bb199b32ee85d080cba14ce6289d86b6a5b388c0 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 b3f9469ac23d2efd4013f5b356e40272e5ab7391..b2114740e051a9d58f382ce24589c3bbcacb168a 100644 --- a/apt-private/private-search.cc +++ b/apt-private/private-search.cc @@ -42,7 +42,7 @@ static std::vector 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 24a9f23ebcdbcc0b59bb70f7e3383c8092803241..ab44b9fd1950c5e0a026def7159c32b5618a290a 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 Buf(new char[BufSize]); + std::unique_ptr 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 91f3892bd51559a3c0cdfe77e1c36f0728d93ca4..65c514158a21a1a06725bfa1101865d85a9a8df6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,112 @@ +apt (2.1.7+parrot1) rolling-testing; urgency=medium + + * Import new Debian version. + * Re-enable https-to-http redirects. + + -- Lorenzo "Palinuro" Faletra Sat, 18 Jul 2020 16:27:55 +0200 + +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 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 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 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 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 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 Wed, 13 May 2020 22:04:47 +0200 + + apt (2.1.1+parrot1) rolling; urgency=medium * Import new Debian release. diff --git a/doc/apt-verbatim.ent b/doc/apt-verbatim.ent index 301178cafaa7ba64717835417f0aef52d9511edb..c691d1de8d4b458bb7c5543c6b92a243e87057c8 100644 --- a/doc/apt-verbatim.ent +++ b/doc/apt-verbatim.ent @@ -274,7 +274,7 @@ "> - + diff --git a/doc/examples/configure-index b/doc/examples/configure-index index 497483cccd42a6d07d31f6b5dff868ed98da3f0b..f04e32502fc149bf4f1f1ddf0ec3a7039f7f65b0 100644 --- a/doc/examples/configure-index +++ b/doc/examples/configure-index @@ -558,6 +558,7 @@ Debug pkgCacheGen { Essential ""; // native,all, none, installed + Protected ""; // native,all, none, installed ForceEssential ""; // package names ForceImportant ""; // package names }; @@ -586,6 +587,7 @@ pkgProblemResolver::Scores AddEssential ""; }; pkgProblemResolver::FixByInstall ""; +pkgProblemResolver::MaxCounter ""; APT::FTPArchive::release { diff --git a/doc/po/apt-doc.pot b/doc/po/apt-doc.pot index a44998f1884e08aa1b20a83026d631a814a9da9f..f0bf7bdf1bc1bce3cbfa4829b4dce37b0084f6cf 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.1\n" +"Project-Id-Version: apt-doc 2.1.7\n" "Report-Msgid-Bugs-To: APT Development Team \n" -"POT-Creation-Date: 2020-05-08 18:03+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 \n" "Language-Team: LANGUAGE \n" @@ -496,12 +496,18 @@ msgid "" msgstr "" #. type: Content of: -#: apt.8.xml apt-get.8.xml apt-cache.8.xml apt-key.8.xml apt-mark.8.xml apt-secure.8.xml apt-cdrom.8.xml apt-config.8.xml +#: apt.8.xml apt-get.8.xml apt-cache.8.xml apt-key.8.xml apt-mark.8.xml +#: apt-secure.8.xml apt-cdrom.8.xml apt-config.8.xml msgid "8" msgstr "" #. type: Content of: -#: apt.8.xml apt-get.8.xml apt-cache.8.xml apt-key.8.xml apt-mark.8.xml apt-secure.8.xml apt-cdrom.8.xml apt-config.8.xml apt.conf.5.xml apt_preferences.5.xml sources.list.5.xml apt-extracttemplates.1.xml apt-sortpkgs.1.xml apt-ftparchive.1.xml apt_auth.conf.5.xml apt-transport-http.1.xml apt-transport-https.1.xml apt-transport-mirror.1.xml apt-patterns.7.xml +#: apt.8.xml apt-get.8.xml apt-cache.8.xml apt-key.8.xml apt-mark.8.xml +#: apt-secure.8.xml apt-cdrom.8.xml apt-config.8.xml apt.conf.5.xml +#: apt_preferences.5.xml sources.list.5.xml apt-extracttemplates.1.xml +#: apt-sortpkgs.1.xml apt-ftparchive.1.xml apt_auth.conf.5.xml +#: apt-transport-http.1.xml apt-transport-https.1.xml +#: apt-transport-mirror.1.xml apt-patterns.7.xml msgid "APT" msgstr "" @@ -511,7 +517,12 @@ msgid "command-line interface" msgstr "" #. type: Content of: -#: apt.8.xml apt-get.8.xml apt-cache.8.xml apt-key.8.xml apt-mark.8.xml apt-secure.8.xml apt-cdrom.8.xml apt-config.8.xml apt.conf.5.xml apt_preferences.5.xml sources.list.5.xml apt-extracttemplates.1.xml apt-sortpkgs.1.xml apt-ftparchive.1.xml apt_auth.conf.5.xml apt-transport-http.1.xml apt-transport-https.1.xml apt-transport-mirror.1.xml apt-patterns.7.xml +#: apt.8.xml apt-get.8.xml apt-cache.8.xml apt-key.8.xml apt-mark.8.xml +#: apt-secure.8.xml apt-cdrom.8.xml apt-config.8.xml apt.conf.5.xml +#: apt_preferences.5.xml sources.list.5.xml apt-extracttemplates.1.xml +#: apt-sortpkgs.1.xml apt-ftparchive.1.xml apt_auth.conf.5.xml +#: apt-transport-http.1.xml apt-transport-https.1.xml +#: apt-transport-mirror.1.xml apt-patterns.7.xml msgid "Description" msgstr "" @@ -711,7 +722,11 @@ msgid "" msgstr "" #. type: Content of: <refentry><refsect1><title> -#: apt.8.xml apt-get.8.xml apt-cache.8.xml apt-key.8.xml apt-mark.8.xml apt-secure.8.xml apt-cdrom.8.xml apt-config.8.xml apt.conf.5.xml apt_preferences.5.xml sources.list.5.xml apt-extracttemplates.1.xml apt-sortpkgs.1.xml apt-ftparchive.1.xml apt_auth.conf.5.xml apt-transport-http.1.xml apt-transport-https.1.xml apt-patterns.7.xml +#: apt.8.xml apt-get.8.xml apt-cache.8.xml apt-key.8.xml apt-mark.8.xml +#: apt-secure.8.xml apt-cdrom.8.xml apt-config.8.xml apt.conf.5.xml +#: apt_preferences.5.xml sources.list.5.xml apt-extracttemplates.1.xml +#: apt-sortpkgs.1.xml apt-ftparchive.1.xml apt_auth.conf.5.xml +#: apt-transport-http.1.xml apt-transport-https.1.xml apt-patterns.7.xml msgid "See Also" msgstr "" @@ -723,7 +738,9 @@ msgid "" msgstr "" #. type: Content of: <refentry><refsect1><title> -#: apt.8.xml apt-get.8.xml apt-cache.8.xml apt-mark.8.xml apt-cdrom.8.xml apt-config.8.xml apt-extracttemplates.1.xml apt-sortpkgs.1.xml apt-ftparchive.1.xml +#: apt.8.xml apt-get.8.xml apt-cache.8.xml apt-mark.8.xml apt-cdrom.8.xml +#: apt-config.8.xml apt-extracttemplates.1.xml apt-sortpkgs.1.xml +#: apt-ftparchive.1.xml msgid "Diagnostics" msgstr "" @@ -749,7 +766,8 @@ msgid "" msgstr "" #. type: Content of: <refentry><refsect1><para> -#: apt-get.8.xml apt-cache.8.xml apt-cdrom.8.xml apt-config.8.xml apt-ftparchive.1.xml +#: apt-get.8.xml apt-cache.8.xml apt-cdrom.8.xml apt-config.8.xml +#: apt-ftparchive.1.xml msgid "" "Unless the <option>-h</option>, or <option>--help</option> option is given, " "one of the commands below must be present." @@ -1085,7 +1103,8 @@ msgid "" msgstr "" #. type: Content of: <refentry><refsect1><title> -#: apt-get.8.xml apt-cache.8.xml apt-config.8.xml apt-extracttemplates.1.xml apt-sortpkgs.1.xml apt-ftparchive.1.xml +#: apt-get.8.xml apt-cache.8.xml apt-config.8.xml apt-extracttemplates.1.xml +#: apt-sortpkgs.1.xml apt-ftparchive.1.xml msgid "options" msgstr "" @@ -1507,7 +1526,8 @@ msgid "" msgstr "" #. type: Content of: <refentry><refsect1><title> -#: apt-get.8.xml apt-cache.8.xml apt-key.8.xml apt-mark.8.xml apt.conf.5.xml apt_preferences.5.xml apt_auth.conf.5.xml +#: apt-get.8.xml apt-cache.8.xml apt-key.8.xml apt-mark.8.xml apt.conf.5.xml +#: apt_preferences.5.xml apt_auth.conf.5.xml msgid "Files" msgstr "" @@ -2138,7 +2158,8 @@ msgid "" msgstr "" #. type: Content of: <refentry><refsect1><title> -#: apt-key.8.xml apt-mark.8.xml apt-cdrom.8.xml apt-transport-http.1.xml apt-transport-https.1.xml apt-transport-mirror.1.xml +#: apt-key.8.xml apt-mark.8.xml apt-cdrom.8.xml apt-transport-http.1.xml +#: apt-transport-https.1.xml apt-transport-mirror.1.xml msgid "Options" msgstr "" @@ -2801,7 +2822,8 @@ msgid "" msgstr "" #. type: Content of: <refentry><refsect1><para> -#: apt-config.8.xml apt-extracttemplates.1.xml apt-sortpkgs.1.xml apt-ftparchive.1.xml +#: apt-config.8.xml apt-extracttemplates.1.xml apt-sortpkgs.1.xml +#: apt-ftparchive.1.xml msgid "&apt-conf;" msgstr "" @@ -4244,7 +4266,9 @@ msgid "" msgstr "" #. type: Content of: <refentry><refsect1><title> -#: apt.conf.5.xml apt_preferences.5.xml sources.list.5.xml apt-ftparchive.1.xml apt-transport-http.1.xml apt-transport-https.1.xml apt-transport-mirror.1.xml apt-patterns.7.xml +#: apt.conf.5.xml apt_preferences.5.xml sources.list.5.xml apt-ftparchive.1.xml +#: apt-transport-http.1.xml apt-transport-https.1.xml +#: apt-transport-mirror.1.xml apt-patterns.7.xml msgid "Examples" msgstr "" @@ -6164,7 +6188,9 @@ msgid "&apt-get;, &apt-conf;, &apt-acquire-additional-files;" msgstr "" #. type: Content of: <refentry><refmeta><manvolnum> -#: apt-extracttemplates.1.xml apt-sortpkgs.1.xml apt-ftparchive.1.xml apt-transport-http.1.xml apt-transport-https.1.xml apt-transport-mirror.1.xml +#: apt-extracttemplates.1.xml apt-sortpkgs.1.xml apt-ftparchive.1.xml +#: apt-transport-http.1.xml apt-transport-https.1.xml +#: apt-transport-mirror.1.xml msgid "1" msgstr "" diff --git a/doc/po/nl.po b/doc/po/nl.po index 96097127d247e0956e9f68ed742f3bb65e7d03df..53145ebae22d4d2f066d79665ebe4d4657445466 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 8bf5313708d05272e44be93c6c94e1fd9249cc67..1d30c9b31787309c33890267f191ad14f0295fc0 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/basehttp-orig.cc b/methods/basehttp-orig.cc deleted file mode 100644 index e659da25511eca8410a6eb79acb067ef7007d535..0000000000000000000000000000000000000000 --- a/methods/basehttp-orig.cc +++ /dev/null @@ -1,908 +0,0 @@ -// -*- mode: cpp; mode: fold -*- -// Description /*{{{*/ -/* ###################################################################### - - HTTP and HTTPS share a lot of common code and these classes are - exactly the dumping ground for this common code - - ##################################################################### */ - /*}}}*/ -// Include Files /*{{{*/ -#include <config.h> - -#include <apt-pkg/configuration.h> -#include <apt-pkg/error.h> -#include <apt-pkg/fileutl.h> -#include <apt-pkg/strutl.h> - -#include <iostream> -#include <limits> -#include <map> -#include <string> -#include <vector> -#include <ctype.h> -#include <signal.h> -#include <stdio.h> -#include <stdlib.h> -#include <sys/stat.h> -#include <sys/time.h> -#include <time.h> -#include <unistd.h> - -#include "basehttp.h" - -#include <apti18n.h> - /*}}}*/ -using namespace std; - -string BaseHttpMethod::FailFile; -int BaseHttpMethod::FailFd = -1; -time_t BaseHttpMethod::FailTime = 0; - -// Number of successful requests in a pipeline needed to continue -// pipelining after a connection reset. -constexpr int PIPELINE_MIN_SUCCESSFUL_ANSWERS_TO_CONTINUE = 3; - -// ServerState::RunHeaders - Get the headers before the data /*{{{*/ -// --------------------------------------------------------------------- -/* Returns 0 if things are OK, 1 if an IO error occurred and 2 if a header - parse error occurred */ -ServerState::RunHeadersResult ServerState::RunHeaders(RequestState &Req, - const std::string &Uri) -{ - Owner->Status(_("Waiting for headers")); - do - { - string Data; - if (ReadHeaderLines(Data) == false) - continue; - - if (Owner->Debug == true) - clog << "Answer for: " << Uri << endl << Data; - - for (string::const_iterator I = Data.begin(); I < Data.end(); ++I) - { - string::const_iterator J = I; - for (; J != Data.end() && *J != '\n' && *J != '\r'; ++J); - if (Req.HeaderLine(string(I,J)) == false) - return RUN_HEADERS_PARSE_ERROR; - I = J; - } - - // 100 Continue is a Nop... - if (Req.Result == 100) - continue; - - // Tidy up the connection persistence state. - if (Req.Encoding == RequestState::Closes && Req.HaveContent == true) - Persistent = false; - - return RUN_HEADERS_OK; - } while (LoadNextResponse(false, Req) == ResultState::SUCCESSFUL); - - return RUN_HEADERS_IO_ERROR; -} - /*}}}*/ -bool RequestState::HeaderLine(string const &Line) /*{{{*/ -{ - if (Line.empty() == true) - return true; - - if (Result == 0 && Line.size() > 4 && stringcasecmp(Line.data(), Line.data() + 4, "HTTP") == 0) - { - // Evil servers return no version - if (Line[4] == '/') - { - int const elements = sscanf(Line.c_str(),"HTTP/%3u.%3u %3u%359[^\n]",&Major,&Minor,&Result,Code); - if (elements == 3) - { - Code[0] = '\0'; - if (Owner != NULL && Owner->Debug == true) - clog << "HTTP server doesn't give Reason-Phrase for " << std::to_string(Result) << std::endl; - } - else if (elements != 4) - return _error->Error(_("The HTTP server sent an invalid reply header")); - } - else - { - Major = 0; - Minor = 9; - if (sscanf(Line.c_str(),"HTTP %3u%359[^\n]",&Result,Code) != 2) - return _error->Error(_("The HTTP server sent an invalid reply header")); - } - - /* Check the HTTP response header to get the default persistence - state. */ - if (Major < 1) - Server->Persistent = false; - else - { - if (Major == 1 && Minor == 0) - { - Server->Persistent = false; - } - else - { - Server->Persistent = true; - if (Server->PipelineAllowed) - Server->Pipeline = true; - } - } - - return true; - } - - // Blah, some servers use "connection:closes", evil. - // and some even send empty header fields… - string::size_type Pos = Line.find(':'); - if (Pos == string::npos) - return _error->Error(_("Bad header line")); - ++Pos; - - // Parse off any trailing spaces between the : and the next word. - string::size_type Pos2 = Pos; - while (Pos2 < Line.length() && isspace_ascii(Line[Pos2]) != 0) - Pos2++; - - string const Tag(Line,0,Pos); - string const Val(Line,Pos2); - - if (stringcasecmp(Tag,"Content-Length:") == 0) - { - auto ContentLength = strtoull(Val.c_str(), NULL, 10); - if (ContentLength == 0) - return true; - if (Encoding == Closes) - Encoding = Stream; - HaveContent = true; - - unsigned long long * DownloadSizePtr = &DownloadSize; - if (Result == 416 || (Result >= 300 && Result < 400)) - DownloadSizePtr = &JunkSize; - - *DownloadSizePtr = ContentLength; - if (*DownloadSizePtr >= std::numeric_limits<unsigned long long>::max()) - return _error->Errno("HeaderLine", _("The HTTP server sent an invalid Content-Length header")); - else if (*DownloadSizePtr == 0) - HaveContent = false; - - // On partial content (206) the Content-Length less than the real - // size, so do not set it here but leave that to the Content-Range - // header instead - if(Result != 206 && TotalFileSize == 0) - TotalFileSize = DownloadSize; - - return true; - } - - if (stringcasecmp(Tag,"Content-Type:") == 0) - { - HaveContent = true; - return true; - } - - // The Content-Range field only has a meaning in HTTP/1.1 for the - // 206 (Partial Content) and 416 (Range Not Satisfiable) responses - // according to RFC7233 "Range Requests", §4.2, so only consider it - // for such responses. - if ((Result == 416 || Result == 206) && stringcasecmp(Tag,"Content-Range:") == 0) - { - HaveContent = true; - - // §14.16 says 'byte-range-resp-spec' should be a '*' in case of 416 - if (Result == 416 && sscanf(Val.c_str(), "bytes */%llu",&TotalFileSize) == 1) - ; // we got the expected filesize which is all we wanted - else if (sscanf(Val.c_str(),"bytes %llu-%*u/%llu",&StartPos,&TotalFileSize) != 2) - return _error->Error(_("The HTTP server sent an invalid Content-Range header")); - if (StartPos > TotalFileSize) - return _error->Error(_("This HTTP server has broken range support")); - - // figure out what we will download - DownloadSize = TotalFileSize - StartPos; - return true; - } - - if (stringcasecmp(Tag,"Transfer-Encoding:") == 0) - { - HaveContent = true; - if (stringcasecmp(Val,"chunked") == 0) - Encoding = Chunked; - return true; - } - - if (stringcasecmp(Tag,"Connection:") == 0) - { - if (stringcasecmp(Val,"close") == 0) - { - Server->Persistent = false; - Server->Pipeline = false; - /* Some servers send error pages (as they are dynamically generated) - for simplicity via a connection close instead of e.g. chunked, - so assuming an always closing server only if we get a file + close */ - if (Result >= 200 && Result < 300 && Server->PipelineAnswersReceived < PIPELINE_MIN_SUCCESSFUL_ANSWERS_TO_CONTINUE) - { - Server->PipelineAllowed = false; - Server->PipelineAnswersReceived = 0; - } - } - else if (stringcasecmp(Val,"keep-alive") == 0) - Server->Persistent = true; - return true; - } - - if (stringcasecmp(Tag,"Last-Modified:") == 0) - { - if (RFC1123StrToTime(Val, Date) == false) - return _error->Error(_("Unknown date format")); - return true; - } - - if (stringcasecmp(Tag,"Location:") == 0) - { - Location = Val; - return true; - } - - if (stringcasecmp(Tag, "Accept-Ranges:") == 0) - { - std::string ranges = ',' + Val + ','; - ranges.erase(std::remove(ranges.begin(), ranges.end(), ' '), ranges.end()); - if (ranges.find(",bytes,") == std::string::npos) - Server->RangesAllowed = false; - return true; - } - - return true; -} - /*}}}*/ -// ServerState::ServerState - Constructor /*{{{*/ -ServerState::ServerState(URI Srv, BaseHttpMethod *Owner) : - ServerName(Srv), TimeOut(30), Owner(Owner) -{ - Reset(); -} - /*}}}*/ -bool RequestState::AddPartialFileToHashes(FileFd &File) /*{{{*/ -{ - File.Truncate(StartPos); - return Server->GetHashes()->AddFD(File, StartPos); -} - /*}}}*/ -void ServerState::Reset() /*{{{*/ -{ - Persistent = false; - Pipeline = false; - PipelineAllowed = true; - RangesAllowed = true; - PipelineAnswersReceived = 0; -} - /*}}}*/ - -// BaseHttpMethod::DealWithHeaders - Handle the retrieved header data /*{{{*/ -// --------------------------------------------------------------------- -/* We look at the header data we got back from the server and decide what - to do. Returns DealWithHeadersResult (see http.h for details). - */ -BaseHttpMethod::DealWithHeadersResult -BaseHttpMethod::DealWithHeaders(FetchResult &Res, RequestState &Req) -{ - // Not Modified - if (Req.Result == 304) - { - RemoveFile("server", Queue->DestFile); - Res.IMSHit = true; - Res.LastModified = Queue->LastModified; - Res.Size = 0; - return IMS_HIT; - } - - /* Note that it is only OK for us to treat all redirection the same - because we *always* use GET, not other HTTP methods. - Codes not mentioned are handled as errors later as required by the - HTTP spec to handle unknown codes the same as the x00 code. */ - constexpr unsigned int RedirectCodes[] = { - 301, // Moved Permanently - 302, // Found - 303, // See Other - 307, // Temporary Redirect - 308, // Permanent Redirect - }; - if (AllowRedirect && std::find(std::begin(RedirectCodes), std::end(RedirectCodes), Req.Result) != std::end(RedirectCodes)) - { - if (Req.Location.empty() == true) - ; - else if (Req.Location[0] == '/' && Queue->Uri.empty() == false) - { - URI Uri(Queue->Uri); - if (Uri.Host.empty() == false) - NextURI = URI::SiteOnly(Uri); - else - NextURI.clear(); - NextURI.append(DeQuoteString(Req.Location)); - if (Queue->Uri == NextURI) - { - SetFailReason("RedirectionLoop"); - _error->Error("Redirection loop encountered"); - if (Req.HaveContent == true) - return ERROR_WITH_CONTENT_PAGE; - return ERROR_UNRECOVERABLE; - } - return TRY_AGAIN_OR_REDIRECT; - } - else - { - NextURI = DeQuoteString(Req.Location); - URI tmpURI(NextURI); - if (tmpURI.Access.find('+') != std::string::npos) - { - _error->Error("Server tried to trick us into using a specific implementation: %s", tmpURI.Access.c_str()); - if (Req.HaveContent == true) - return ERROR_WITH_CONTENT_PAGE; - return ERROR_UNRECOVERABLE; - } - URI Uri(Queue->Uri); - if (Binary.find('+') != std::string::npos) - { - auto base = Binary.substr(0, Binary.find('+')); - if (base != tmpURI.Access) - { - tmpURI.Access = base + '+' + tmpURI.Access; - if (tmpURI.Access == Binary) - { - std::swap(tmpURI.Access, Uri.Access); - NextURI = tmpURI; - std::swap(tmpURI.Access, Uri.Access); - } - else - NextURI = tmpURI; - } - } - if (Queue->Uri == NextURI) - { - SetFailReason("RedirectionLoop"); - _error->Error("Redirection loop encountered"); - if (Req.HaveContent == true) - return ERROR_WITH_CONTENT_PAGE; - return ERROR_UNRECOVERABLE; - } - Uri.Access = Binary; - // same protocol redirects are okay - if (tmpURI.Access == Uri.Access) - return TRY_AGAIN_OR_REDIRECT; - // as well as http to https - else if ((Uri.Access == "http" || Uri.Access == "https+http") && tmpURI.Access == "https") - return TRY_AGAIN_OR_REDIRECT; - else - { - auto const tmpplus = tmpURI.Access.find('+'); - if (tmpplus != std::string::npos && tmpURI.Access.substr(tmpplus + 1) == "https") - { - auto const uriplus = Uri.Access.find('+'); - if (uriplus == std::string::npos) - { - if (Uri.Access == tmpURI.Access.substr(0, tmpplus)) // foo -> foo+https - return TRY_AGAIN_OR_REDIRECT; - } - else if (Uri.Access.substr(uriplus + 1) == "http" && - Uri.Access.substr(0, uriplus) == tmpURI.Access.substr(0, tmpplus)) // foo+http -> foo+https - return TRY_AGAIN_OR_REDIRECT; - } - } - _error->Error("Redirection from %s to '%s' is forbidden", Uri.Access.c_str(), NextURI.c_str()); - } - /* else pass through for error message */ - } - // retry after an invalid range response without partial data - else if (Req.Result == 416) - { - struct stat SBuf; - if (stat(Queue->DestFile.c_str(),&SBuf) >= 0 && SBuf.st_size > 0) - { - bool partialHit = false; - if (Queue->ExpectedHashes.usable() == true) - { - Hashes resultHashes(Queue->ExpectedHashes); - FileFd file(Queue->DestFile, FileFd::ReadOnly); - Req.TotalFileSize = file.FileSize(); - Req.Date = file.ModificationTime(); - resultHashes.AddFD(file); - HashStringList const hashList = resultHashes.GetHashStringList(); - partialHit = (Queue->ExpectedHashes == hashList); - } - else if ((unsigned long long)SBuf.st_size == Req.TotalFileSize) - partialHit = true; - if (partialHit == true) - { - // the file is completely downloaded, but was not moved - if (Req.HaveContent == true) - { - // nuke the sent error page - Server->RunDataToDevNull(Req); - Req.HaveContent = false; - } - Req.StartPos = Req.TotalFileSize; - Req.Result = 200; - } - else if (RemoveFile("server", Queue->DestFile)) - { - NextURI = Queue->Uri; - return TRY_AGAIN_OR_REDIRECT; - } - } - } - - /* We have a reply we don't handle. This should indicate a perm server - failure */ - if (Req.Result < 200 || Req.Result >= 300) - { - if (_error->PendingError() == false) - { - std::string err; - strprintf(err, "HttpError%u", Req.Result); - SetFailReason(err); - _error->Error("%u %s", Req.Result, Req.Code); - } - if (Req.HaveContent == true) - return ERROR_WITH_CONTENT_PAGE; - return ERROR_UNRECOVERABLE; - } - - // This is some sort of 2xx 'data follows' reply - Res.LastModified = Req.Date; - Res.Size = Req.TotalFileSize; - return FILE_IS_OPEN; -} - /*}}}*/ -// BaseHttpMethod::SigTerm - Handle a fatal signal /*{{{*/ -// --------------------------------------------------------------------- -/* This closes and timestamps the open file. This is necessary to get - resume behavior on user abort */ -void BaseHttpMethod::SigTerm(int) -{ - if (FailFd == -1) - _exit(100); - - struct timeval times[2]; - times[0].tv_sec = FailTime; - times[1].tv_sec = FailTime; - times[0].tv_usec = times[1].tv_usec = 0; - utimes(FailFile.c_str(), times); - close(FailFd); - - _exit(100); -} - /*}}}*/ -// BaseHttpMethod::Fetch - Fetch an item /*{{{*/ -// --------------------------------------------------------------------- -/* This adds an item to the pipeline. We keep the pipeline at a fixed - depth. */ -bool BaseHttpMethod::Fetch(FetchItem *) -{ - if (Server == nullptr || QueueBack == nullptr) - return true; - - // If pipelining is disabled, we only queue 1 request - auto const AllowedDepth = Server->Pipeline ? PipelineDepth : 0; - // how deep is our pipeline currently? - decltype(PipelineDepth) CurrentDepth = 0; - for (FetchItem const *I = Queue; I != QueueBack; I = I->Next) - ++CurrentDepth; - if (CurrentDepth > AllowedDepth) - return true; - - do { - // Make sure we stick with the same server - if (Server->Comp(URI(QueueBack->Uri)) == false) - break; - - bool const UsableHashes = QueueBack->ExpectedHashes.usable(); - // if we have no hashes, do at most one such request - // as we can't fixup pipeling misbehaviors otherwise - if (CurrentDepth != 0 && UsableHashes == false) - break; - - if (UsableHashes && FileExists(QueueBack->DestFile)) - { - FileFd partial(QueueBack->DestFile, FileFd::ReadOnly); - Hashes wehave(QueueBack->ExpectedHashes); - if (QueueBack->ExpectedHashes.FileSize() == partial.FileSize()) - { - if (wehave.AddFD(partial) && - wehave.GetHashStringList() == QueueBack->ExpectedHashes) - { - FetchResult Res; - Res.Filename = QueueBack->DestFile; - Res.ResumePoint = QueueBack->ExpectedHashes.FileSize(); - URIStart(Res); - // move item to the start of the queue as URIDone will - // always dequeued the first item in the queue - if (Queue != QueueBack) - { - FetchItem *Prev = Queue; - for (; Prev->Next != QueueBack; Prev = Prev->Next) - /* look for the previous queue item */; - Prev->Next = QueueBack->Next; - QueueBack->Next = Queue; - Queue = QueueBack; - QueueBack = Prev->Next; - } - Res.TakeHashes(wehave); - URIDone(Res); - continue; - } - else - RemoveFile("Fetch-Partial", QueueBack->DestFile); - } - } - auto const Tmp = QueueBack; - QueueBack = QueueBack->Next; - SendReq(Tmp); - ++CurrentDepth; - } while (CurrentDepth <= AllowedDepth && QueueBack != nullptr); - - return true; -} - /*}}}*/ -// BaseHttpMethod::Loop - Main loop /*{{{*/ -int BaseHttpMethod::Loop() -{ - signal(SIGTERM,SigTerm); - signal(SIGINT,SigTerm); - - Server = 0; - - int FailCounter = 0; - while (1) - { - // We have no commands, wait for some to arrive - if (Queue == 0) - { - if (WaitFd(STDIN_FILENO) == false) - return 0; - } - - /* Run messages, we can accept 0 (no message) if we didn't - do a WaitFd above.. Otherwise the FD is closed. */ - int Result = Run(true); - if (Result != -1 && (Result != 0 || Queue == 0)) - { - if(FailReason.empty() == false || - ConfigFindB("DependOnSTDIN", true) == true) - return 100; - else - return 0; - } - - if (Queue == 0) - continue; - - // Connect to the server - if (Server == 0 || Server->Comp(URI(Queue->Uri)) == false) - { - if (!Queue->Proxy().empty()) - { - URI uri(Queue->Uri); - _config->Set("Acquire::" + uri.Access + "::proxy::" + uri.Host, Queue->Proxy()); - } - Server = CreateServerState(URI(Queue->Uri)); - setPostfixForMethodNames(::URI(Queue->Uri).Host.c_str()); - AllowRedirect = ConfigFindB("AllowRedirect", true); - PipelineDepth = ConfigFindI("Pipeline-Depth", 10); - Debug = DebugEnabled(); - } - - /* If the server has explicitly said this is the last connection - then we pre-emptively shut down the pipeline and tear down - the connection. This will speed up HTTP/1.0 servers a tad - since we don't have to wait for the close sequence to - complete */ - if (Server->Persistent == false) - Server->Close(); - - // Reset the pipeline - if (Server->IsOpen() == false) { - QueueBack = Queue; - Server->PipelineAnswersReceived = 0; - } - - // Connect to the host - switch (Server->Open()) - { - case ResultState::FATAL_ERROR: - Fail(false); - Server = nullptr; - continue; - case ResultState::TRANSIENT_ERROR: - Fail(true); - Server = nullptr; - continue; - case ResultState::SUCCESSFUL: - break; - } - - // Fill the pipeline. - Fetch(0); - - RequestState Req(this, Server.get()); - // Fetch the next URL header data from the server. - switch (Server->RunHeaders(Req, Queue->Uri)) - { - case ServerState::RUN_HEADERS_OK: - break; - - // The header data is bad - case ServerState::RUN_HEADERS_PARSE_ERROR: - { - _error->Error(_("Bad header data")); - Fail(true); - Server->Close(); - RotateDNS(); - continue; - } - - // The server closed a connection during the header get.. - default: - case ServerState::RUN_HEADERS_IO_ERROR: - { - FailCounter++; - _error->Discard(); - Server->Close(); - Server->Pipeline = false; - Server->PipelineAllowed = false; - - if (FailCounter >= 2) - { - Fail(_("Connection failed"),true); - FailCounter = 0; - } - - RotateDNS(); - continue; - } - }; - - // Decide what to do. - FetchResult Res; - Res.Filename = Queue->DestFile; - switch (DealWithHeaders(Res, Req)) - { - // Ok, the file is Open - case FILE_IS_OPEN: - { - URIStart(Res); - - // Run the data - ResultState Result = ResultState::SUCCESSFUL; - - // ensure we don't fetch too much - // we could do "Server->MaximumSize = Queue->MaximumSize" here - // but that would break the clever pipeline messup detection - // so instead we use the size of the biggest item in the queue - Req.MaximumSize = FindMaximumObjectSizeInQueue(); - - if (Req.HaveContent) - { - /* If the server provides Content-Length we can figure out with it if - this satisfies any request we have made so far (in the pipeline). - If not we can kill the connection as whatever file the server is trying - to send to us would be rejected with a hashsum mismatch later or triggers - a maximum size error. We don't run the data to /dev/null as this can be MBs - of junk data we would waste bandwidth on and instead just close the connection - to reopen a fresh one which should be more cost/time efficient */ - if (Req.DownloadSize > 0) - { - decltype(Queue->ExpectedHashes.FileSize()) const filesize = Req.StartPos + Req.DownloadSize; - bool found = false; - for (FetchItem const *I = Queue; I != 0 && I != QueueBack; I = I->Next) - { - auto const fs = I->ExpectedHashes.FileSize(); - if (fs == 0 || fs == filesize) - { - found = true; - break; - } - } - if (found == false) - { - SetFailReason("MaximumSizeExceeded"); - _error->Error(_("File has unexpected size (%llu != %llu). Mirror sync in progress?"), - filesize, Queue->ExpectedHashes.FileSize()); - Result = ResultState::FATAL_ERROR; - } - } - if (Result == ResultState::SUCCESSFUL) - Result = Server->RunData(Req); - } - - /* If the server is sending back sizeless responses then fill in - the size now */ - if (Res.Size == 0) - Res.Size = Req.File.Size(); - - // Close the file, destroy the FD object and timestamp it - FailFd = -1; - Req.File.Close(); - - // Timestamp - struct timeval times[2]; - times[0].tv_sec = times[1].tv_sec = Req.Date; - times[0].tv_usec = times[1].tv_usec = 0; - utimes(Queue->DestFile.c_str(), times); - - // Send status to APT - if (Result == ResultState::SUCCESSFUL) - { - Hashes * const resultHashes = Server->GetHashes(); - HashStringList const hashList = resultHashes->GetHashStringList(); - if (PipelineDepth != 0 && Queue->ExpectedHashes.usable() == true && Queue->ExpectedHashes != hashList) - { - // we did not get the expected hash… mhhh: - // could it be that server/proxy messed up pipelining? - FetchItem * BeforeI = Queue; - for (FetchItem *I = Queue->Next; I != 0 && I != QueueBack; I = I->Next) - { - if (I->ExpectedHashes.usable() == true && I->ExpectedHashes == hashList) - { - // yes, he did! Disable pipelining and rewrite queue - if (Server->Pipeline == true) - { - Warning(_("Automatically disabled %s due to incorrect response from server/proxy. (man 5 apt.conf)"), "Acquire::http::Pipeline-Depth"); - Server->Pipeline = false; - Server->PipelineAllowed = false; - // we keep the PipelineDepth value so that the rest of the queue can be fixed up as well - } - Rename(Res.Filename, I->DestFile); - Res.Filename = I->DestFile; - BeforeI->Next = I->Next; - I->Next = Queue; - Queue = I; - break; - } - BeforeI = I; - } - } - if (Server->Pipeline == true) - { - Server->PipelineAnswersReceived++; - } - Res.TakeHashes(*resultHashes); - URIDone(Res); - } - else - { - if (Server->IsOpen() == false) - { - FailCounter++; - _error->Discard(); - Server->Close(); - - if (FailCounter >= 2) - { - Fail(_("Connection failed"),true); - FailCounter = 0; - } - - QueueBack = Queue; - } - else - { - Server->Close(); - switch (Result) - { - case ResultState::TRANSIENT_ERROR: - Fail(true); - break; - case ResultState::FATAL_ERROR: - case ResultState::SUCCESSFUL: - Fail(false); - break; - } - } - } - break; - } - - // IMS hit - case IMS_HIT: - { - URIDone(Res); - break; - } - - // Hard server error, not found or something - case ERROR_UNRECOVERABLE: - { - Fail(); - break; - } - - // Hard internal error, kill the connection and fail - case ERROR_NOT_FROM_SERVER: - { - Fail(); - RotateDNS(); - Server->Close(); - break; - } - - // We need to flush the data, the header is like a 404 w/ error text - case ERROR_WITH_CONTENT_PAGE: - { - Server->RunDataToDevNull(Req); - constexpr unsigned int TransientCodes[] = { - 408, // Request Timeout - 429, // Too Many Requests - 500, // Internal Server Error - 502, // Bad Gateway - 503, // Service Unavailable - 504, // Gateway Timeout - 599, // Network Connect Timeout Error - }; - if (std::find(std::begin(TransientCodes), std::end(TransientCodes), Req.Result) != std::end(TransientCodes)) - Fail(true); - else - Fail(); - break; - } - - // Try again with a new URL - case TRY_AGAIN_OR_REDIRECT: - { - // Clear rest of response if there is content - if (Req.HaveContent) - Server->RunDataToDevNull(Req); - Redirect(NextURI); - break; - } - - default: - Fail(_("Internal error")); - break; - } - - FailCounter = 0; - } - - return 0; -} - /*}}}*/ -unsigned long long BaseHttpMethod::FindMaximumObjectSizeInQueue() const /*{{{*/ -{ - unsigned long long MaxSizeInQueue = 0; - for (FetchItem *I = Queue; I != 0 && I != QueueBack; I = I->Next) - MaxSizeInQueue = std::max(MaxSizeInQueue, I->MaximumSize); - return MaxSizeInQueue; -} - /*}}}*/ -BaseHttpMethod::BaseHttpMethod(std::string &&Binary, char const *const Ver, unsigned long const Flags) /*{{{*/ - : aptAuthConfMethod(std::move(Binary), Ver, Flags), Server(nullptr), - AllowRedirect(false), Debug(false), PipelineDepth(10) -{ -} - /*}}}*/ -bool BaseHttpMethod::Configuration(std::string Message) /*{{{*/ -{ - if (aptAuthConfMethod::Configuration(Message) == false) - return false; - - _config->CndSet("Acquire::tor::Proxy", - "socks5h://apt-transport-tor@127.0.0.1:9050"); - return true; -} - /*}}}*/ -bool BaseHttpMethod::AddProxyAuth(URI &Proxy, URI const &Server) /*{{{*/ -{ - MaybeAddAuthTo(Proxy); - if (std::find(methodNames.begin(), methodNames.end(), "tor") != methodNames.end() && - Proxy.User == "apt-transport-tor" && Proxy.Password.empty()) - { - std::string pass = Server.Host; - pass.erase(std::remove_if(pass.begin(), pass.end(), [](char const c) { return std::isalnum(c) == 0; }), pass.end()); - if (pass.length() > 255) - Proxy.Password = pass.substr(0, 255); - else - Proxy.Password = std::move(pass); - } - return true; -} - /*}}}*/ diff --git a/methods/http.cc b/methods/http.cc index 71aa56751f82df0ff9f434fbeb8fbcfe17d7d86e..1d2c41337bae672acc5c47c5f7e65ed5b71644fb 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> @@ -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); @@ -979,15 +980,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 8b1b209aa142f00b10baf48f3a4a325cafc5041f..395e52cee1c9ec396af148433539ea7836e36b6a 100644 --- a/po/apt-all.pot +++ b/po/apt-all.pot @@ -5,9 +5,9 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: apt 2.1.1\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-08 18:03+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" @@ -491,11 +491,6 @@ msgstr "" 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 diff --git a/po/ar.po b/po/ar.po index 2be2e54b08cbb956f85b7d4232144223602ddc01..5bd17b77b8d85e3ea7b4d6c50391557f78d7cb02 100644 --- a/po/ar.po +++ b/po/ar.po @@ -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" @@ -501,11 +501,6 @@ msgstr "توقيع الأرشيف غير صالح" 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 طويل جداً" diff --git a/po/ast.po b/po/ast.po index 551ad7b26b60ab291a4accb09c6aef17976917a5..ec6fe1940b8227a0ae02b7d96713ad553038da8f 100644 --- a/po/ast.po +++ b/po/ast.po @@ -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" @@ -514,11 +514,6 @@ msgstr "Robla del ficheru inválida" 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" diff --git a/po/bg.po b/po/bg.po index ee08ae45bc5cacf80da0fff7ab7880b964f5d7ee..b230bd70a02cb8e436dda67eef8f1f7275346043 100644 --- a/po/bg.po +++ b/po/bg.po @@ -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" @@ -531,11 +531,6 @@ msgstr "Невалиден подпис на архива" 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 е твърде дълъг" diff --git a/po/bs.po b/po/bs.po index 553aa473e1ab063cad9ccc1fddd68fb2cc5cc7b5..2830d0c634d7cc1fc4c802b9880ba7b2732879b0 100644 --- a/po/bs.po +++ b/po/bs.po @@ -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" @@ -496,11 +496,6 @@ msgstr "" 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 diff --git a/po/ca.po b/po/ca.po index 9bbe0b62bdbec200f9ae836610607c664af0c24c..e2b08c70d420dbfab3e54df8c5817b593e01905a 100644 --- a/po/ca.po +++ b/po/ca.po @@ -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" @@ -564,11 +564,6 @@ msgstr "Signatura de l'arxiu no vàlida" 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" diff --git a/po/cs.po b/po/cs.po index 443ebe2efcf83218dbd95f91fdfe7776521d9049..bf89e12a439f480d71f07a333bb4b01428a0c655 100644 --- a/po/cs.po +++ b/po/cs.po @@ -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" @@ -540,11 +540,6 @@ msgstr "Neplatný podpis archivu" 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á" diff --git a/po/cy.po b/po/cy.po index ee8f5cdf376ada0ebf3148e7038c1cb6b0c1d8a6..181482d033e6b7c1f67c9e98b27015f87c58cd1f 100644 --- a/po/cy.po +++ b/po/cy.po @@ -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" @@ -509,11 +509,6 @@ msgstr "Llofnod archif annilys" 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" diff --git a/po/da.po b/po/da.po index d207593ad736b0dfb8b51b2617a50808378b742b..c34248cbda62b1cc202dd35c7d5d24bd79ca2d93 100644 --- a/po/da.po +++ b/po/da.po @@ -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" @@ -550,11 +550,6 @@ msgstr "Ugyldig arkivsignatur" 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" diff --git a/po/de.po b/po/de.po index e7a69b36035d39bfb5fb08c69ede027498d89fff..6ee3c3e49c838dcb368d7fb4e48c515604a87d76 100644 --- a/po/de.po +++ b/po/de.po @@ -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" @@ -573,11 +573,6 @@ msgstr "Ungültige Archiv-Signatur" 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." diff --git a/po/dz.po b/po/dz.po index 6f6c0fa723b7b58805adf9830de0fb890227a169..d3975f07a9c1e5d8b8b53be5922847a5bc806626 100644 --- a/po/dz.po +++ b/po/dz.po @@ -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" @@ -504,11 +504,6 @@ msgstr "ནུས་མེད་ཡིག་མཛོད་ཀྱི་མིང 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་འགྲུལ་ལམ་དེ་གནམ་མེད་ས་མེད་རིངམ་འདུག" diff --git a/po/el.po b/po/el.po index 6984912944d29b1708e7692449804d758d1f413e..b5fc40c97e52788e9bacb9c2733c3fd2d1142769 100644 --- a/po/el.po +++ b/po/el.po @@ -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" @@ -518,11 +518,6 @@ msgstr "Μη έγκυρη υπογραφή αρχειοθήκης" 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 έχει υπερβολικό μήκος" diff --git a/po/es.po b/po/es.po index 64c57a8de844c6818fcd97bfdf4be75d9459c8c7..b4ea163dab58c5abcda99ff2c411cced165fa10c 100644 --- a/po/es.po +++ b/po/es.po @@ -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" @@ -621,11 +621,6 @@ msgstr "Firma del archivo inválida" 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" diff --git a/po/eu.po b/po/eu.po index 64c31682d8d9d48ad30524081afd46e83a1e76a6..5e67d30120b5b2a75b29bfc09d7dcf23da0f2a71 100644 --- a/po/eu.po +++ b/po/eu.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: 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" @@ -504,11 +504,6 @@ msgstr "Artxibo sinadura baliogabea" 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" diff --git a/po/fi.po b/po/fi.po index 9ea04f89061c46415cd6f3cc2ae64185ddf99187..8564da7065607d99cb1addbd97657ee178d5fd5d 100644 --- a/po/fi.po +++ b/po/fi.po @@ -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" @@ -504,11 +504,6 @@ msgstr "Arkiston tarkistussumma on virheellinen" 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ä" diff --git a/po/fr.po b/po/fr.po index 494ffc2059c811b1a438f23d5f02065ef9f19f94..9ed7646b4f79a2e2848fb453eb491544308ba185 100644 --- a/po/fr.po +++ b/po/fr.po @@ -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" @@ -567,11 +567,6 @@ msgstr "Signature d'archive non valable" 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" diff --git a/po/gl.po b/po/gl.po index 062da22f33e7ce2867945975d40dd581d32548ce..456b5416881a70f87e38d8e99ae8c826c584ad84 100644 --- a/po/gl.po +++ b/po/gl.po @@ -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" @@ -526,11 +526,6 @@ msgstr "Sinatura de arquivo incorrecta" 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" diff --git a/po/hu.po b/po/hu.po index 8d1635687e0d13b18dd9af2137685fe1050b0263..15ac9238db1eec2686cf27ecc1dc85dce3033fb9 100644 --- a/po/hu.po +++ b/po/hu.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: 2016-04-10 19:46+0200\n" "Last-Translator: Gabor Kelemen <kelemeng@ubuntu.com>\n" "Language-Team: Hungarian <gnome-hu-list@gnome.org>\n" @@ -555,11 +555,6 @@ msgstr "Érvénytelen archívum-aláírás" 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ú" diff --git a/po/it.po b/po/it.po index f40f82fc2c5526331850ddc61f1784a3d58ba2db..09c7d8943e6b4e053edc472851248bc87aa2fbc0 100644 --- a/po/it.po +++ b/po/it.po @@ -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" @@ -561,11 +561,6 @@ msgstr "Firma dell'archivio non valida" 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" diff --git a/po/ja.po b/po/ja.po index de3402dbc6ddb7b964ef547f027fc9a68334826f..ad828d51a231809e8e0bf3c8510f6d85840bf000 100644 --- a/po/ja.po +++ b/po/ja.po @@ -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" @@ -557,11 +557,6 @@ msgstr "不正なアーカイブ署名" 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 は長すぎます" diff --git a/po/km.po b/po/km.po index d250d5189f8b98f7864a7d63936dd98668e8ea67..984fd2f3f3e8794498a16286295286a306d0ade5 100644 --- a/po/km.po +++ b/po/km.po @@ -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" @@ -506,11 +506,6 @@ msgstr "ហត្ថលេខា​ប័ណ្ណសា​រមិន​ត្ 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 វែង​ពេក" diff --git a/po/ko.po b/po/ko.po index 09078252ce4d4fb56b574feb28f1c5ca03d75951..db36b606617f6838d7704a3fc73e0e5fcb639755 100644 --- a/po/ko.po +++ b/po/ko.po @@ -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" @@ -506,11 +506,6 @@ msgstr "아카이브 서명이 틀렸습니다" 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이(가) 너무 깁니다" diff --git a/po/ku.po b/po/ku.po index fe27135d322c9b74a78443699c5a8ecb603e7c4c..754fde815d677504950f784e891c4f0b77170cea 100644 --- a/po/ku.po +++ b/po/ku.po @@ -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" @@ -495,11 +495,6 @@ msgstr "" 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 diff --git a/po/lt.po b/po/lt.po index 4cd685f0155d8efc5c0d4cdd19fca5c637668c36..aac0e54c2d23ad3c53f48c3102421d3c9127b256 100644 --- a/po/lt.po +++ b/po/lt.po @@ -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" @@ -501,11 +501,6 @@ msgstr "" 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 diff --git a/po/mr.po b/po/mr.po index a9241d045f4b1cf9745b732b774471fa41e393ae..13e0eecd098b3eaa2971315100e4f06277725f2f 100644 --- a/po/mr.po +++ b/po/mr.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-20 23:27+0530\n" "Last-Translator: Sampada <sampadanakhare@gmail.com>\n" "Language-Team: Marathi, janabhaaratii, C-DAC, Mumbai, India " @@ -504,11 +504,6 @@ msgstr "अयोग्य अर्काईव्ह ओळख सही" 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 हा खूप लांब आहे" diff --git a/po/nb.po b/po/nb.po index 761b4bba644cb119976e98d072623b12ddc346bc..6c438cc4b6230c106eae7ff23192696fbb14d496 100644 --- a/po/nb.po +++ b/po/nb.po @@ -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" @@ -530,11 +530,6 @@ msgstr "Ugyldig arkivsignatur" 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" diff --git a/po/ne.po b/po/ne.po index 33f34e3c4079f504bfcd29affe8ccbaa0d4a7915..fd37ff259cabac08e0f1163357e56e13b10d1ba3 100644 --- a/po/ne.po +++ b/po/ne.po @@ -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" @@ -502,11 +502,6 @@ msgstr "अवैध संग्रह हस्ताक्षर" 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 अति लामो छ " diff --git a/po/nl.po b/po/nl.po index 7fb0610f7d049686d573349167e8d8d53b8776b1..a5a2d7f1d6d73f4dec42c935d4fe9a75762b34a8 100644 --- a/po/nl.po +++ b/po/nl.po @@ -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" diff --git a/po/nn.po b/po/nn.po index a05cfab9fad653bc9fc0b57e90e713906a688702..52b184f5a5bd9551fee3ab677436d235cb5f18b8 100644 --- a/po/nn.po +++ b/po/nn.po @@ -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" @@ -509,11 +509,6 @@ msgstr "Ugyldig arkivsignatur" 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" diff --git a/po/pl.po b/po/pl.po index 8bbbd1ca6b68fd6b0919f1a70cbf5900057f154a..061b79ac83083554f2281be31a1c8ec8b3ee74b1 100644 --- a/po/pl.po +++ b/po/pl.po @@ -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" @@ -533,11 +533,6 @@ msgstr "Nieprawidłowy podpis archiwum" 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 @@ -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" diff --git a/po/pt.po b/po/pt.po index 726ef2fd9e2d808432a8d927cf21fd9fa68553a1..b91f6584854ff06aacf4cb6b11d005f6146c8dbe 100644 --- a/po/pt.po +++ b/po/pt.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: 2012-06-29 15:45+0100\n" "Last-Translator: Miguel Figueiredo <elmig@debianpt.org>\n" "Language-Team: Portuguese <traduz@debianpt.org>\n" @@ -532,11 +532,6 @@ msgstr "Assinatura de arquivo inválida" 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 8a3a35100636ff66a64206655634c71537d1a692..c8c43278b64eb7dd0a6132dd65367f4cb0635288 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." @@ -509,11 +509,6 @@ msgstr "Assinatura de arquivo inválida" 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" diff --git a/po/ro.po b/po/ro.po index 200d6b99b9f6f110fd356e3fb9eaadc7fac820e4..db2adc32c3baa2f69b1da5dbb121f2a36affc351 100644 --- a/po/ro.po +++ b/po/ro.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-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" @@ -510,11 +510,6 @@ msgstr "Semnătură de arhivă necorespunzătoare" 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ă" diff --git a/po/ru.po b/po/ru.po index 6205117f964a06321704d5c7e4c0db07b7ff579c..1f03ffc5533522ba086b07e2e92bab099125da88 100644 --- a/po/ru.po +++ b/po/ru.po @@ -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" @@ -562,11 +562,6 @@ msgstr "Неверная сигнатура архива" 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" diff --git a/po/sk.po b/po/sk.po index cb6337880997f359e0aa09ca5acde59ff4b1c4a0..d03b3cfce92a1e20ef91a064671d648aaf5693ab 100644 --- a/po/sk.po +++ b/po/sk.po @@ -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" @@ -523,11 +523,6 @@ msgstr "Neplatný podpis archívu" 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á" diff --git a/po/sl.po b/po/sl.po index 9fa48fdc26ef028cc9c74fe71e20713208ae850d..b442d4671975ec0424b8d24001b1112a9e3e0ca5 100644 --- a/po/sl.po +++ b/po/sl.po @@ -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" @@ -520,11 +520,6 @@ msgstr "Neveljaven podpis arhiva" 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" diff --git a/po/sv.po b/po/sv.po index 4f551554563d0e0d46531c8a0f5b63c540e4b8f6..29c639997e54ed32ce37a68e03de1355979bf6d3 100644 --- a/po/sv.po +++ b/po/sv.po @@ -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" @@ -535,11 +535,6 @@ msgstr "Ogiltig arkivsignatur" 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" diff --git a/po/th.po b/po/th.po index e5f8ff45c74b616605c888905d2e6bb327a6a3f3..b8a98cebb9bcb2973664e1e7fdef077f1635b7fa 100644 --- a/po/th.po +++ b/po/th.po @@ -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" @@ -512,11 +512,6 @@ msgstr "เอกลักษณ์ของแฟ้มจัดเก็บไ 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 ยาวเกินไป" diff --git a/po/tl.po b/po/tl.po index 61d44bea9a5046f38a611e99758b8404fe48fb08..4d8866d18334dd8435cb6a3127e0730570aee873 100644 --- a/po/tl.po +++ b/po/tl.po @@ -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" @@ -513,11 +513,6 @@ msgstr "Hindi tanggap na signature ng arkibo" 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" diff --git a/po/tr.po b/po/tr.po index 920a1df9f16801162f9c86e9ed99afaeee22e99b..b720e4b7f08d0d581235613a8438241195509931 100644 --- a/po/tr.po +++ b/po/tr.po @@ -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" @@ -552,11 +552,6 @@ msgstr "Geçersiz arşiv imzası" 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" diff --git a/po/uk.po b/po/uk.po index 99f4a68c6ee1399162a2a9ec3750f3687f4b69fa..a3ba2eb05495798eaef86099a2e2be240ffeab4b 100644 --- a/po/uk.po +++ b/po/uk.po @@ -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" @@ -528,11 +528,6 @@ msgstr "Невірний підпис архіву" 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" @@ -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 занадто довгий" diff --git a/po/vi.po b/po/vi.po index 474d67acc76d04b4598d655612f92a5ac91d1269..8a2dba72331cc7911644a3ab75fb4d81d4f09b7d 100644 --- a/po/vi.po +++ b/po/vi.po @@ -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" @@ -525,11 +525,6 @@ msgstr "Chữ ký kho không hợp lệ" 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 c13c99ca18601fdf97857798deb333fd0d9dbc94..f8f51062253f97d4adeec9d7fd9264058fd6232d 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" @@ -521,11 +521,6 @@ msgstr "无效的归档签名" 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 896716ca128364e1332c5f52a104ae5c43561890..4a8128058a792490f9e8500c452a9bba7cb3aa2b 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." @@ -503,11 +503,6 @@ msgstr "無效的套件庫簽章" 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 44dedb10bd4e45551c1b98831a3c407052dfaeba..e30fa066ca7752dbed4e1dbdd59935f2d4b86b05 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 fab67c4e9ff22eeae82ed325d7546f29b711f554..90ce58a3316f32cef4c84dbc3c24463d667a70bb 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 6009ca0d22c042ebb5cfbb0d4c3a2ea258d2fbbb..aaeac09a8d594ba44d1a3f949fe4b0fe3c8a3013 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 230683a99d17550b39ed8785cf24eb8ec5cc58d7..1e144f1ee6878a4da9a785231428bd48ffe7ba08 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 9dbd17bfddd0b0fafffd45e15e2a0fb057f0f05f..b836451fd3b873c7fa5003703cf8be5889c9cfa7 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 0000000000000000000000000000000000000000..ad1501b6617f890839ccf98c98f9b2ba3b6eeb09 --- /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 0000000000000000000000000000000000000000..ca6bf8d7cf89aa41fa849bc6853e874c839e6e4f --- /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 0000000000000000000000000000000000000000..89c18ba857d77d36498acdde8521a43793dd3cf5 --- /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 0000000000000000000000000000000000000000..8d800ffb796d2f3c932c00e40c82389b98b55416 --- /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 0000000000000000000000000000000000000000..3d0994d892067ff9d96e088ffdd08428694420e5 --- /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 763852fa54f909c2f351e2a87a7801b815132774..ba3376cf639c11c4bc615d56294931a471ef99b3 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' @@ -69,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: @@ -77,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... @@ -112,14 +114,31 @@ Would download/install/remove packages.' testsuccesstailequal 3 "$OKAYAPTITUDE" aptitude install foo-r-conflict -sy fi -testfailure apt install bad-upgrade-level1 -s -testfailure apt install bad-conflict-level2 -s +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 2 not upgraded. +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… diff --git a/test/integration/test-external-dependency-solver-protocol b/test/integration/test-external-dependency-solver-protocol index 2c451d5f95abf234a6f108b274d300f853f25939..0091263b74ccecc7c0d29645a5dde7211c4780bb 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 0000000000000000000000000000000000000000..1e095eef39dce3ef9a22937c8613b49adc819668 --- /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 b748539933f6e44804f63a6672d0d9727f99a42b..a091635f02363013cb3bf2d2ad6dab08256b087f 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 85b3d0ee164872cbfa72be7f66ad0216d54eceaf..4606408fc21fbf2cd83d31738a25d93579ca0755 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 0000000000000000000000000000000000000000..d8dfd7c9a1c36e130b6959c65358224bcca19bbb --- /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 0000000000000000000000000000000000000000..3f5310fa6383445704af9fd718cb6c981c11f1fb --- /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 04d54e9bed947d2f0d5a193f44e265353afa6b3b..f703351cc067b6ea0063b776c93d042ec66e17fd 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 b21492cb77daf126628bb335e286cd4493975f63..e2ec05ab825805964b380bc6c675a259bf16d92a 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 8d6c404b3bdf2c82ac040415f2b0527ebeee3d06..4d297a9f2deea6c6fd945087b940dc678997f9e0 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 67e0461c21d0877e38740e78a8567c5cdd944f58..ae74341e60b27d3646196dc701f43fff51006383 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 aa16a2e30ce95624841e2cf83fd69d91fa271923..85fc6838ea4c6b0a19a112f1acdd3b6e03a82d63 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 f639c1cbcb3a76441850583a9ccdd671231775ff..4ce0fb2a3e1b9036183ee688c65fc3c3e44ae1e7 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 788ab76b2be315ea633ef5dab458c20ce8cec61f..ecab2eb507ce8dc6d40dea0662ee1189ee844266 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 a8a82682192f5f40df33444dd4abc887fac0fb1a..2d8079e5ad22ef3daebc8001f424bc5c80b25da1 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 0a4d4438a6383c4d7523039ecc2b8bbf2b057b61..4db89679a6a31a31b79923b3aa6eabf4478ffccb 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 9441f56be5457b86088a777e93610b128b12794a..42fab65a9ce2d5789da6eff061b117be19b4ca6c 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 5cb6cb9ff324b53691844b40818c5d273bb9b417..b7132c35f5bd02b50e16e89be9da5f24af9d0b93 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 919b46cdbdf5d82bde35f28b09853232b4a550df..06ea01c32d3e43afbbe51632bcca42e8ba1b0242 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 3f170b25abe82efda33be843d42b36cbcfdd31e6..80cecca5ba7b7cfc0199d1b3fc814c5d21f002d4 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) {