Hello community,
here is the log from the commit of package PackageKit for openSUSE:Factory
checked in at Fri Feb 18 15:19:31 CET 2011.
--------
--- PackageKit/PackageKit.changes 2011-02-14 16:22:40.000000000 +0100
+++ /mounts/work_src_done/STABLE/PackageKit/PackageKit.changes 2011-02-18 14:19:31.000000000 +0100
@@ -1,0 +2,56 @@
+Fri Feb 18 11:25:43 UTC 2011 - dmacvicar@suse.de
+
+- Add PackageKit-use-system-solve.patch to update ZYpp backend:
+ + uses the standard system update algorithm from ZYpp, which
+ honours user policies. (bnc#637764)
+ + configurable HidePackages=true in [Updates] section in
+ /etc/PackageKit/ZYpp.conf to show only maintenance patches
+ instead of all packages with update candidates.
+
+-------------------------------------------------------------------
+Fri Feb 18 11:14:13 UTC 2011 - dmacvicar@suse.de
+
+- Update to version 0.6.12:
+ + New Features:
+ - Add speed python backend method
+ - Allow the user to specify a comma delimited list of default
+ backends
+ - Provide a hook so spawned backends can report speed
+ + Libraries (glib):
+ - Allow the service pack self tests to run by setting the temp
+ directory
+ - Avoid spamming lots of low level debugging to
+ .xsession-errors. (rh#668303)
+ - Check sscanf() returned the correct number of items before
+ using the answer
+ - Do not return distro-specific id's whilst testing, to fix
+ 'make check' on Debian
+ - Ensure we test for and always run the
+ self-check-socket-program in 'make check'
+ - Only use g_time_val_from_iso8601() when we have a valid
+ ISO8601 value
+ + Libraries (qt): Build fix.
+ + Bugfixes:
+ - Do not enable command not found debugging by default.
+ (rh#666254)
+ - Explictly include GIO in LDADD to fix a compile error on
+ Debian
+ - Fix calling pk_client_helper_start() with no environment set
+ - Fix bug which caused a crash when the Section() of a package
+ was NULL (lp#591474)
+ - Only try to populate the command list in pkcon after the
+ PkControl command has finished
+ - pkcon: check PK error in pk_console_resolve_package
+ - Set client locale to LC_MESSAGES rather than LC_ALL
+ + Zypp Backend:
+ - Consider autoremove in remove_packages
+ - Don't send package signal in DownloadProgressReportReceiver
+ - Erase system resolvables in zypp_build_pool
+ - Implement download packages
+ - Include system repo when install local rpm
+ - Refresh cache before searching
+ - Support download source RPM packages
+ + Non-zypp backends updates.
+ + Updated translations.
+
+-------------------------------------------------------------------
calling whatdependson for head-i586
Old:
----
PackageKit-0.6.11.tar.bz2
New:
----
PackageKit-0.6.12.tar.bz2
PackageKit-use-system-solve.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ PackageKit.spec ++++++
--- /var/tmp/diff_new_pack.9sXD2Y/_old 2011-02-18 15:19:24.000000000 +0100
+++ /var/tmp/diff_new_pack.9sXD2Y/_new 2011-02-18 15:19:24.000000000 +0100
@@ -34,8 +34,8 @@
%endif
Name: PackageKit
-Version: 0.6.11
-Release: 8
+Version: 0.6.12
+Release: 1
License: GPLv2+
BuildRequires: NetworkManager-devel
BuildRequires: dbus-1-glib-devel
@@ -65,6 +65,8 @@
Source: %{name}-%{version}.tar.bz2
# PATCH-FEATURE-OPENSUSE PackageKit-sysconfig-cron.patch vuntz@opensuse.org -- Change the configuration of the cron script to a sysconfig-like config
Patch0: PackageKit-sysconfig-cron.patch
+# PATCH-FIX-UPSTREAM PackageKit-use-system-solve.patch bnc#637764 dmacvicar@suse.de -- uses the standard system update algorithm from ZYpp which honours user policies
+Patch1: PackageKit-use-system-solve.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Requires: %{name}-branding = %{version}
Recommends: %{name}-lang
@@ -239,6 +241,7 @@
%setup -q
translation-update-upstream
%patch0 -p1
+%patch1 -p1
%build
%configure \
++++++ PackageKit-0.6.11.tar.bz2 -> PackageKit-0.6.12.tar.bz2 ++++++
PackageKit/PackageKit-0.6.11.tar.bz2 /mounts/work_src_done/STABLE/PackageKit/PackageKit-0.6.12.tar.bz2 differ: char 11, line 1
++++++ PackageKit-use-system-solve.patch ++++++
diff --git a/backends/zypp/zypp-utils.cpp b/backends/zypp/zypp-utils.cpp
index b7574ad..f7e03e2 100644
--- a/backends/zypp/zypp-utils.cpp
+++ b/backends/zypp/zypp-utils.cpp
@@ -43,12 +43,15 @@
#include
#include
#include
+#include
#include
#include
#include
#include
#include
#include
+#include
+#include
#include
@@ -60,24 +63,9 @@
gchar * _repoName;
gboolean _updating_self = FALSE;
-/**
- * Collect items, select best edition. This is used to find the best
- * available or installed. The name of the class is a bit misleading though ...
- */
-class LookForArchUpdate : public zypp::resfilter::PoolItemFilterFunctor
-{
- public:
- zypp::PoolItem best;
- bool operator() (zypp::PoolItem provider)
- {
- if (!provider.status ().isLocked () && (!best || best->edition ().compare (provider->edition ()) < 0)) {
- best = provider;
- }
-
- return true;
- }
-};
+using zypp::filesystem::PathInfo;
+using zypp::InputStream;
/**
* Initialize Zypp (Factory method)
@@ -161,22 +149,22 @@ zypp_is_development_repo (PkBackend *backend, zypp::RepoInfo repo)
std::string repo_debug("-debug");
std::string repo_development("-development");
std::string repo_source ("-source");
-
+
std::string repo_name(repo.name());
- if (repo_name.length() > repo_debuginfo.length() &&
+ if (repo_name.length() > repo_debuginfo.length() &&
repo_name.compare(repo_name.length() - repo_debuginfo.length(), repo_debuginfo.length(), repo_debuginfo) == 0)
return TRUE;
- if (repo_name.length() > repo_debug.length() &&
+ if (repo_name.length() > repo_debug.length() &&
repo_name.compare(repo_name.length() - repo_debug.length(), repo_debug.length(), repo_debug) == 0)
return TRUE;
- if (repo_name.length() > repo_development.length() &&
+ if (repo_name.length() > repo_development.length() &&
repo_name.compare(repo_name.length() - repo_development.length(), repo_development.length(), repo_development) == 0)
return TRUE;
- if (repo_name.length() > repo_source.length() &&
+ if (repo_name.length() > repo_source.length() &&
repo_name.compare(repo_name.length() - repo_source.length(), repo_source.length(), repo_source) == 0)
return TRUE;
@@ -257,39 +245,6 @@ warn_outdated_repos(PkBackend *backend, const zypp::ResPool & pool)
}
}
-
-#if 0 // apparently unused
-/**
- * Build and return a ResPool that contains only the local resolvables.
- */
-zypp::ResPool
-zypp_build_local_pool (PkBackend *backend)
-{
- zypp::sat::Pool pool = zypp::sat::Pool::instance ();
- zypp::ZYpp::Ptr zypp = get_zypp (backend);
-
- try {
- for (zypp::detail::RepositoryIterator it = pool.reposBegin (); it != pool.reposEnd (); it++){
- if (! it->isSystemRepo ())
- pool.reposErase(it->alias ());
- }
-
- if (zypp::sat::Pool::instance().reposFind( zypp::sat::Pool::systemRepoAlias() ).solvablesEmpty ())
- {
- // Add local resolvables
- zypp::Target_Ptr target = zypp->target ();
- target->load ();
- }
-
- } catch (const zypp::Exception &ex) {
- g_error ("%s", ex.asUserString ().c_str ());
- }
-
- return zypp->pool ();
-
-}
-#endif
-
zypp::target::rpm::RpmHeader::constPtr
zypp_get_rpmHeader (std::string name, zypp::Edition edition)
{
@@ -495,7 +450,7 @@ gboolean
zypp_refresh_meta_and_cache (zypp::RepoManager &manager, zypp::RepoInfo &repo, bool force)
{
try {
- if (manager.checkIfToRefreshMetadata (repo, repo.url(),
+ if (manager.checkIfToRefreshMetadata (repo, repo.url(),
zypp::RepoManager::RefreshIfNeededIgnoreDelay)
!= zypp::RepoManager::REFRESH_NEEDED)
return TRUE;
@@ -661,7 +616,7 @@ zypp_filter_solvable (PkBitfield filters, const zypp::sat::Solvable &item)
return TRUE;
// FIXME: add more enums - cf. libzif logic and pk-enum.h
- // PK_FILTER_ENUM_SUPPORTED,
+ // PK_FILTER_ENUM_SUPPORTED,
// PK_FILTER_ENUM_NOT_SUPPORTED,
}
@@ -702,7 +657,7 @@ zypp_emit_filtered_packages_in_list (PkBackend *backend, const std::vectorsameNVRA (*i) &&
+ match = it->sameNVRA (*i) &&
!(!zypp::isKindzypp::SrcPackage(*it) ^
!zypp::isKindzypp::SrcPackage(*i));
}
@@ -724,34 +679,6 @@ zypp_backend_package (PkBackend *backend, PkInfoEnum info,
}
/**
- * The following method was taken directly from zypper code
- *
- * Find best (according to edition) uninstalled item
- * with the same kind/name/arch as item.
- * Similar to zypp::solver::detail::Helper::findUpdateItem
- * but that allows changing the arch (#222140).
- */
-zypp::PoolItem
-zypp_find_arch_update_item (const zypp::ResPool & pool, zypp::PoolItem item)
-{
- LookForArchUpdate info;
-
- invokeOnEach (pool.byIdentBegin (item),
- pool.byIdentEnd (item),
- // get uninstalled, equal kind and arch, better edition
- zypp::functor::chain (
- zypp::functor::chain (
- zypp::functor::chain (
- zypp::resfilter::ByUninstalled (),
- zypp::resfilter::ByKind (item->kind ())),
- zypp::resfilter::byArchzypp::Arch > (item->arch ())),
- zypp::resfilter::byEditionzypp::Edition > (item->edition ())),
- zypp::functor::functorRef (info));
-
- return info.best;
-}
-
-/**
* Returns a set of all packages the could be updated
* (you're able to exclude a single (normally the 'patch' repo)
*/
@@ -765,35 +692,16 @@ zypp_get_package_updates (std::string repo)
zypp::ResPool::byKind_iterator it = pool.byKindBegin (kind);
zypp::ResPool::byKind_iterator e = pool.byKindEnd (kind);
- for (; it != e; ++it) {
- if (it->status ().isUninstalled ())
- continue;
- zypp::PoolItem candidate = zypp_find_arch_update_item (pool, *it);
- if (!candidate.resolvable ())
- continue;
-
- gboolean system = false;
- for (zypp::ResPool::byName_iterator it = pool.byNameBegin (candidate->name());
- it != pool.byNameEnd (candidate->name()); it++) {
- if (!it->satSolvable().isSystem())
- continue;
- if (zypp_ver_and_arch_equal (it->satSolvable(), candidate->edition ().c_str (),candidate->arch ().c_str ())) {
- system = true;
- break;
- }
- }
- if (system == true)
- continue;
-
- if (repo.empty ()) {
- pks->insert (candidate);
- } else {
- if (candidate->repoInfo ().alias ().compare (repo) != 0)
- pks->insert (candidate);
- }
- }
-
- return pks;
+ zypp::getZYpp()->resolver()->doUpdate();
+ for (; it != e; ++it)
+ if (it->status().isToBeInstalled())
+ {
+ zypp::ui::Selectable::constPtr s =
+ zypp::ui::Selectable::get((*it)->kind(), (*it)->name());
+ if (s->hasInstalledObj())
+ pks->insert(*it);
+ }
+ return pks;
}
/**
@@ -850,38 +758,54 @@ zypp_get_updates (PkBackend *backend)
patchRepo = candidates->begin ()->resolvable ()->repoInfo ().alias ();
}
- std::setzypp::PoolItem *packages;
+ bool hidePackages = false;
+ if (PathInfo("/etc/PackageKit/ZYpp.conf").isExist()) {
+ zypp::parser::IniDict vendorConf(InputStream("/etc/PackageKit/ZYpp.conf"));
+ if (vendorConf.hasSection("Updates")) {
+ for ( zypp::parser::IniDict::entry_const_iterator eit = vendorConf.entriesBegin("Updates");
+ eit != vendorConf.entriesEnd("Updates");
+ ++eit )
+ {
+ if ((*eit).first == "HidePackages" &&
+ zypp::str::strToTrue((*eit).second))
+ hidePackages = true;
+ }
+ }
+ }
- packages = zypp_get_package_updates (patchRepo);
- pi_it_t cb = candidates->begin (), ce = candidates->end (), ci;
- for (ci = cb; ci != ce; ++ci) {
- if (!zypp::isKindzypp::Patch(ci->resolvable()))
+ if (!hidePackages)
+ {
+ std::setzypp::PoolItem *packages;
+ packages = zypp_get_package_updates (patchRepo);
+ pi_it_t cb = candidates->begin (), ce = candidates->end (), ci;
+ for (ci = cb; ci != ce; ++ci) {
+ if (!zypp::isKindzypp::Patch(ci->resolvable()))
continue;
- zypp::Patch::constPtr patch = zypp::asKindzypp::Patch(ci->resolvable());
+ zypp::Patch::constPtr patch = zypp::asKindzypp::Patch(ci->resolvable());
+
+ // Remove contained packages from list of packages to add
+ zypp::sat::SolvableSet::const_iterator pki;
+ for (pki = patch->contents().begin(); pki != patch->contents().end(); pki++) {
- // Remove contained packages from list of packages to add
- zypp::sat::SolvableSet::const_iterator pki;
- for (pki = patch->contents().begin(); pki != patch->contents().end(); pki++) {
+ pi_it_t pb = packages->begin (), pe = packages->end (), pi;
+ for (pi = pb; pi != pe; ++pi) {
+ if (pi->satSolvable() == zypp::sat::Solvable::noSolvable)
+ continue;
- pi_it_t pb = packages->begin (), pe = packages->end (), pi;
- for (pi = pb; pi != pe; ++pi) {
- if (pi->satSolvable() == zypp::sat::Solvable::noSolvable)
- continue;
-
- if (pi->satSolvable().identical (*pki)) {
- packages->erase (pi);
- break;
+ if (pi->satSolvable().identical (*pki)) {
+ packages->erase (pi);
+ break;
+ }
}
}
}
- }
- // merge into the list
- candidates->insert (packages->begin (), packages->end ());
- delete (packages);
+ // merge into the list
+ candidates->insert (packages->begin (), packages->end ());
+ delete (packages);
+ }
}
-
return candidates;
}
@@ -1205,7 +1129,7 @@ zypp_backend_finished_error (PkBackend *backend, PkErrorEnum err_code,
va_end (args);
pk_backend_error_code (backend, err_code, "%s", buffer);
-
+
g_free (buffer);
pk_backend_finished (backend);
@@ -1273,7 +1197,7 @@ zypp_ver_and_arch_equal (const zypp::sat::Solvable &pkg,
{
const std::string &ver = pkg.edition ().asString();
if (g_strcmp0 (ver.c_str (), name))
- return FALSE;
+ return FALSE;
if (arch && !strcmp (arch, "source")) {
return zypp::isKindzypp::SrcPackage(pkg);
diff --git a/backends/zypp/zypp-utils.h b/backends/zypp/zypp-utils.h
index 815f594..71cd955 100644
--- a/backends/zypp/zypp-utils.h
+++ b/backends/zypp/zypp-utils.h
@@ -229,7 +229,6 @@ gboolean zypp_backend_pool_item_notify (PkBackend *backend,
gboolean zypp_ver_and_arch_equal (const zypp::sat::Solvable &pkg,
const char *name, const char *arch);
-
/**
* helper to refresh a repo's metadata and cache, catching signature
* exceptions in a safe way.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org