diff options
author | Daniel Nicoletti <dantti12@gmail.com> | 2012-04-14 09:14:17 -0300 |
---|---|---|
committer | Daniel Nicoletti <dantti12@gmail.com> | 2012-04-14 09:14:17 -0300 |
commit | e35edab6d36269ffd57371a7a1e18089dc743fcf (patch) | |
tree | 71e44c9c6a3e60f900e37a27d18818fbd28685a9 | |
parent | 2bb0ed3633dbfa1dd69d1acfff557fd6075725e5 (diff) |
aptcc: Don't emit untrusted packages when we are not simulating
-rw-r--r-- | backends/aptcc/apt-intf.cpp | 10 | ||||
-rw-r--r-- | backends/aptcc/apt-intf.h | 2 |
2 files changed, 6 insertions, 6 deletions
diff --git a/backends/aptcc/apt-intf.cpp b/backends/aptcc/apt-intf.cpp index 81566b1d..e70a3408 100644 --- a/backends/aptcc/apt-intf.cpp +++ b/backends/aptcc/apt-intf.cpp @@ -1117,7 +1117,7 @@ void AptIntf::emitFiles(PkBackend *backend, const gchar *pi) } } -bool AptIntf::checkTrusted(pkgAcquire &fetcher, PkBackend *backend) +bool AptIntf::checkTrusted(pkgAcquire &fetcher, bool simulating) { string UntrustedList; PkgList untrusted; @@ -1134,13 +1134,13 @@ bool AptIntf::checkTrusted(pkgAcquire &fetcher, PkBackend *backend) if (untrusted.empty()) { return true; - } else { + } else if (simulating) { // TODO does it make sense to emit packages // when not simulating? emit_packages(untrusted, PK_FILTER_ENUM_NONE, PK_INFO_ENUM_UNTRUSTED); } - if (pk_backend_get_bool(backend, "only_trusted") == false || + if (pk_backend_get_bool(m_backend, "only_trusted") == false || _config->FindB("APT::Get::AllowUnauthenticated", false) == true) { g_debug ("Authentication warning overridden.\n"); return true; @@ -1148,7 +1148,7 @@ bool AptIntf::checkTrusted(pkgAcquire &fetcher, PkBackend *backend) string warning("The following packages cannot be authenticated:\n"); warning += UntrustedList; - pk_backend_error_code(backend, + pk_backend_error_code(m_backend, PK_ERROR_ENUM_CANNOT_INSTALL_REPO_UNSIGNED, warning.c_str()); _error->Discard(); @@ -2226,7 +2226,7 @@ bool AptIntf::installPackages(pkgCacheFile &Cache, bool simulating) } } - if (!checkTrusted(fetcher, m_backend) && !simulating) { + if (!checkTrusted(fetcher, simulating) && !simulating) { return false; } diff --git a/backends/aptcc/apt-intf.h b/backends/aptcc/apt-intf.h index 15cf8ee0..e8c85b01 100644 --- a/backends/aptcc/apt-intf.h +++ b/backends/aptcc/apt-intf.h @@ -163,7 +163,7 @@ private: PkBackend *m_backend; bool &_cancel; - bool checkTrusted(pkgAcquire &fetcher, PkBackend *backend); + bool checkTrusted(pkgAcquire &fetcher, bool simulating); bool TryToInstall(const pkgCache::PkgIterator &constPkg, pkgDepCache &Cache, pkgProblemResolver &Fix, |