diff options
-rw-r--r-- | CMakeLists.txt | 2 | ||||
-rw-r--r-- | apt-pkg/deb/debmetaindex.cc | 2 | ||||
-rw-r--r-- | apt-pkg/solver3.cc | 48 | ||||
-rw-r--r-- | apt-pkg/solver3.h | 5 | ||||
-rw-r--r-- | doc/apt-verbatim.ent | 2 | ||||
-rw-r--r-- | doc/po/apt-doc.pot | 4 | ||||
-rw-r--r-- | po/apt-all.pot | 4 | ||||
-rw-r--r-- | po/ca.po | 147 | ||||
-rwxr-xr-x | test/integration/test-signed-by-option | 48 | ||||
-rwxr-xr-x | test/integration/test-solver3-obsoleted-by | 87 |
10 files changed, 257 insertions, 92 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 12a4ab2..06e3fc9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -206,7 +206,7 @@ endif() # Configure some variables like package, version and architecture. set(PACKAGE ${PROJECT_NAME}) set(PACKAGE_MAIL "APT Development Team <deity@lists.debian.org>") -set(PACKAGE_VERSION "2.9.7") +set(PACKAGE_VERSION "2.9.8") string(REGEX MATCH "^[0-9.]+" PROJECT_VERSION ${PACKAGE_VERSION}) if (NOT DEFINED DPKG_DATADIR) diff --git a/apt-pkg/deb/debmetaindex.cc b/apt-pkg/deb/debmetaindex.cc index 5158931..266313b 100644 --- a/apt-pkg/deb/debmetaindex.cc +++ b/apt-pkg/deb/debmetaindex.cc @@ -817,6 +817,8 @@ bool debReleaseIndex::SetSignedBy(std::string const &pSignedBy) else { auto const normalSignedBy = NormalizeSignedBy(pSignedBy, true); + if (normalSignedBy.empty() == true) + return true; if (normalSignedBy != SignedBy) return _error->Error(_("Conflicting values set for option %s regarding source %s %s: %s != %s"), "Signed-By", URI.c_str(), Dist.c_str(), SignedBy.c_str(), normalSignedBy.c_str()); } diff --git a/apt-pkg/solver3.cc b/apt-pkg/solver3.cc index 0aec1ec..2ba6f60 100644 --- a/apt-pkg/solver3.cc +++ b/apt-pkg/solver3.cc @@ -247,8 +247,39 @@ std::string APT::Solver::WhyStr(Reason reason) return outstr; } -bool APT::Solver::Obsolete(pkgCache::PkgIterator pkg) +// This is essentially asking whether any other binary in the source package has a higher candidate +// version. This pretends that each package is installed at the same source version as the package +// under consideration. +bool APT::Solver::ObsoletedByNewerSourceVersion(pkgCache::VerIterator cand) const { + const auto pkg = cand.ParentPkg(); + const int candPriority = policy.GetPriority(cand); + + for (auto ver = cand.Cache()->FindGrp(cand.SourcePkgName()).VersionsInSource(); not ver.end(); ver = ver.NextInSource()) + { + // We are only interested in other packages in the same source package; built for the same architecture. + if (ver->ParentPkg == cand->ParentPkg || ver.ParentPkg()->Arch != cand.ParentPkg()->Arch || cache.VS->CmpVersion(ver.SourceVerStr(), cand.SourceVerStr()) <= 0) + continue; + + // We also take equal priority here, given that we have a higher version + const int priority = policy.GetPriority(ver, true); + if (priority == 0 || priority < candPriority) + continue; + + pkgObsolete[pkg->ID] = 2; + if (debug >= 3) + std::cerr << "Obsolete: " << cand.ParentPkg().FullName() << "=" << cand.VerStr() << " due to " << ver.ParentPkg().FullName() << "=" << ver.VerStr() << "\n"; + return true; + } + + return false; +} + +bool APT::Solver::Obsolete(pkgCache::PkgIterator pkg) const +{ + if (pkgObsolete[pkg->ID] != 0) + return pkgObsolete[pkg->ID] == 2; + auto ver = policy.GetCandidateVer(pkg); if (ver.end() && not StrictPinning) @@ -256,18 +287,13 @@ bool APT::Solver::Obsolete(pkgCache::PkgIterator pkg) if (ver.end()) { std::cerr << "Obsolete: " << pkg.FullName() << " - not installable\n"; + pkgObsolete[pkg->ID] = 2; return true; } - if (pkgObsolete[pkg->ID] != 0) - return pkgObsolete[pkg->ID] == 2; - for (auto bin = ver.Cache()->FindGrp(ver.SourcePkgName()).VersionsInSource(); not bin.end(); bin = bin.NextInSource()) - if (bin != ver && bin.ParentPkg()->Arch == ver.ParentPkg()->Arch && bin->ParentPkg != ver->ParentPkg && (not StrictPinning || policy.GetCandidateVer(bin.ParentPkg()) == bin) && _system->VS->CmpVersion(bin.SourceVerStr(), ver.SourceVerStr()) > 0) - { - pkgObsolete[pkg->ID] = 2; - if (debug >= 3) - std::cerr << "Obsolete: " << ver.ParentPkg().FullName() << "=" << ver.VerStr() << " due to " << bin.ParentPkg().FullName() << "=" << bin.VerStr() << "\n"; - return true; - } + + if (ObsoletedByNewerSourceVersion(ver)) + return true; + for (auto file = ver.FileList(); !file.end(); file++) if ((file.File()->Flags & pkgCache::Flag::NotSource) == 0) { diff --git a/apt-pkg/solver3.h b/apt-pkg/solver3.h index 96faaa6..33067a0 100644 --- a/apt-pkg/solver3.h +++ b/apt-pkg/solver3.h @@ -104,8 +104,9 @@ class Solver return verStates[V->ID]; } - std::vector<char> pkgObsolete; - bool Obsolete(pkgCache::PkgIterator pkg); + mutable std::vector<char> pkgObsolete; + bool Obsolete(pkgCache::PkgIterator pkg) const; + bool ObsoletedByNewerSourceVersion(pkgCache::VerIterator cand) const; // \brief Heap of the remaining work. // diff --git a/doc/apt-verbatim.ent b/doc/apt-verbatim.ent index f415a0e..9698e55 100644 --- a/doc/apt-verbatim.ent +++ b/doc/apt-verbatim.ent @@ -274,7 +274,7 @@ "> <!-- this will be updated by 'prepare-release' --> -<!ENTITY apt-product-version "2.9.7"> +<!ENTITY apt-product-version "2.9.8"> <!-- (Code)names for various things used all over the place --> <!ENTITY debian-oldstable-codename "bullseye"> diff --git a/doc/po/apt-doc.pot b/doc/po/apt-doc.pot index 4779a0d..6d97a73 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.9.7\n" +"Project-Id-Version: apt-doc 2.9.8\n" "Report-Msgid-Bugs-To: APT Development Team <deity@lists.debian.org>\n" -"POT-Creation-Date: 2024-07-30 04:29+0000\n" +"POT-Creation-Date: 2024-08-12 14:14+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" diff --git a/po/apt-all.pot b/po/apt-all.pot index 7259cd4..6b199d2 100644 --- a/po/apt-all.pot +++ b/po/apt-all.pot @@ -5,9 +5,9 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: apt 2.9.7\n" +"Project-Id-Version: apt 2.9.8\n" "Report-Msgid-Bugs-To: APT Development Team <deity@lists.debian.org>\n" -"POT-Creation-Date: 2024-07-30 04:29+0000\n" +"POT-Creation-Date: 2024-08-12 14:14+0000\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" @@ -9,20 +9,21 @@ # Jordi Mallach <jordi@debian.org>, 2004, 2005, 2006, 2008, 2009, 2011, 2012. # Agustí Grau <fletxa@gmail.com>, 2010. # Oriol Debian <oriol.debian@gmail.com>, 2016. +# Carles Pina i Estany <cpina@debian.org>, 2024 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: 2024-07-30 04:29+0000\n" -"PO-Revision-Date: 2020-08-09 22:43+0200\n" -"Last-Translator: Aleix Vidal i Gaya <aleix@softcatala.org>\n" +"POT-Creation-Date: 2024-08-12 14:14+0000\n" +"PO-Revision-Date: 2024-08-08 22:47+0100\n" +"Last-Translator: Carles Pina i Estany <cpina@debian.org>\n" "Language-Team: Catalan <debian-l10n-catalan@lists.debian.org>\n" "Language: ca\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -"X-Generator: Poedit 2.2.1\n" +"X-Generator: Poedit 3.2.2\n" "X-Poedit-Bookmarks: 502,178,-1,-1,-1,-1,-1,-1,-1,-1\n" #: apt-pkg/acquire-item.cc @@ -249,6 +250,8 @@ msgid "" "Repositories should provide a clear-signed InRelease file, but none found at " "%s." msgstr "" +"Els repositoris han de tenir un fitxer «InRelease» signat, però no se n'ha " +"trobat cap a %s." #: apt-pkg/acquire-item.cc #, c-format @@ -691,26 +694,26 @@ msgstr "Error de sintaxi %s:%u: Hi ha brossa extra al final del fitxer" #. TRANSLATOR: This is a warning level displayed before the message #: apt-pkg/contrib/error.cc msgid "Error:" -msgstr "" +msgstr "Error:" #. TRANSLATOR: This is a warning level displayed before the message #: apt-pkg/contrib/error.cc msgid "Warning:" -msgstr "" +msgstr "Avís:" #. TRANSLATOR: This is a warning level displayed before the message #: apt-pkg/contrib/error.cc msgid "Notice:" -msgstr "" +msgstr "Notificació:" #: apt-pkg/contrib/error.cc msgid "Audit:" -msgstr "" +msgstr "Auditoria:" #. TRANSLATOR: This is a warning level displayed before the message #: apt-pkg/contrib/error.cc msgid "Debug:" -msgstr "" +msgstr "Depuració:" #: apt-pkg/contrib/extracttar.cc #, c-format @@ -1352,10 +1355,8 @@ msgid "Calculating upgrade" msgstr "S'està calculant l'actualització" #: apt-pkg/edsp.cc -#, fuzzy -#| msgid "Total dependencies: " msgid "Solving dependencies" -msgstr "Nombre total de dependències: " +msgstr "S'està resolent les dependències" #: apt-pkg/edsp.cc msgid "Execute external solver" @@ -1958,21 +1959,22 @@ msgid "" "Unmerged usr is no longer supported, use usrmerge to convert to a merged-usr " "system." msgstr "" +"Un «usr» no unificat ja no està suportat, useu «usrmerge» per convertir-lo " +"en un sistema amb l'«usr» unificat." #. TRANSLATORS: %s is a url to a page describing merged-usr (bookworm release notes) #: apt-private/private-install.cc -#, fuzzy, c-format -#| msgid "Selected %s for removal.\n" +#, c-format msgid "See %s for more details." -msgstr "Seleccionat %s per eliminar.\n" +msgstr "Per més detalls, vegeu %s." #: apt-private/private-install.cc msgid "" "Unable to fetch some archives, maybe run apt-get update or try with --fix-" "missing?" msgstr "" -"No es poden obtenir alguns arxius. Proveu a executar apt-get update o " -"intenteu-ho amb --fix-missing." +"No es poden obtenir alguns arxius. Voleu provar a executar «apt-get update» " +"o intentar-ho amb «--fix-missing»?" #: apt-private/private-install.cc msgid "Internal error, InstallPackages was called with broken packages!" @@ -2016,10 +2018,9 @@ msgstr "" "Que estrany… Les mides no coincideixen, informeu-ho a apt@packages.debian.org" #: apt-private/private-install.cc -#, fuzzy, c-format -#| msgid "Download Failed" +#, c-format msgid " Download size: %sB / %sB\n" -msgstr "Ha fallat la baixada" +msgstr " Mida de la descàrrega: %sB / %sB\n" #. TRANSLATOR: The required space between number and unit is already included #. in the replacement strings, so %sB will be correctly translate in e.g. 1,5 MB @@ -2029,10 +2030,9 @@ msgid "Need to get %sB/%sB of archives.\n" msgstr "S'ha d'obtenir %sB/%sB d'arxius.\n" #: apt-private/private-install.cc -#, fuzzy, c-format -#| msgid "Download Failed" +#, c-format msgid " Download size: %sB\n" -msgstr "Ha fallat la baixada" +msgstr " Mida de la descàrrega: %sB\n" #. TRANSLATOR: The required space between number and unit is already included #. in the replacement string, so %sB will be correctly translate in e.g. 1,5 MB @@ -2052,7 +2052,7 @@ msgstr "" #: apt-private/private-install.cc #, c-format msgid "Space needed: %sB / %sB available\n" -msgstr "" +msgstr "Espai necessari: %sB / %sB disponible\n" #. TRANSLATOR: The required space between number and unit is already included #. in the replacement string, so %sB will be correctly translate in e.g. 1,5 MB @@ -2060,6 +2060,7 @@ msgstr "" #, c-format msgid "More space needed than available: %sB > %sB, installation may fail" msgstr "" +"Cal més espai del que hi ha disponible: %sB > %sB, la instal·lació pot fallar" #. TRANSLATOR: The required space between number and unit is already included #. in the replacement string, so %sB will be correctly translate in e.g. 1,5 MB - @@ -2069,7 +2070,7 @@ msgstr "" #: apt-private/private-install.cc #, c-format msgid "in %s: %sB / %sB available\n" -msgstr "" +msgstr "a %s: %sB / %sB disponible\n" #. TRANSLATOR: The required space between number and unit is already included #. in the replacement string, so %sB will be correctly translate in e.g. 1,5 MB @@ -2079,17 +2080,18 @@ msgstr "" msgid "" "More space needed in %s than available: %sB > %sB, installation may fail" msgstr "" +"Cal més espai a %s del que hi ha disponible: %sB > %sB, la instal·lació pot " +"fallar" #: apt-private/private-install.cc #, c-format msgid "Space needed: %sB\n" -msgstr "" +msgstr "Espai necessari: %sB\n" #: apt-private/private-install.cc -#, fuzzy, c-format -#| msgid "Stored label: %s\n" +#, c-format msgid " Freed space: %sB\n" -msgstr "Etiqueta desada: %s\n" +msgstr " Espai recuperat: %sB\n" #. TRANSLATOR: The required space between number and unit is already included #. in the replacement string, so %sB will be correctly translate in e.g. 1,5 MB @@ -2107,14 +2109,16 @@ msgid "" "Removing essential system-critical packages is not permitted. This might " "break the system." msgstr "" +"No està permès eliminar paquets essencials crítics pel sistema. Això podria " +"inutilitzar el sistema." #: apt-private/private-install.cc msgid "Continue anyway?" -msgstr "" +msgstr "Voleu continuar igualment?" #: apt-private/private-install.cc msgid "Continue?" -msgstr "" +msgstr "Voleu continuar?" #: apt-private/private-install.cc cmdline/apt-mark.cc msgid "Do you want to continue?" @@ -2355,50 +2359,52 @@ msgid "The following packages have unmet dependencies:" msgstr "Els següents paquets tenen dependències sense satisfer:" #: apt-private/private-output.cc -#, fuzzy -#| msgid "satisfy dependency strings" msgid "Unsatisfied dependencies:" -msgstr "satisfà cadenes de dependència" +msgstr "Dependències no satisfetes:" #: apt-private/private-output.cc msgid "The following NEW packages will be installed:" msgstr "S'instal·laran els paquets NOUS següents:" +# No es fa servir "S'està instal·lant:" perquè és un títol i després ve una pregunta per veure si s'instal·larà o no. E.g. fent "apt install PAQUET" l'apt ensenya "Instal·lant" (llistat de paquets) i "Instal·lant les dependències:" (llistat de paquets). I a continuació "Voleu continuar?" +# Amb "S'està instal·lant" ens sembla que l'acció està passant ara, i encara no passa. +# Una alternativa a considerar és "S'instal·laran" però potser és massa diferent de l'origen. #: apt-private/private-output.cc -#, fuzzy -#| msgid "Installing %s" msgid "Installing:" -msgstr "S'està instal·lant %s" - +msgstr "Instal·lant:" + +# No es fa servir "S'està instal·lant:" perquè és un títol i després ve +# una pregunta per veure si s'instal·larà o no. E.g. fent "apt install +# PAQUET" l'apt ensenya "Instal·lant" (llistat de paquets) i "Instal·lant +# les dependències:" (llistat de paquets). I a continuació "Voleu +# continuar?" +# Amb "S'està instal·lant" ens sembla que l'acció està passant ara, i +# encara no passa. +# Una alternativa a considerar és "S'instal·laran" però potser és massa +# diferent de l'origen. #: apt-private/private-output.cc -#, fuzzy -#| msgid "Total dependencies: " msgid "Installing dependencies:" -msgstr "Nombre total de dependències: " +msgstr "Instal·lant les dependències:" #: apt-private/private-output.cc msgid "REMOVING:" -msgstr "" +msgstr "S'ESTÀ SUPRIMINT:" #: apt-private/private-output.cc msgid "The following packages will be REMOVED:" msgstr "Se SUPRIMIRAN els paquets següents:" #: apt-private/private-output.cc -#, fuzzy -#| msgid "The following packages have been kept back:" msgid "The following upgrades have been deferred due to phasing:" -msgstr "S'han mantingut els paquets següents:" +msgstr "S'han ajornat les actualitzacions següents degut a escalonament:" #: apt-private/private-output.cc -#, fuzzy -#| msgid "The following packages have been kept back:" msgid "Not upgrading yet due to phasing:" -msgstr "S'han mantingut els paquets següents:" +msgstr "No s'està actualitzant encara degut a escalonament:" #: apt-private/private-output.cc msgid "Not upgrading:" -msgstr "" +msgstr "No s'està actualitzant:" #: apt-private/private-output.cc msgid "The following packages have been kept back:" @@ -2410,21 +2416,19 @@ msgstr "S'actualitzaran els paquets següents:" #: apt-private/private-output.cc msgid "Upgrading:" -msgstr "" +msgstr "S'està actualitzant:" #: apt-private/private-output.cc msgid "DOWNGRADING:" -msgstr "" +msgstr "S'ESTÀ DESACTUALITZANT:" #: apt-private/private-output.cc msgid "The following packages will be DOWNGRADED:" msgstr "Es DESACTUALITZARAN els paquets següents:" #: apt-private/private-output.cc -#, fuzzy -#| msgid "Pinned packages:" msgid "Changing held packages:" -msgstr "Paquets fixats:" +msgstr "S'està canviant els paquets retinguts:" #: apt-private/private-output.cc msgid "The following held packages will be changed:" @@ -2445,7 +2449,7 @@ msgstr "" #: apt-private/private-output.cc msgid "Summary:" -msgstr "" +msgstr "Resum:" #: apt-private/private-output.cc #, c-format @@ -2453,10 +2457,9 @@ msgid "%lu upgraded, %lu newly installed, " msgstr "%lu actualitzats, %lu nous a instal·lar, " #: apt-private/private-output.cc -#, fuzzy, c-format -#| msgid "Installing %s" +#, c-format msgid "Upgrading: %lu, Installing: %lu, " -msgstr "S'està instal·lant %s" +msgstr "S'està actualitzant: %lu, s'està instal·lant: %lu, " #: apt-private/private-output.cc #, c-format @@ -2464,10 +2467,9 @@ msgid "%lu reinstalled, " msgstr "%lu reinstal·lats, " #: apt-private/private-output.cc -#, fuzzy, c-format -#| msgid "Installing %s" +#, c-format msgid "Reinstalling: %lu, " -msgstr "S'està instal·lant %s" +msgstr "S'està reinstal·lant: %lu, " #: apt-private/private-output.cc #, c-format @@ -2477,7 +2479,7 @@ msgstr "%lu desactualitzats, " #: apt-private/private-output.cc #, c-format msgid "Downgrading: %lu, " -msgstr "" +msgstr "S'està desactualitzant: %lu, " #: apt-private/private-output.cc #, c-format @@ -2487,7 +2489,7 @@ msgstr "%lu a suprimir i %lu no actualitzats.\n" #: apt-private/private-output.cc #, c-format msgid "Removing: %lu, Not Upgrading: %lu\n" -msgstr "" +msgstr "S'està suprimint: %lu, no s'està actualitzant: %lu\n" #: apt-private/private-output.cc #, c-format @@ -2580,7 +2582,7 @@ msgstr " Taula de versions:" #: apt-private/private-show.cc msgid "phased" -msgstr "" +msgstr "escalonada" #: apt-private/private-source.cc #, c-format @@ -2770,7 +2772,7 @@ msgstr "" #: apt-private/private-update.cc #, c-format msgid "Missing Signed-By in the %s entry for '%s'" -msgstr "" +msgstr "No hi ha «Signed-By» a l'entrada %s de «%s»" #: apt-private/private-update.cc #, c-format @@ -3397,10 +3399,8 @@ msgid "remove packages" msgstr "elimina paquets" #: cmdline/apt.cc -#, fuzzy -#| msgid "Remove automatically all unused packages" msgid "automatically remove all unused packages" -msgstr "Suprimeix automàticament tots els paquets no utilitzats" +msgstr "suprimeix automàticament tots els paquets no utilitzats" #. system wide stuff #: cmdline/apt.cc @@ -4078,7 +4078,7 @@ msgstr "No es pot invocar " #: methods/gpgv.cc #, c-format msgid "untrusted public key algorithm: %s" -msgstr "" +msgstr "no es confia en l'algoritme de clau pública: %s" #: methods/gpgv.cc #, c-format @@ -4115,20 +4115,21 @@ msgstr "" msgid "Unknown error executing apt-key" msgstr "S'ha produït un error desconegut en executar apt-key" +# Si mai es tradueix el «apt-key»(8) canviar de DEPRECATION a la paraula feta servir al manual. #: methods/gpgv.cc #, c-format msgid "" "Key is stored in legacy trusted.gpg keyring (%s), see the DEPRECATION " "section in apt-key(8) for details." msgstr "" +"La clau està desada en un antic anell de claus «trusted.gpg» (%s); per més " +"detalls, consulteu la secció DEPRECATION d'«apt-key»(8)." #. TRANSLATORS: The second %s is the reason and is untranslated for repository owners. #: methods/gpgv.cc -#, fuzzy, c-format -#| msgid "Signature by key %s uses weak digest algorithm (%s)" +#, c-format msgid "Signature by key %s uses weak algorithm (%s)" -msgstr "" -"La signatura per la clau %s usa un algoritme de resum «hash» dèbil (%s)" +msgstr "La signatura amb la clau %s usa un algoritme dèbil (%s)" #: methods/gpgv.cc msgid "The following signatures were invalid:\n" diff --git a/test/integration/test-signed-by-option b/test/integration/test-signed-by-option index 58e4c4b..8e1e9a8 100755 --- a/test/integration/test-signed-by-option +++ b/test/integration/test-signed-by-option @@ -71,3 +71,51 @@ sed -i s/^xSigned-By/Signed-By/ rootdir/etc/apt/sources.list.d/deb822.sources testsuccess apt update -o Debug::Acquire::gpgv=1 # make sure we did not leave leftover files (LP: #1995247) testsuccessequal "" ls "${TMPDIR}" + +rm -f rootdir/etc/apt/sources.list.d/* + +msgtest 'Check that a repository with' 'only the fisrt entry has no Signed-By value works' +cat > rootdir/etc/apt/sources.list.d/example.sources << EOF +Types: deb +URIs: http://example.org/ +Suites: suite +Components: component + +Types: deb +URIs: http://example.org/ +Suites: suite +Components: component2 +Signed-By: 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE +EOF +testsuccess --nomsg aptcache policy + +msgtest 'Check that a repository with' 'only the second entry has no Signed-By value works' +cat > rootdir/etc/apt/sources.list.d/example.sources << EOF +Types: deb +URIs: http://example.org/ +Suites: suite +Components: component +Signed-By: 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE + +Types: deb +URIs: http://example.org/ +Suites: suite +Components: component2 +EOF +testsuccess --nomsg aptcache policy + +cat > rootdir/etc/apt/sources.list.d/example.sources << EOF +Types: deb +URIs: http://example.org/ +Suites: suite +Components: component +Signed-By: 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE + +Types: deb +URIs: http://example.org/ +Suites: suite +Components: component2 +Signed-By: DE66AECA9151AFA1877EC31DE8525D47528144E2 +EOF +testfailuremsg 'E: Conflicting values set for option Signed-By regarding source http://example.org/ suite: 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE != DE66AECA9151AFA1877EC31DE8525D47528144E2 +E: The list of sources could not be read.' aptget update --print-uris diff --git a/test/integration/test-solver3-obsoleted-by b/test/integration/test-solver3-obsoleted-by new file mode 100755 index 0000000..031589b --- /dev/null +++ b/test/integration/test-solver3-obsoleted-by @@ -0,0 +1,87 @@ +#!/bin/sh +set -e + +TESTDIR="$(readlink -f "$(dirname "$0")")" +. "$TESTDIR/framework" +setupenvironment +configarchitecture 'amd64' +allowremovemanual + +# We need a canary to make it trigger obsolete detection +insertpackage 'installed' 'canary' 'amd64' '1' 'Depends: good | not-yet-built | obsolete | obsolete-in-experimental | obsolete-reason | obsolete-in-experimental-reason | local-only | current-version | obsolete-in-downgrade | obsolete-in-downgrade-reason' + +# This package is good, it still exists in the candidate +insertpackage 'installed' 'good' 'amd64' '1' 'Source: good (= 1)' +insertpackage 'unstable' 'good' 'amd64' '2' 'Source: good (= 2)' + +# not-yet-built is not yet obsolete, because it has only been built on i386 +insertpackage 'installed,unstable' 'not-yet-built' 'amd64' '1' 'Source: not-yet-built (= 1)' +insertpackage 'unstable' 'not-yet-built' 'i386' '2' 'Source: not-yet-built (= 2)' + +# obsolete is obsolete because obsolete-reason has been built on the same arch and is the source candidate +insertpackage 'installed,unstable' 'obsolete' 'amd64' '1' 'Source: obsolete (= 1)' +insertpackage 'unstable' 'obsolete-reason' 'amd64' '2' 'Source: obsolete (= 2)' + +# obsolete-in-experimental is only obsoleted in experimental, so it is not yet considered obsolete +insertpackage 'installed,unstable' 'obsolete-in-experimental' 'amd64' '1' 'Source: obsolete-in-experimental (= 1)' +insertpackage 'experimental' 'obsolete-in-experimental-reason' 'amd64' '2' 'Source: obsolete-in-experimental (= 2)' + +# local-only only exists in the local install +insertpackage 'installed' 'local-only' 'amd64' '1' 'Source: local-only (= 1)' + +# current-version +insertpackage 'installed,unstable' 'current-version' 'amd64' '1' 'Source: current-version (= 1)' + +# obsolete-in-downgrade is only obsoleted in experimental, so it is not yet considered obsolete +insertpackage 'installed,experimental' 'obsolete-in-downgrade' 'amd64' '2' 'Source: obsolete-in-downgrade (= 2)' +insertpackage 'unstable' 'obsolete-in-downgrade-reason' 'amd64' '1' 'Source: obsolete-in-downgrade (= 1)' + +setupaptarchive + +testobsolete() { + out="$1" + shift + testsuccess $@ -o Debug::APT::Solver=4 -o APT::Solver=3.0 -s + cp rootdir/tmp/testsuccess.output upgrade.output + testsuccessequal "$out" grep "Obsolete:" upgrade.output +} + +testobsolete "Obsolete: obsolete:amd64=1 due to obsolete-reason:amd64=2 +Obsolete: local-only:amd64=1 - not installable" aptget dist-upgrade +testobsolete "Obsolete: obsolete:amd64=1 due to obsolete-reason:amd64=2 +Obsolete: local-only:amd64=1 - not installable" aptget dist-upgrade --no-strict-pinning + +msgmsg "Pinning the installed version down to experimental level means experimental wins" +printf 'Package: obsolete-in-experimental\nPin: release *\nPin-Priority: 1\n' > rootdir/etc/apt/preferences +testobsolete "Obsolete: obsolete:amd64=1 due to obsolete-reason:amd64=2 +Obsolete: obsolete-in-experimental:amd64=1 due to obsolete-in-experimental-reason:amd64=2 +Obsolete: local-only:amd64=1 - not installable" aptget dist-upgrade +testobsolete "Obsolete: obsolete:amd64=1 due to obsolete-reason:amd64=2 +Obsolete: obsolete-in-experimental:amd64=1 due to obsolete-in-experimental-reason:amd64=2 +Obsolete: local-only:amd64=1 - not installable" aptget dist-upgrade --no-strict-pinning + +msgmsg "Testing no-strict-pinning with negative pins on all packages" +printf 'Package: *\nPin: release *\nPin-Priority: -1\n' > rootdir/etc/apt/preferences +testobsolete "Obsolete: not-yet-built:amd64 - not installable +Obsolete: good:amd64 - not installable +Obsolete: obsolete:amd64 - not installable +Obsolete: obsolete-in-experimental:amd64 - not installable +Obsolete: current-version:amd64 - not installable +Obsolete: local-only:amd64 - not installable +Obsolete: obsolete-in-downgrade:amd64 - not installable" aptget dist-upgrade + +testobsolete "Obsolete: obsolete:amd64=1 due to obsolete-reason:amd64=2 +Obsolete: obsolete-in-experimental:amd64=1 due to obsolete-in-experimental-reason:amd64=2 +Obsolete: local-only:amd64=1 - not installable +Obsolete: obsolete-in-downgrade-reason:amd64=1 due to obsolete-in-downgrade:amd64=2" aptget dist-upgrade --no-strict-pinning + + +msgmsg "Testing that pinning a downgrade does not trigger obsoletes handling" +printf 'Package: downgrade-reason\nPin: release *\nPin-Priority: 1000\n' > rootdir/etc/apt/preferences + +testobsolete "Obsolete: obsolete:amd64=1 due to obsolete-reason:amd64=2 +Obsolete: local-only:amd64=1 - not installable" aptget dist-upgrade +testobsolete "Obsolete: obsolete:amd64=1 due to obsolete-reason:amd64=2 +Obsolete: local-only:amd64=1 - not installable" aptget dist-upgrade --no-strict-pinning + + |