[packagekit] packagekit: Branch 'master' - 13 commits
Richard Hughes
hughsient at kemper.freedesktop.org
Tue Feb 19 17:24:03 PST 2008
backends/apt2/aptDBUSBackend.py | 2
backends/yum/helpers/yumBackend.py | 2
backends/yum2/helpers/yumDBUSBackend.py | 42 ++
backends/yum2/pk-backend-yum2.c | 2
backends/zypp/pk-backend-zypp.cpp | 298 +++++++++++++--------
backends/zypp/zypp-utils.cpp | 26 +
backends/zypp/zypp-utils.h | 2
configure.ac | 2
data/org.freedesktop.PackageKit.conf.in | 2
data/org.freedesktop.PackageKitAptBackend.conf.in | 2
data/org.freedesktop.PackageKitTestBackend.conf.in | 2
data/org.freedesktop.PackageKitYumBackend.conf.in | 2
libgbus/libgbus.c | 3
libpackagekit/pk-client.c | 18 -
libpackagekit/pk-connection.c | 2
libpackagekit/pk-enum.c | 26 -
libpackagekit/pk-extra.c | 91 +++++-
libpackagekit/pk-job-list.c | 6
libpackagekit/pk-network-dummy.c | 2
libpackagekit/pk-network-nm.c | 2
libpackagekit/pk-task-list.c | 2
po/POTFILES.in | 1
python/packagekit/daemonBackend.py | 4
src/pk-backend-spawn.c | 2
src/pk-backend.c | 6
src/pk-engine.c | 2
src/pk-inhibit.c | 2
src/pk-runner.c | 2
src/pk-spawn.c | 2
src/pk-transaction-db.c | 2
src/pk-transaction-list.c | 2
31 files changed, 368 insertions(+), 193 deletions(-)
New commits:
commit 3360ca42a0b930a7036c6a00c00efaf9a46699ca
Author: Robin Norwood <rnorwood at redhat.com>
Date: Tue Feb 19 16:39:12 2008 -0500
Remove at_console from dbus configs.
diff --git a/data/org.freedesktop.PackageKit.conf.in b/data/org.freedesktop.PackageKit.conf.in
index 708f2eb..4e3e45b 100644
--- a/data/org.freedesktop.PackageKit.conf.in
+++ b/data/org.freedesktop.PackageKit.conf.in
@@ -20,7 +20,7 @@
</policy>
<!-- This will not work if pam_console support is not enabled -->
- <policy at_console="true">
+ <policy>
<allow send_interface="org.freedesktop.PackageKit"/>
</policy>
diff --git a/data/org.freedesktop.PackageKitAptBackend.conf.in b/data/org.freedesktop.PackageKitAptBackend.conf.in
index f050954..06770db 100644
--- a/data/org.freedesktop.PackageKitAptBackend.conf.in
+++ b/data/org.freedesktop.PackageKitAptBackend.conf.in
@@ -12,7 +12,7 @@
<allow send_destination="org.freedesktop.PackageKitAptBackend"/>
<allow send_interface="org.freedesktop.PackageKitBackend"/>
</policy>
- <policy at_console="true">
+ <policy>
<deny send_destination="org.freedesktop.PackageKitAptBackend"/>
<deny send_interface="org.freedesktop.PackageKitBackend"/>
</policy>
diff --git a/data/org.freedesktop.PackageKitTestBackend.conf.in b/data/org.freedesktop.PackageKitTestBackend.conf.in
index 4f51831..3035521 100644
--- a/data/org.freedesktop.PackageKitTestBackend.conf.in
+++ b/data/org.freedesktop.PackageKitTestBackend.conf.in
@@ -12,7 +12,7 @@
<allow send_destination="org.freedesktop.PackageKitTestBackend"/>
<allow send_interface="org.freedesktop.PackageKitBackend"/>
</policy>
- <policy at_console="true">
+ <policy>
<deny send_destination="org.freedesktop.PackageKitTestBackend"/>
<deny send_interface="org.freedesktop.PackageKitBackend"/>
</policy>
diff --git a/data/org.freedesktop.PackageKitYumBackend.conf.in b/data/org.freedesktop.PackageKitYumBackend.conf.in
index e105f5f..6f34237 100644
--- a/data/org.freedesktop.PackageKitYumBackend.conf.in
+++ b/data/org.freedesktop.PackageKitYumBackend.conf.in
@@ -12,7 +12,7 @@
<allow send_destination="org.freedesktop.PackageKitYumBackend"/>
<allow send_interface="org.freedesktop.PackageKitBackend"/>
</policy>
- <policy at_console="true">
+ <policy>
<deny send_destination="org.freedesktop.PackageKitYumBackend"/>
<deny send_interface="org.freedesktop.PackageKitBackend"/>
</policy>
commit 1544cde6db733420e6178d8df1507142b5a68a00
Author: Robin Norwood <rnorwood at redhat.com>
Date: Tue Feb 19 16:28:04 2008 -0500
Change name of yum2 backend so I don't wonder why the yum backend is running when the yum2 backend should be running when I look at pk-backend-status...again.
diff --git a/backends/yum2/pk-backend-yum2.c b/backends/yum2/pk-backend-yum2.c
index ee05197..8b20473 100644
--- a/backends/yum2/pk-backend-yum2.c
+++ b/backends/yum2/pk-backend-yum2.c
@@ -360,7 +360,7 @@ backend_repo_set_data (PkBackend *backend, const gchar *rid, const gchar *parame
}
PK_BACKEND_OPTIONS (
- "YUM", /* description */
+ "YUM-DBUS", /* description */
"Tim Lauridsen <timlau at fedoraproject.org>", /* author */
backend_initialize, /* initalize */
backend_destroy, /* destroy */
commit e4de4f8b415c53ba015d7301eab1840d84c87c12
Author: Robin Norwood <rnorwood at redhat.com>
Date: Tue Feb 19 15:21:19 2008 -0500
o call self.yumbase.repos.setCache(0)
o Make _refresh_yum_cache and RefreshCache work similarly (except for percentage updates and whatnot)
diff --git a/backends/yum2/helpers/yumDBUSBackend.py b/backends/yum2/helpers/yumDBUSBackend.py
index 6cdaba3..2118011 100755
--- a/backends/yum2/helpers/yumDBUSBackend.py
+++ b/backends/yum2/helpers/yumDBUSBackend.py
@@ -429,9 +429,10 @@ class PackageKitYumBackend(PackageKitBaseBackend):
if self._do_extra_filtering(pkg, fltlist):
self._show_package(pkg, INFO_AVAILABLE)
except yum.Errors.RepoError,e:
- self.ErrorCode(ERROR_NO_CACHE,"Yum cache is invalid")
+ self.Message(MESSAGE_NOTICE, "The package cache is invalid and is being rebuilt.")
self._refresh_yum_cache()
self.Finished(EXIT_FAILED)
+
return
self.Finished(EXIT_SUCCESS)
@@ -568,6 +569,10 @@ class PackageKitYumBackend(PackageKitBaseBackend):
self.PercentageChanged(0)
self.StatusChanged(STATUS_REFRESH_CACHE)
+ old_cache_setting = self.yumbase.conf.cache
+ self.yumbase.conf.cache = 0
+ self.yumbase.repos.setCache(0)
+
pct = 0
try:
if len(self.yumbase.repos.listEnabled()) == 0:
@@ -586,6 +591,9 @@ class PackageKitYumBackend(PackageKitBaseBackend):
self.yumbase.repos.populateSack(which=[repo.id], mdtype='filelists', cacheonly=1)
pct+=bump
self.PercentageChanged(pct)
+ self.yumbase.repos.populateSack(which=[repo.id], mdtype='otherdata', cacheonly=1)
+ pct+=bump
+ self.PercentageChanged(pct)
self.PercentageChanged(95)
# Setup categories/groups
@@ -598,6 +606,9 @@ class PackageKitYumBackend(PackageKitBaseBackend):
self.Finished(EXIT_FAILED)
self.Exit()
+ self.yumbase.conf.cache = old_cache_setting
+ self.yumbase.repos.setCache(old_cache_setting)
+
self.Finished(EXIT_SUCCESS)
@dbus.service.method(PACKAGEKIT_DBUS_INTERFACE,
@@ -631,10 +642,11 @@ class PackageKitYumBackend(PackageKitBaseBackend):
self._show_package(pkg,INFO_AVAILABLE)
break
except yum.Errors.RepoError,e:
- self.ErrorCode(ERROR_NO_CACHE,"Yum cache is invalid")
+ self.Message(MESSAGE_NOTICE, "The package cache is invalid and is being rebuilt.")
self._refresh_yum_cache()
self.Finished(EXIT_FAILED)
- self.Exit()
+
+ return
self.Finished(EXIT_SUCCESS)
@@ -829,10 +841,11 @@ class PackageKitYumBackend(PackageKitBaseBackend):
else:
self._show_package(pkg,INFO_NORMAL)
except yum.Errors.RepoError,e:
- self.ErrorCode(ERROR_NO_CACHE,"Yum cache is invalid")
+ self.Message(MESSAGE_NOTICE, "The package cache is invalid and is being rebuilt.")
self._refresh_yum_cache()
self.Finished(EXIT_FAILED)
- self.Exit()
+
+ return
self.Finished(EXIT_SUCCESS)
@@ -875,9 +888,10 @@ class PackageKitYumBackend(PackageKitBaseBackend):
if showDesc:
self._show_package_description(pkg)
except yum.Errors.RepoError,e:
- self.ErrorCode(ERROR_NO_CACHE,"Yum cache is invalid")
+ self.Message(MESSAGE_NOTICE, "The package cache is invalid and is being rebuilt.")
self._refresh_yum_cache()
- self.Finished(EXIT_FAILED)
+ self.Finished(EXIT_FAILED)
+
return
self.Finished(EXIT_SUCCESS)
@@ -1013,8 +1027,9 @@ class PackageKitYumBackend(PackageKitBaseBackend):
self._show_package(pkg, INFO_AVAILABLE)
except yum.Errors.RepoError,e:
- self.ErrorCode(ERROR_NO_CACHE,"Yum cache is invalid")
+ self.Message(MESSAGE_NOTICE, "The package cache is invalid and is being rebuilt.")
self._refresh_yum_cache()
+
return False
return True
@@ -1473,10 +1488,14 @@ class PackageKitYumBackend(PackageKitBaseBackend):
self.StatusChanged(STATUS_REFRESH_CACHE)
old_cache_setting = self.yumbase.conf.cache
self.yumbase.conf.cache = 0
+ self.yumbase.repos.setCache(0)
+
self.yumbase.repos.populateSack(mdtype='metadata', cacheonly=1)
self.yumbase.repos.populateSack(mdtype='filelists', cacheonly=1)
self.yumbase.repos.populateSack(mdtype='otherdata', cacheonly=1)
+
self.yumbase.conf.cache = old_cache_setting
+ self.yumbase.repos.setCache(old_cache_setting)
def _setup_yum(self):
self.yumbase.doConfigSetup(errorlevel=0,debuglevel=0) # Setup Yum Config
commit 7ad09973a736d632264b5d2f61c430e7f3f328dd
Author: Stefan Haas <shaas at suse.de>
Date: Tue Feb 19 15:58:26 2008 +0100
libzypp >= 4.2.3 is now needed
diff --git a/configure.ac b/configure.ac
index 650c33e..d95d4eb 100755
--- a/configure.ac
+++ b/configure.ac
@@ -482,7 +482,7 @@ if test x$enable_alpm = xyes; then
fi
if test x$enable_zypp = xyes; then
- PKG_CHECK_MODULES(ZYPP, libzypp)
+ PKG_CHECK_MODULES(ZYPP, libzypp >= 4.2.3)
AC_SUBST(ZYPP_CFLAGS)
AC_SUBST(ZYPP_LIBS)
fi
commit 9b89f4ace0ed43e1bbb27f8751cb775aa808bced
Author: Stefan Haas <shaas at suse.de>
Date: Tue Feb 19 15:54:10 2008 +0100
changed for new libzypp
diff --git a/backends/zypp/pk-backend-zypp.cpp b/backends/zypp/pk-backend-zypp.cpp
index bea3f95..a6e486d 100644
--- a/backends/zypp/pk-backend-zypp.cpp
+++ b/backends/zypp/pk-backend-zypp.cpp
@@ -47,7 +47,12 @@
#include <zypp/RelCompare.h>
#include <zypp/ResFilters.h>
#include <zypp/base/Algorithm.h>
-#include <sqlite3.h>
+#include <zypp/target/rpm/RpmDb.h>
+#include <zypp/target/rpm/RpmHeader.h>
+#include <zypp/target/rpm/RpmException.h>
+
+#include <zypp/sat/Solvable.h>
+#include <zypp/sat/Capabilities.h>
#include <map>
#include <list>
@@ -178,16 +183,6 @@ backend_get_filters (PkBackend *backend, PkEnumList *elist)
static gboolean
backend_get_depends_thread (PkBackendThread *thread, gpointer data)
{
- // Note: I talked with duncanmv in #zypp and he suggested the
- // way we could suppor this method would be to mark the desired
- // package to be installed, run the dependency solver, and then
- // check the other packages that got marked to install:
-/*
-08:55 < duncanmv> run the solver
-08:56 < duncanmv> and then iterate the poll and look packages which status isBySolver() true
-08:56 < duncanmv> which are the packages marked by the solver
-08:56 < duncanmv> you can say that status toBeInstalled() and bySolver are requires
-*/
PkBackend *backend;
backend = pk_backend_thread_get_backend (thread);
@@ -208,42 +203,27 @@ backend_get_depends_thread (PkBackendThread *thread, gpointer data)
zypp::ZYpp::Ptr zypp;
zypp = get_zypp ();
- // Load resolvables from all the enabled repositories
- zypp::RepoManager manager;
- std::list <zypp::RepoInfo> repos;
try
{
- // TODO: Split the code up so it's not all just in one bit try/catch
-
- repos = manager.knownRepositories();
- for (std::list <zypp::RepoInfo>::iterator it = repos.begin(); it != repos.end(); it++) {
- zypp::RepoInfo repo (*it);
+ pk_backend_set_percentage (backend, 20);
+ // Load resolvables from all the enabled repositories
+ zypp::ResPool pool = zypp_build_pool(true);
- // skip disabled repos
- if (repo.enabled () == false)
- continue;
-
- zypp::Repository repository = manager.createFromCache (*it);
- zypp->addResolvables (repository.resolvables ());
- }
-
- zypp::PoolItem_Ref pool_item;
+ zypp::PoolItem pool_item;
gboolean pool_item_found = FALSE;
// Iterate over the resolvables and mark the one we want to check its dependencies
- for (zypp::ResPoolProxy::const_iterator it = zypp->poolProxy().byKindBegin <zypp::Package>();
- it != zypp->poolProxy().byKindEnd <zypp::Package>(); it++) {
- zypp::ui::Selectable::Ptr selectable = *it;
+ for (zypp::ResPool::byIdent_iterator it = pool.byIdentBegin (zypp::ResKind::package, pi->name);
+ it != pool.byIdentEnd (zypp::ResKind::package, pi->name); it++) {
+ zypp::PoolItem selectable = *it;
if (strcmp (selectable->name().c_str(), pi->name) == 0) {
- // This package matches the name we're looking for and
- // is available for update/install.
- zypp::ResObject::constPtr installable = selectable->candidateObj();
- const char *edition_str = installable->edition().asString().c_str();
+ // This package matches the name we're looking
+ const char *edition_str = selectable->edition ().asString ().c_str();
+ pk_backend_set_percentage (backend, 20);
if (strcmp (edition_str, pi->version) == 0) {
// this is the one, mark it to be installed
- selectable->set_status (zypp::ui::S_Install);
-fprintf (stderr, "\n\n *** marked a package!!! ***\n\n");
- pool_item = selectable->candidatePoolItem ();
+ fprintf (stderr, "\n\n *** marked a package!!! ***\n\n");
+ pool_item = selectable;
pool_item_found = TRUE;
break; // Found it, get out of the for loop
}
@@ -260,39 +240,68 @@ fprintf (stderr, "\n\n *** marked a package!!! ***\n\n");
return FALSE;
}
-//printf ("Resolving dependencies...\n");
// Gather up any dependencies
pk_backend_set_status (backend, PK_STATUS_ENUM_DEP_RESOLVE);
- if (zypp->resolver ()->resolvePool () == FALSE) {
- // Manual intervention required to resolve dependencies
- // TODO: Figure out what we need to do with PackageKit
- // to pull off interactive problem solving.
- pk_backend_error_code (backend, PK_ERROR_ENUM_DEP_RESOLUTION_FAILED, "Couldn't resolve the package dependencies.");
- g_free (d->package_id);
- g_free (d);
- pk_package_id_free (pi);
- pk_backend_finished (backend);
- return FALSE;
- }
-
+
pk_backend_set_percentage (backend, 60);
- zypp::solver::detail::ItemCapKindList installList = zypp->resolver ()->installs (pool_item);
- for (zypp::solver::detail::ItemCapKindList::const_iterator it = installList.begin ();
- it != installList.end ();
- ++it) {
- gchar *package_id;
- package_id = pk_package_id_build (it->item->name ().c_str (),
- it->item->edition ().asString ().c_str (),
- it->item->arch ().asString ().c_str (),
- "opensuse");
- pk_backend_package (backend,
- PK_INFO_ENUM_AVAILABLE, // TODO: Figure out how to determine whether a package is installed or not
- package_id,
- "TODO: Figure out how to get a package description here.");
- g_free (package_id);
- }
+ // get dependencies
+ zypp::sat::Solvable solvable = pool_item.satSolvable ();
+ zypp::Capabilities req = solvable[zypp::Dep::REQUIRES];
+
+ std::map<std::string, zypp::sat::Solvable> caps;
+
+ for (zypp::Capabilities::const_iterator it = req.begin ();
+ it != req.end ();
+ ++it) {
+ zypp::sat::WhatProvides provider (*it);
+ for (zypp::sat::WhatProvides::const_iterator it2 = provider.begin ();
+ it2 != provider.end ();
+ it2++) {
+
+ // Adding Packages only one time
+ std::map<std::string, zypp::sat::Solvable>::iterator mIt;
+ mIt = caps.find(it2->name ());
+ if( mIt != caps.end()){
+ if(it2->isSystem ()){
+ caps.erase (mIt);
+ caps[it2->name ()] = *it2;
+ }
+ }else{
+ caps[it2->name ()] = *it2;
+ }
+
+ }
+ }
+ // print dependencies
+
+ for (std::map<std::string, zypp::sat::Solvable>::iterator it = caps.begin ();
+ it != caps.end();
+ it++) {
+
+ gchar *package_id;
+ package_id = pk_package_id_build ( it->second.name ().c_str(),
+ it->second.edition ().asString ().c_str(),
+ it->second.arch ().c_str(),
+ "opensuse");
+
+ zypp::PoolItem item = zypp::ResPool::instance ().find (it->second);
+
+ if (it->second.isSystem ()) {
+ pk_backend_package (backend,
+ PK_INFO_ENUM_INSTALLED,
+ package_id,
+ item->description ().c_str());
+ }else{
+ pk_backend_package (backend,
+ PK_INFO_ENUM_AVAILABLE,
+ package_id,
+ "");
+ }
+ g_free (package_id);
+ }
+
pk_backend_set_percentage (backend, 100);
} catch (const zypp::repo::RepoNotFoundException &ex) {
// TODO: make sure this dumps out the right sring.
@@ -424,9 +433,9 @@ backend_get_description (PkBackend *backend, const gchar *package_id)
class LookForArchUpdate : public zypp::resfilter::PoolItemFilterFunctor
{
public:
- zypp::PoolItem_Ref best;
+ zypp::PoolItem best;
- bool operator() (zypp::PoolItem_Ref provider)
+ bool operator() (zypp::PoolItem provider)
{
if ((provider.status ().isLocked () == FALSE) && (!best || best->edition ().compare (provider->edition ()) < 0)) {
best = provider;
@@ -444,13 +453,13 @@ class LookForArchUpdate : public zypp::resfilter::PoolItemFilterFunctor
* Similar to zypp::solver::detail::Helper::findUpdateItem
* but that allows changing the arch (#222140).
*/
-static zypp::PoolItem_Ref
-findArchUpdateItem (const zypp::ResPool & pool, zypp::PoolItem_Ref item)
+static zypp::PoolItem
+findArchUpdateItem (const zypp::ResPool & pool, zypp::PoolItem item)
{
LookForArchUpdate info;
- invokeOnEach (pool.byNameBegin (item->name ()),
- pool.byNameEnd (item->name ()),
+ invokeOnEach (pool.byIdentBegin (item),
+ pool.byIdentEnd (item),
// get uninstalled, equal kind and arch, better edition
zypp::functor::chain (
zypp::functor::chain (
@@ -483,7 +492,7 @@ backend_get_updates_thread (PkBackendThread *thread, gpointer data)
for (; it != e; ++it) {
if (it->status ().isUninstalled ())
continue;
- zypp::PoolItem_Ref candidate = findArchUpdateItem (pool, *it);
+ zypp::PoolItem candidate = findArchUpdateItem (pool, *it);
if (!candidate.resolvable ())
continue;
@@ -540,35 +549,14 @@ backend_install_package_thread (PkBackendThread *thread, gpointer data)
return FALSE;
}
- zypp::Target_Ptr target;
-
zypp::ZYpp::Ptr zypp;
zypp = get_zypp ();
- target = zypp->target ();
-
- // Load all the local system "resolvables" (packages)
- zypp->addResolvables (target->resolvables(), TRUE);
- pk_backend_set_percentage (backend, 10);
-
- // Load resolvables from all the enabled repositories
- zypp::RepoManager manager;
- std::list <zypp::RepoInfo> repos;
try
{
- // TODO: Split the code up so it's not all just in one bit try/catch
-
- repos = manager.knownRepositories();
- for (std::list <zypp::RepoInfo>::iterator it = repos.begin(); it != repos.end(); it++) {
- zypp::RepoInfo repo (*it);
- // skip disabled repos
- if (repo.enabled () == false)
- continue;
-
- zypp::Repository repository = manager.createFromCache (*it);
- zypp->addResolvables (repository.resolvables ());
- }
+ zypp::ResPool pool = zypp_build_pool (TRUE);
+ pk_backend_set_percentage (backend, 10);
// Iterate over the resolvables and mark the ones we want to install
//zypp->start ();
@@ -775,11 +763,9 @@ backend_remove_package_thread (PkBackendThread *thread, gpointer data)
target = zypp->target ();
// Load all the local system "resolvables" (packages)
- zypp->addResolvables (target->resolvables(), TRUE);
+ target->load ();
pk_backend_set_percentage (backend, 10);
- zypp::RepoManager manager;
- std::list <zypp::RepoInfo> repos;
try
{
// Iterate over the resolvables and mark the ones we want to remove
@@ -1164,17 +1150,122 @@ backend_repo_enable (PkBackend *backend, const gchar *rid, gboolean enabled)
pk_backend_finished (backend);
}
+static gboolean
+backend_get_files_thread (PkBackendThread *thread, gpointer data) {
+
+ PkPackageId *pi;
+ PkBackend *backend;
+
+ /* get current backend */
+ backend = pk_backend_thread_get_backend (thread);
+ ThreadData *d = (ThreadData*) data;
+
+ pi = pk_package_id_new_from_string (d->package_id);
+ if (pi == NULL) {
+ pk_backend_error_code (backend, PK_ERROR_ENUM_PACKAGE_ID_INVALID, "invalid package id");
+ pk_package_id_free (pi);
+ g_free (d->package_id);
+ g_free (d);
+ pk_backend_finished (backend);
+ return FALSE;
+ }
+ pk_backend_set_status (backend, PK_STATUS_ENUM_QUERY);
+
+ std::vector<zypp::PoolItem> *v;
+ v = zypp_get_packages_by_name ((const gchar *)pi->name, TRUE);
+
+ zypp::ResObject::constPtr package;
+ for (std::vector<zypp::PoolItem>::iterator it = v->begin ();
+ it != v->end (); it++) {
+ zypp::ResObject::constPtr pkg = (*it);
+ const char *version = pkg->edition ().asString ().c_str ();
+ if (strcmp (pi->version, version) == 0) {
+ package = pkg;
+ break;
+ }
+ }
+
+ delete (v);
+
+ if (package == NULL) {
+ pk_backend_error_code (backend, PK_ERROR_ENUM_PACKAGE_NOT_FOUND, "couldn't find package");
+ pk_package_id_free (pi);
+ g_free (d->package_id);
+ g_free (d);
+ pk_backend_finished (backend);
+ return FALSE;
+ }
+
+ std::string temp;
+ if (package->isSystem ()){
+ zypp::Target_Ptr target;
+
+ zypp::ZYpp::Ptr zypp;
+ zypp = get_zypp ();
+
+ target = zypp->target ();
+ try {
+ zypp::target::rpm::RpmDb &rpm = target->rpmDb ();
+ rpm.initDatabase();
+ zypp::target::rpm::RpmHeader::constPtr rpmHeader;
+ rpm.getData (package-> name (), package->edition (), rpmHeader);
+ std::list<std::string> files = rpmHeader->tag_filenames ();
+
+ for (std::list<std::string>::iterator it = files.begin (); it != files.end (); it++) {
+ temp.append (*it);
+ temp.append (";");
+ }
+ rpm.closeDatabase();
+ } catch (const zypp::target::rpm::RpmException &ex) {
+ pk_backend_error_code (backend, PK_ERROR_ENUM_REPO_NOT_FOUND, "Couldn't open rpm-database");
+ pk_backend_finished (backend);
+ return FALSE;
+ }
+ }else{
+ temp = "Only available for installed packages";
+ }
+
+ pk_backend_files (backend,
+ d->package_id, // package_id
+ temp.c_str ()); // file_list
+
+ pk_package_id_free (pi);
+ g_free (d->package_id);
+ g_free (d);
+ pk_backend_finished (backend);
+
+ return TRUE;
+}
+
+/**
+ * backend_get_files:
+ */
+static void
+backend_get_files(PkBackend *backend, const gchar *package_id)
+{
+ g_return_if_fail (backend != NULL);
+
+ ThreadData *data = g_new0(ThreadData, 1);
+ if (data == NULL) {
+ pk_backend_error_code(backend, PK_ERROR_ENUM_OOM, "Failed to allocate memory in backend_get_files");
+ pk_backend_finished (backend);
+ } else {
+ data->package_id = g_strdup(package_id);
+ pk_backend_thread_create (thread, backend_get_files_thread, data);
+ }
+}
+
extern "C" PK_BACKEND_OPTIONS (
"Zypp", /* description */
- "Boyd Timothy <btimothy at gmail.com>, Scott Reeves <sreeves at novell.com>", /* author */
- backend_initialize, /* initialize */
+ "Boyd Timothy <btimothy at gmail.com>, Scott Reeves <sreeves at novell.com>, Stefan Haas <shaas at suse.de>", /* author */
+ backend_initialize, /* initalize */
backend_destroy, /* destroy */
backend_get_groups, /* get_groups */
backend_get_filters, /* get_filters */
NULL, /* cancel */
backend_get_depends, /* get_depends */
backend_get_description, /* get_description */
- NULL, /* get_files */
+ backend_get_files, /* get_files */
NULL, /* get_requires */
NULL, /* get_update_detail */
backend_get_updates, /* get_updates */
@@ -1192,5 +1283,6 @@ extern "C" PK_BACKEND_OPTIONS (
NULL, /* update_system */
backend_get_repo_list, /* get_repo_list */
backend_repo_enable, /* repo_enable */
- NULL /* repo_set_data */
+ NULL, /* repo_set_data */
+ NULL /* service_pack */
);
diff --git a/backends/zypp/zypp-utils.cpp b/backends/zypp/zypp-utils.cpp
index 43e85b9..281b386 100644
--- a/backends/zypp/zypp-utils.cpp
+++ b/backends/zypp/zypp-utils.cpp
@@ -17,6 +17,7 @@
#include <zypp/Pathname.h>
#include <zypp/Patch.h>
#include <zypp/Package.h>
+#include <zypp/sat/Pool.h>
#include <pk-backend.h>
@@ -66,9 +67,13 @@ zypp_build_pool (gboolean include_local)
zypp::ZYpp::Ptr zypp = get_zypp ();
if (include_local == TRUE) {
- // Add local resolvables
- zypp::Target_Ptr target = zypp->target ();
- zypp->addResolvables (target->resolvables (), TRUE);
+ //FIXME have to wait for fix in zypp (repeated loading of target)
+ if (zypp::sat::Pool::instance().reposFind( zypp::sat::Pool::systemRepoName() ) == zypp::sat::Repo::norepo)
+ {
+ // Add local resolvables
+ zypp::Target_Ptr target = zypp->target ();
+ target->load ();
+ }
}
// Add resolvables from enabled repos
@@ -82,12 +87,13 @@ zypp_build_pool (gboolean include_local)
// skip disabled repos
if (repo.enabled () == false)
continue;
-
- zypp::Repository repository = manager.createFromCache (repo);
- zypp->addResolvables (repository.resolvables ());
+
+ //FIXME see above, skip already cached repos
+ if (zypp::sat::Pool::instance().reposFind( repo.alias ()) == zypp::sat::Repo::norepo)
+ manager.loadFromCache (repo);
}
-// } catch (const zypp::repo::RepoNoAliasException &ex) {
-// } catch (const zypp::repo::RepoNotCachedException &ex) {
+ } catch (const zypp::repo::RepoNoAliasException &ex) {
+ fprintf (stderr, "Can't figure an alias to look in cache\n");
} catch (const zypp::Exception &ex) {
fprintf (stderr, "TODO: Handle exceptions: %s\n", ex.asUserString ().c_str ());
}
@@ -103,8 +109,8 @@ zypp_get_packages_by_name (const gchar *package_name, gboolean include_local)
zypp::ResPool pool = zypp_build_pool (include_local);
std::string name (package_name);
- for (zypp::ResPool::byName_iterator it = pool.byNameBegin (name);
- it != pool.byNameEnd (name); it++) {
+ for (zypp::ResPool::byIdent_iterator it = pool.byIdentBegin (zypp::ResKind::package, name);
+ it != pool.byIdentEnd (zypp::ResKind::package, name); it++) {
zypp::PoolItem item = (*it);
v->push_back (item);
}
diff --git a/backends/zypp/zypp-utils.h b/backends/zypp/zypp-utils.h
index 89ebdb9..7969cf5 100644
--- a/backends/zypp/zypp-utils.h
+++ b/backends/zypp/zypp-utils.h
@@ -23,7 +23,7 @@ typedef zypp::Pattern::constPtr ZyppPattern;
typedef zypp::Language::constPtr ZyppLanguage;
//inline ZyppPackage tryCastToZyppPkg (ZyppObject obj)
// { return zypp::dynamic_pointer_cast <const zypp::Package> (obj); }
-typedef std::set<zypp::PoolItem_Ref> Candidates;
+typedef std::set<zypp::PoolItem> Candidates;
zypp::ZYpp::Ptr get_zypp ();
commit 21f11d4d12c039dcea527b1d7cf52da48d0b62fd
Author: Richard Hughes <richard at hughsie.com>
Date: Tue Feb 19 10:54:11 2008 +0000
set a status call when we do RepoEnable to avoid a warning
diff --git a/backends/yum/helpers/yumBackend.py b/backends/yum/helpers/yumBackend.py
index 19813a1..68f8b99 100644
--- a/backends/yum/helpers/yumBackend.py
+++ b/backends/yum/helpers/yumBackend.py
@@ -1076,6 +1076,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
'''
Implement the {backend}-repo-enable functionality
'''
+ self.status(STATUS_SETUP)
try:
repo = self.yumbase.repos.getRepo(repoid)
if enable == 'false':
commit 0fde6a53abe89dca97d4e1542a5e0e11e97647cc
Author: Richard Hughes <richard at hughsie.com>
Date: Tue Feb 19 10:11:02 2008 +0000
try harder to get a translation when we have stored a base locale, not a region locale
diff --git a/libpackagekit/pk-extra.c b/libpackagekit/pk-extra.c
index 6c75638..6973063 100644
--- a/libpackagekit/pk-extra.c
+++ b/libpackagekit/pk-extra.c
@@ -60,6 +60,7 @@ struct PkExtraPrivate
{
gchar *database;
gchar *locale;
+ gchar *locale_base;
gchar *icon;
gchar *exec;
gchar *summary;
@@ -79,8 +80,25 @@ static gpointer pk_extra_object = NULL;
gboolean
pk_extra_set_locale (PkExtra *extra, const gchar *locale)
{
+ guint i;
g_free (extra->priv->locale);
extra->priv->locale = g_strdup (locale);
+ extra->priv->locale_base = g_strdup (locale);
+
+ /* we only want the first section to compare */
+ for (i=0; i<10; i++) {
+ if (extra->priv->locale_base[i] == '_') {
+ extra->priv->locale_base[i] = '\0';
+ pk_debug ("locale_base is '%s'", extra->priv->locale_base);
+ break;
+ }
+ }
+
+ /* no point doing it twice if they are the same */
+ if (pk_strequal (extra->priv->locale_base, extra->priv->locale) == TRUE) {
+ g_free (extra->priv->locale_base);
+ extra->priv->locale_base = NULL;
+ }
return TRUE;
}
@@ -127,18 +145,40 @@ pk_extra_detail_localised_callback (void *data, gint argc, gchar **argv, gchar *
}
/**
- * pk_extra_get_localised_detail:
+ * pk_extra_get_localised_detail_try:
* @extra: a valid #PkExtra instance
*
* Return value: the current locale
**/
-gboolean
-pk_extra_get_localised_detail (PkExtra *extra, const gchar *package, gchar **summary)
+static gboolean
+pk_extra_get_localised_detail_try (PkExtra *extra, const gchar *package, const gchar *locale)
{
gchar *statement;
gchar *error_msg = NULL;
gint rc;
+ statement = g_strdup_printf ("SELECT package, summary, locale FROM localised "
+ "WHERE package = '%s' AND locale = '%s'",
+ package, locale);
+ rc = sqlite3_exec (extra->priv->db, statement, pk_extra_detail_localised_callback, extra, &error_msg);
+ g_free (statement);
+ if (rc != SQLITE_OK) {
+ pk_warning ("SQL error: %s\n", error_msg);
+ sqlite3_free (error_msg);
+ return FALSE;
+ }
+ return TRUE;
+}
+
+/**
+ * pk_extra_get_localised_detail:
+ * @extra: a valid #PkExtra instance
+ *
+ * Return value: the current locale
+ **/
+gboolean
+pk_extra_get_localised_detail (PkExtra *extra, const gchar *package, gchar **summary)
+{
g_return_val_if_fail (extra != NULL, FALSE);
g_return_val_if_fail (PK_IS_EXTRA (extra), FALSE);
g_return_val_if_fail (extra->priv->locale != NULL, FALSE);
@@ -150,15 +190,12 @@ pk_extra_get_localised_detail (PkExtra *extra, const gchar *package, gchar **sum
return FALSE;
}
- statement = g_strdup_printf ("SELECT package, summary, locale FROM localised "
- "WHERE package = '%s' AND locale = '%s'",
- package, extra->priv->locale);
- rc = sqlite3_exec (extra->priv->db, statement, pk_extra_detail_localised_callback, extra, &error_msg);
- g_free (statement);
- if (rc != SQLITE_OK) {
- pk_warning ("SQL error: %s\n", error_msg);
- sqlite3_free (error_msg);
- return FALSE;
+ /* try with default locale */
+ pk_extra_get_localised_detail_try (extra, package, extra->priv->locale);
+
+ /* try harder with a base locale */
+ if (extra->priv->summary == NULL && extra->priv->locale_base != NULL) {
+ pk_extra_get_localised_detail_try (extra, package, extra->priv->locale_base);
}
if (summary != NULL) {
@@ -448,6 +485,7 @@ pk_extra_init (PkExtra *extra)
extra->priv = PK_EXTRA_GET_PRIVATE (extra);
extra->priv->database = NULL;
extra->priv->locale = NULL;
+ extra->priv->locale_base = NULL;
extra->priv->icon = NULL;
extra->priv->exec = NULL;
extra->priv->summary = NULL;
@@ -469,6 +507,7 @@ pk_extra_finalize (GObject *object)
g_free (extra->priv->exec);
g_free (extra->priv->summary);
g_free (extra->priv->locale);
+ g_free (extra->priv->locale_base);
sqlite3_close (extra->priv->db);
G_OBJECT_CLASS (pk_extra_parent_class)->finalize (object);
@@ -537,8 +576,8 @@ libst_extra (LibSelfTest *test)
}
/************************************************************/
- libst_title (test, "set locale");
- ret = pk_extra_set_locale (extra, "en_GB");
+ libst_title (test, "set locale explicit en");
+ ret = pk_extra_set_locale (extra, "en");
if (ret == TRUE) {
libst_success (test, NULL);
} else {
@@ -548,7 +587,7 @@ libst_extra (LibSelfTest *test)
/************************************************************/
libst_title (test, "get locale");
text = pk_extra_get_locale (extra);
- if (pk_strequal (text, "en_GB") == TRUE) {
+ if (pk_strequal (text, "en") == TRUE) {
libst_success (test, NULL);
} else {
libst_failed (test, "locale was %s", text);
@@ -571,7 +610,25 @@ libst_extra (LibSelfTest *test)
/************************************************************/
libst_title (test, "retrieve localised data");
ret = pk_extra_get_localised_detail (extra, "gnome-power-manager", &summary);
+ if (ret == TRUE && summary != NULL) {
+ libst_success (test, "%s", summary);
+ } else {
+ libst_failed (test, "failed!");
+ }
+
+ /************************************************************/
+ libst_title (test, "set locale implicit en_GB");
+ ret = pk_extra_set_locale (extra, "en_GB");
if (ret == TRUE) {
+ libst_success (test, NULL);
+ } else {
+ libst_failed (test, NULL);
+ }
+
+ /************************************************************/
+ libst_title (test, "retrieve localised data");
+ ret = pk_extra_get_localised_detail (extra, "gnome-power-manager", &summary);
+ if (ret == TRUE && summary != NULL) {
libst_success (test, "%s", summary);
} else {
libst_failed (test, "failed!");
commit 6438861dba26713c20df83a964e9c53a8fedc1b6
Author: Richard Hughes <richard at hughsie.com>
Date: Tue Feb 19 09:47:16 2008 +0000
merge a fix from the yum backend to yum2
diff --git a/backends/yum/helpers/yumBackend.py b/backends/yum/helpers/yumBackend.py
index 399df3c..19813a1 100644
--- a/backends/yum/helpers/yumBackend.py
+++ b/backends/yum/helpers/yumBackend.py
@@ -19,6 +19,7 @@
# Seth Vidal <skvidal at fedoraproject.org>
# Luke Macken <lmacken at redhat.com>
# James Bowes <jbowes at dangerouslyinc.com>
+# Robin Norwood <rnorwood at redhat.com>
# imports
diff --git a/backends/yum2/helpers/yumDBUSBackend.py b/backends/yum2/helpers/yumDBUSBackend.py
index b510ff0..6cdaba3 100755
--- a/backends/yum2/helpers/yumDBUSBackend.py
+++ b/backends/yum2/helpers/yumDBUSBackend.py
@@ -236,7 +236,6 @@ class PackageKitYumBackend(PackageKitBaseBackend):
def __init__(self, bus_name, dbus_path):
signal.signal(signal.SIGQUIT, sigquit)
-
PackageKitBaseBackend.__init__(self,
bus_name,
dbus_path)
@@ -289,7 +288,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
rc = unicode( txt, 'utf-8' )
except UnicodeDecodeError, e:
rc = unicode( txt, 'iso-8859-1' )
- return rc
+ return rc.encode('utf-8')
def _pkg_to_id(self,pkg):
pkgver = self._get_package_ver(pkg)
commit 1600d91469cfb3f46020bc8c502fcaab0e2036d8
Author: Richard Hughes <richard at hughsie.com>
Date: Tue Feb 19 09:40:36 2008 +0000
correct the RefreshCache method for yum2
diff --git a/backends/apt2/aptDBUSBackend.py b/backends/apt2/aptDBUSBackend.py
index e346454..998b4dc 100755
--- a/backends/apt2/aptDBUSBackend.py
+++ b/backends/apt2/aptDBUSBackend.py
@@ -383,7 +383,7 @@ class PackageKitAptBackend(PackageKitBaseBackend):
self.error(ERROR_NOT_SUPPORTED,
"This function is not implemented in this backend")
- def refresh_cache(self):
+ def refresh_cache(self, force):
'''
Implement the {backend}-refresh_cache functionality
'''
diff --git a/backends/yum2/helpers/yumDBUSBackend.py b/backends/yum2/helpers/yumDBUSBackend.py
index c62795e..b510ff0 100755
--- a/backends/yum2/helpers/yumDBUSBackend.py
+++ b/backends/yum2/helpers/yumDBUSBackend.py
@@ -559,8 +559,8 @@ class PackageKitYumBackend(PackageKitBaseBackend):
self.Finished(EXIT_SUCCESS)
@dbus.service.method(PACKAGEKIT_DBUS_INTERFACE,
- in_signature='', out_signature='')
- def RefreshCache(self):
+ in_signature='b', out_signature='')
+ def RefreshCache(self, force):
'''
Implement the {backend}-refresh_cache functionality
'''
diff --git a/python/packagekit/daemonBackend.py b/python/packagekit/daemonBackend.py
index f369aa2..5f6db8c 100644
--- a/python/packagekit/daemonBackend.py
+++ b/python/packagekit/daemonBackend.py
@@ -266,8 +266,8 @@ class PackageKitBaseBackend(dbus.service.Object):
# self.Exit()
#
# @dbus.service.method(PACKAGEKIT_DBUS_INTERFACE,
-# in_signature='', out_signature='')
-# def RefreshCache(self):
+# in_signature='b', out_signature='')
+# def RefreshCache(self, force):
# '''
# Implement the {backend}-refresh_cache functionality
# '''
commit 4c79829eb3dc4bbd0761b155bf302799ba249eb8
Author: Richard Hughes <richard at hughsie.com>
Date: Tue Feb 19 01:23:18 2008 +0000
remove non-required trailing commas
diff --git a/libgbus/libgbus.c b/libgbus/libgbus.c
index 737762f..119db8b 100644
--- a/libgbus/libgbus.c
+++ b/libgbus/libgbus.c
@@ -50,7 +50,7 @@ enum {
LAST_SIGNAL
};
-static guint signals [LAST_SIGNAL] = { 0, };
+static guint signals [LAST_SIGNAL] = { 0 };
G_DEFINE_TYPE (LibGBus, libgbus, G_TYPE_OBJECT)
diff --git a/libpackagekit/pk-client.c b/libpackagekit/pk-client.c
index bf4515c..0d0816a 100644
--- a/libpackagekit/pk-client.c
+++ b/libpackagekit/pk-client.c
@@ -109,7 +109,7 @@ typedef enum {
PK_CLIENT_LAST_SIGNAL
} PkSignals;
-static guint signals [PK_CLIENT_LAST_SIGNAL] = { 0, };
+static guint signals [PK_CLIENT_LAST_SIGNAL] = { 0 };
G_DEFINE_TYPE (PkClient, pk_client, G_TYPE_OBJECT)
diff --git a/libpackagekit/pk-connection.c b/libpackagekit/pk-connection.c
index f405160..6c4b997 100644
--- a/libpackagekit/pk-connection.c
+++ b/libpackagekit/pk-connection.c
@@ -64,7 +64,7 @@ enum {
LAST_SIGNAL
};
-static guint signals [LAST_SIGNAL] = { 0, };
+static guint signals [LAST_SIGNAL] = { 0 };
static gpointer pk_connection_object = NULL;
G_DEFINE_TYPE (PkConnection, pk_connection, G_TYPE_OBJECT)
diff --git a/libpackagekit/pk-enum.c b/libpackagekit/pk-enum.c
index 2c89798..cf8aa09 100644
--- a/libpackagekit/pk-enum.c
+++ b/libpackagekit/pk-enum.c
@@ -44,7 +44,7 @@ static PkEnumMatch enum_exit[] = {
{PK_EXIT_ENUM_FAILED, "failed"},
{PK_EXIT_ENUM_QUIT, "quit"},
{PK_EXIT_ENUM_KILL, "kill"},
- {0, NULL},
+ {0, NULL}
};
static PkEnumMatch enum_status[] = {
@@ -66,7 +66,7 @@ static PkEnumMatch enum_status[] = {
{PK_STATUS_ENUM_REQUEST, "request"},
{PK_STATUS_ENUM_FINISHED, "finished"},
{PK_STATUS_ENUM_CANCEL, "cancel"},
- {0, NULL},
+ {0, NULL}
};
static PkEnumMatch enum_role[] = {
@@ -94,7 +94,7 @@ static PkEnumMatch enum_role[] = {
{PK_ROLE_ENUM_REPO_ENABLE, "repo-enable"},
{PK_ROLE_ENUM_REPO_SET_DATA, "repo-set-data"},
{PK_ROLE_ENUM_SERVICE_PACK, "service-pack"},
- {0, NULL},
+ {0, NULL}
};
static PkEnumMatch enum_error[] = {
@@ -122,7 +122,7 @@ static PkEnumMatch enum_error[] = {
{PK_ERROR_ENUM_FAILED_INITIALIZATION, "failed-initialization"},
{PK_ERROR_ENUM_FAILED_FINALISE, "failed-finalise"},
{PK_ERROR_ENUM_FAILED_CONFIG_PARSING, "failed-config-parsing"},
- {0, NULL},
+ {0, NULL}
};
static PkEnumMatch enum_restart[] = {
@@ -131,7 +131,7 @@ static PkEnumMatch enum_restart[] = {
{PK_RESTART_ENUM_SYSTEM, "system"},
{PK_RESTART_ENUM_SESSION, "session"},
{PK_RESTART_ENUM_APPLICATION, "application"},
- {0, NULL},
+ {0, NULL}
};
static PkEnumMatch enum_message[] = {
@@ -139,7 +139,7 @@ static PkEnumMatch enum_message[] = {
{PK_MESSAGE_ENUM_NOTICE, "notice"},
{PK_MESSAGE_ENUM_WARNING, "warning"},
{PK_MESSAGE_ENUM_DAEMON, "daemon"},
- {0, NULL},
+ {0, NULL}
};
static PkEnumMatch enum_filter[] = {
@@ -157,7 +157,7 @@ static PkEnumMatch enum_filter[] = {
{PK_FILTER_ENUM_NOT_FREE, "~free"},
{PK_FILTER_ENUM_NOT_VISIBLE, "~visible"},
{PK_FILTER_ENUM_NOT_SUPPORTED, "~supported"},
- {0, NULL},
+ {0, NULL}
};
static PkEnumMatch enum_group[] = {
@@ -190,7 +190,7 @@ static PkEnumMatch enum_group[] = {
{PK_GROUP_ENUM_NETWORK, "network"},
{PK_GROUP_ENUM_MAPS, "maps"},
{PK_GROUP_ENUM_REPOS, "repos"},
- {0, NULL},
+ {0, NULL}
};
static PkEnumMatch enum_freq[] = {
@@ -199,7 +199,7 @@ static PkEnumMatch enum_freq[] = {
{PK_FREQ_ENUM_DAILY, "daily"},
{PK_FREQ_ENUM_WEEKLY, "weekly"},
{PK_FREQ_ENUM_NEVER, "never"},
- {0, NULL},
+ {0, NULL}
};
static PkEnumMatch enum_update[] = {
@@ -207,7 +207,7 @@ static PkEnumMatch enum_update[] = {
{PK_UPDATE_ENUM_ALL, "all"},
{PK_UPDATE_ENUM_SECURITY, "security"},
{PK_UPDATE_ENUM_NONE, "none"},
- {0, NULL},
+ {0, NULL}
};
static PkEnumMatch enum_info[] = {
@@ -227,13 +227,13 @@ static PkEnumMatch enum_info[] = {
{PK_INFO_ENUM_REMOVING, "removing"},
{PK_INFO_ENUM_CLEANUP, "cleanup"},
{PK_INFO_ENUM_OBSOLETING, "obsoleting"},
- {0, NULL},
+ {0, NULL}
};
static PkEnumMatch enum_sig_type[] = {
{PK_SIGTYPE_ENUM_UNKNOWN, "unknown"}, /* fall though value */
{PK_SIGTYPE_ENUM_GPG, "gpg"},
- {0, NULL},
+ {0, NULL}
};
static PkEnumMatch enum_free_licenses[] = {
@@ -353,7 +353,7 @@ static PkEnumMatch enum_free_licenses[] = {
{PK_LICENSE_ENUM_MPLUS, "mplus"},
{PK_LICENSE_ENUM_STIX, "STIX"},
{PK_LICENSE_ENUM_XANO, "XANO"},
- {0, NULL},
+ {0, NULL}
};
diff --git a/libpackagekit/pk-job-list.c b/libpackagekit/pk-job-list.c
index 345f5aa..06b05df 100644
--- a/libpackagekit/pk-job-list.c
+++ b/libpackagekit/pk-job-list.c
@@ -71,7 +71,7 @@ typedef enum {
PK_JOB_LIST_LAST_SIGNAL
} PkSignals;
-static guint signals [PK_JOB_LIST_LAST_SIGNAL] = { 0, };
+static guint signals [PK_JOB_LIST_LAST_SIGNAL] = { 0 };
G_DEFINE_TYPE (PkJobList, pk_job_list, G_TYPE_OBJECT)
diff --git a/libpackagekit/pk-network-dummy.c b/libpackagekit/pk-network-dummy.c
index 5616c8b..94a1dbf 100644
--- a/libpackagekit/pk-network-dummy.c
+++ b/libpackagekit/pk-network-dummy.c
@@ -68,7 +68,7 @@ enum {
PK_NETWORK_LAST_SIGNAL
};
-static guint signals [PK_NETWORK_LAST_SIGNAL] = { 0, };
+static guint signals [PK_NETWORK_LAST_SIGNAL] = { 0 };
static gpointer pk_network_object = NULL;
G_DEFINE_TYPE (PkNetwork, pk_network, G_TYPE_OBJECT)
diff --git a/libpackagekit/pk-network-nm.c b/libpackagekit/pk-network-nm.c
index 9576c23..617dd70 100644
--- a/libpackagekit/pk-network-nm.c
+++ b/libpackagekit/pk-network-nm.c
@@ -65,7 +65,7 @@ enum {
PK_NETWORK_LAST_SIGNAL
};
-static guint signals [PK_NETWORK_LAST_SIGNAL] = { 0, };
+static guint signals [PK_NETWORK_LAST_SIGNAL] = { 0 };
static gpointer pk_network_object = NULL;
G_DEFINE_TYPE (PkNetwork, pk_network, G_TYPE_OBJECT)
diff --git a/libpackagekit/pk-task-list.c b/libpackagekit/pk-task-list.c
index 2901cce..9b267c1 100644
--- a/libpackagekit/pk-task-list.c
+++ b/libpackagekit/pk-task-list.c
@@ -70,7 +70,7 @@ typedef enum {
PK_TASK_LIST_LAST_SIGNAL
} PkSignals;
-static guint signals [PK_TASK_LIST_LAST_SIGNAL] = { 0, };
+static guint signals [PK_TASK_LIST_LAST_SIGNAL] = { 0 };
G_DEFINE_TYPE (PkTaskList, pk_task_list, G_TYPE_OBJECT)
diff --git a/src/pk-backend.c b/src/pk-backend.c
index cb02559..ff7f596 100644
--- a/src/pk-backend.c
+++ b/src/pk-backend.c
@@ -88,7 +88,7 @@ enum {
PK_BACKEND_LAST_SIGNAL
};
-static guint signals [PK_BACKEND_LAST_SIGNAL] = { 0, };
+static guint signals [PK_BACKEND_LAST_SIGNAL] = { 0 };
/**
* pk_backend_build_library_path:
diff --git a/src/pk-engine.c b/src/pk-engine.c
index 4d98b3d..98583d6 100644
--- a/src/pk-engine.c
+++ b/src/pk-engine.c
@@ -100,7 +100,7 @@ enum {
PK_ENGINE_LAST_SIGNAL
};
-static guint signals [PK_ENGINE_LAST_SIGNAL] = { 0, };
+static guint signals [PK_ENGINE_LAST_SIGNAL] = { 0 };
G_DEFINE_TYPE (PkEngine, pk_engine, G_TYPE_OBJECT)
diff --git a/src/pk-inhibit.c b/src/pk-inhibit.c
index 99764b1..9b88e0e 100644
--- a/src/pk-inhibit.c
+++ b/src/pk-inhibit.c
@@ -56,7 +56,7 @@ enum {
};
static gpointer pk_inhibit_object = NULL;
-static guint signals [PK_INHIBIT_LAST_SIGNAL] = { 0, };
+static guint signals [PK_INHIBIT_LAST_SIGNAL] = { 0 };
G_DEFINE_TYPE (PkInhibit, pk_inhibit, G_TYPE_OBJECT)
diff --git a/src/pk-runner.c b/src/pk-runner.c
index f8ff1a4..a448f0e 100644
--- a/src/pk-runner.c
+++ b/src/pk-runner.c
@@ -99,7 +99,7 @@ enum {
PK_RUNNER_LAST_SIGNAL
};
-static guint signals [PK_RUNNER_LAST_SIGNAL] = { 0, };
+static guint signals [PK_RUNNER_LAST_SIGNAL] = { 0 };
/**
* pk_runner_get_package_list:
diff --git a/src/pk-spawn.c b/src/pk-spawn.c
index d848cc8..db7d709 100644
--- a/src/pk-spawn.c
+++ b/src/pk-spawn.c
@@ -76,7 +76,7 @@ enum {
PK_SPAWN_LAST_SIGNAL
};
-static guint signals [PK_SPAWN_LAST_SIGNAL] = { 0, };
+static guint signals [PK_SPAWN_LAST_SIGNAL] = { 0 };
G_DEFINE_TYPE (PkSpawn, pk_spawn, G_TYPE_OBJECT)
diff --git a/src/pk-transaction-db.c b/src/pk-transaction-db.c
index e995b79..f7ba9a7 100644
--- a/src/pk-transaction-db.c
+++ b/src/pk-transaction-db.c
@@ -58,7 +58,7 @@ enum {
PK_TRANSACTION_DB_LAST_SIGNAL
};
-static guint signals [PK_TRANSACTION_DB_LAST_SIGNAL] = { 0, };
+static guint signals [PK_TRANSACTION_DB_LAST_SIGNAL] = { 0 };
G_DEFINE_TYPE (PkTransactionDb, pk_transaction_db, G_TYPE_OBJECT)
diff --git a/src/pk-transaction-list.c b/src/pk-transaction-list.c
index c06626d..f18d2d1 100644
--- a/src/pk-transaction-list.c
+++ b/src/pk-transaction-list.c
@@ -58,7 +58,7 @@ enum {
PK_TRANSACTION_LIST_LAST_SIGNAL
};
-static guint signals [PK_TRANSACTION_LIST_LAST_SIGNAL] = { 0, };
+static guint signals [PK_TRANSACTION_LIST_LAST_SIGNAL] = { 0 };
G_DEFINE_TYPE (PkTransactionList, pk_transaction_list, G_TYPE_OBJECT)
commit 78e0d9b866e77a57261783d31d1bfd15454db895
Author: Richard Hughes <richard at hughsie.com>
Date: Tue Feb 19 01:02:00 2008 +0000
add finalizer for libgbus
diff --git a/libgbus/libgbus.c b/libgbus/libgbus.c
index d15181e..737762f 100644
--- a/libgbus/libgbus.c
+++ b/libgbus/libgbus.c
@@ -224,6 +224,7 @@ libgbus_finalize (GObject *object)
if (libgbus->priv->proxy != NULL) {
g_object_unref (libgbus->priv->proxy);
}
+ G_OBJECT_CLASS (libgbus_parent_class)->finalize (object);
}
/**
commit 1f12fda1b096d6659b1a230ce5b1ab2f1a86b81e
Author: Richard Hughes <richard at hughsie.com>
Date: Tue Feb 19 00:54:02 2008 +0000
fix some return types
diff --git a/libpackagekit/pk-client.c b/libpackagekit/pk-client.c
index 3437f8f..bf4515c 100644
--- a/libpackagekit/pk-client.c
+++ b/libpackagekit/pk-client.c
@@ -324,8 +324,8 @@ pk_client_package_buffer_get_size (PkClient *client)
PkPackageItem *
pk_client_package_buffer_get_item (PkClient *client, guint item)
{
- g_return_val_if_fail (client != NULL, FALSE);
- g_return_val_if_fail (PK_IS_CLIENT (client), FALSE);
+ g_return_val_if_fail (client != NULL, NULL);
+ g_return_val_if_fail (PK_IS_CLIENT (client), NULL);
if (client->priv->use_buffer == FALSE) {
return NULL;
}
@@ -2460,8 +2460,8 @@ pk_client_get_actions (PkClient *client)
gchar *actions;
PkEnumList *elist;
- g_return_val_if_fail (client != NULL, FALSE);
- g_return_val_if_fail (PK_IS_CLIENT (client), FALSE);
+ g_return_val_if_fail (client != NULL, NULL);
+ g_return_val_if_fail (PK_IS_CLIENT (client), NULL);
elist = pk_enum_list_new ();
pk_enum_list_set_type (elist, PK_ENUM_LIST_TYPE_ROLE);
@@ -2593,8 +2593,8 @@ pk_client_get_groups (PkClient *client)
gchar *groups;
PkEnumList *elist;
- g_return_val_if_fail (client != NULL, FALSE);
- g_return_val_if_fail (PK_IS_CLIENT (client), FALSE);
+ g_return_val_if_fail (client != NULL, NULL);
+ g_return_val_if_fail (PK_IS_CLIENT (client), NULL);
elist = pk_enum_list_new ();
pk_enum_list_set_type (elist, PK_ENUM_LIST_TYPE_GROUP);
@@ -2662,8 +2662,8 @@ pk_client_get_filters (PkClient *client)
gchar *filters;
PkEnumList *elist;
- g_return_val_if_fail (client != NULL, FALSE);
- g_return_val_if_fail (PK_IS_CLIENT (client), FALSE);
+ g_return_val_if_fail (client != NULL, NULL);
+ g_return_val_if_fail (PK_IS_CLIENT (client), NULL);
elist = pk_enum_list_new ();
pk_enum_list_set_type (elist, PK_ENUM_LIST_TYPE_FILTER);
diff --git a/libpackagekit/pk-extra.c b/libpackagekit/pk-extra.c
index 4ce7317..6c75638 100644
--- a/libpackagekit/pk-extra.c
+++ b/libpackagekit/pk-extra.c
@@ -108,7 +108,7 @@ pk_extra_detail_localised_callback (void *data, gint argc, gchar **argv, gchar *
gchar *value;
g_return_val_if_fail (extra != NULL, 0);
- g_return_val_if_fail (PK_IS_EXTRA (extra), FALSE);
+ g_return_val_if_fail (PK_IS_EXTRA (extra), 0);
for (i=0; i<argc; i++) {
col = col_name[i];
@@ -182,7 +182,7 @@ pk_extra_detail_package_callback (void *data, gint argc, gchar **argv, gchar **c
gchar *value;
g_return_val_if_fail (extra != NULL, 0);
- g_return_val_if_fail (PK_IS_EXTRA (extra), FALSE);
+ g_return_val_if_fail (PK_IS_EXTRA (extra), 0);
for (i=0; i<argc; i++) {
col = col_name[i];
diff --git a/libpackagekit/pk-job-list.c b/libpackagekit/pk-job-list.c
index 82c3590..345f5aa 100644
--- a/libpackagekit/pk-job-list.c
+++ b/libpackagekit/pk-job-list.c
@@ -144,8 +144,8 @@ pk_job_list_refresh (PkJobList *jlist)
const gchar **
pk_job_list_get_latest (PkJobList *jlist)
{
- g_return_val_if_fail (jlist != NULL, FALSE);
- g_return_val_if_fail (PK_IS_JOB_LIST (jlist), FALSE);
+ g_return_val_if_fail (jlist != NULL, NULL);
+ g_return_val_if_fail (PK_IS_JOB_LIST (jlist), NULL);
return (const gchar **) jlist->priv->array;
}
diff --git a/src/pk-backend-spawn.c b/src/pk-backend-spawn.c
index c33489c..a934cb3 100644
--- a/src/pk-backend-spawn.c
+++ b/src/pk-backend-spawn.c
@@ -498,7 +498,7 @@ pk_backend_spawn_helper_internal (PkBackendSpawn *backend_spawn, const gchar *sc
const gchar *
pk_backend_spawn_get_name (PkBackendSpawn *backend_spawn)
{
- g_return_val_if_fail (backend_spawn != NULL, FALSE);
+ g_return_val_if_fail (backend_spawn != NULL, NULL);
return backend_spawn->priv->name;
}
diff --git a/src/pk-backend.c b/src/pk-backend.c
index 1410f12..cb02559 100644
--- a/src/pk-backend.c
+++ b/src/pk-backend.c
@@ -100,7 +100,7 @@ pk_backend_build_library_path (PkBackend *backend)
gchar *filename;
g_return_val_if_fail (backend != NULL, NULL);
- g_return_val_if_fail (PK_IS_BACKEND (backend), FALSE);
+ g_return_val_if_fail (PK_IS_BACKEND (backend), NULL);
filename = g_strdup_printf ("libpk_backend_%s.so", backend->priv->name);
#if PK_BUILD_LOCAL
@@ -881,7 +881,7 @@ pk_backend_get_current_tid (PkBackend *backend)
{
g_return_val_if_fail (backend != NULL, NULL);
g_return_val_if_fail (PK_IS_BACKEND (backend), NULL);
- g_return_val_if_fail (backend->priv->locked != FALSE, FALSE);
+ g_return_val_if_fail (backend->priv->locked != FALSE, NULL);
return backend->priv->c_tid;
}
commit e550ecbcaf9a0ab0329b5bd4febcce5f7942dbb8
Author: Richard Hughes <richard at hughsie.com>
Date: Tue Feb 19 00:50:19 2008 +0000
remove missing file from POTFILES.in
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 949f201..ac2f4e4 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -1,5 +1,4 @@
[encoding: UTF-8]
# List of source files containing translatable strings.
# Please keep this file sorted alphabetically.
-client/pk-update-icon.desktop.in
More information about the PackageKit
mailing list