diff options
author | Denys Dmytriyenko <denis@denix.org> | 2009-03-17 14:32:59 -0400 |
---|---|---|
committer | Denys Dmytriyenko <denis@denix.org> | 2009-03-17 14:32:59 -0400 |
commit | 709c4d66e0b107ca606941b988bad717c0b45d9b (patch) | |
tree | 37ee08b1eb308f3b2b6426d5793545c38396b838 /recipes/packagekit | |
parent | fa6cd5a3b993f16c27de4ff82b42684516d433ba (diff) |
rename packages/ to recipes/ per earlier agreement
See links below for more details:
http://thread.gmane.org/gmane.comp.handhelds.openembedded/21326
http://thread.gmane.org/gmane.comp.handhelds.openembedded/21816
Signed-off-by: Denys Dmytriyenko <denis@denix.org>
Acked-by: Mike Westerhof <mwester@dls.net>
Acked-by: Philip Balister <philip@balister.org>
Acked-by: Khem Raj <raj.khem@gmail.com>
Acked-by: Marcin Juszkiewicz <hrw@openembedded.org>
Acked-by: Koen Kooi <koen@openembedded.org>
Acked-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Diffstat (limited to 'recipes/packagekit')
-rw-r--r-- | recipes/packagekit/files/disable-docbook2man.patch | 12 | ||||
-rw-r--r-- | recipes/packagekit/files/force_depends.patch | 20 | ||||
-rw-r--r-- | recipes/packagekit/files/modify_summary_and_adding_reposi_info.patch | 69 | ||||
-rw-r--r-- | recipes/packagekit/files/racing_condition.patch | 244 | ||||
-rw-r--r-- | recipes/packagekit/files/remove_search_memory_leak.patch | 51 | ||||
-rw-r--r-- | recipes/packagekit/files/repository-ping.patch | 243 | ||||
-rw-r--r-- | recipes/packagekit/gnome-packagekit_0.2.5.bb | 17 | ||||
-rw-r--r-- | recipes/packagekit/packagekit_0.2.4.bb | 39 | ||||
-rw-r--r-- | recipes/packagekit/packagekit_git.bb | 42 |
9 files changed, 737 insertions, 0 deletions
diff --git a/recipes/packagekit/files/disable-docbook2man.patch b/recipes/packagekit/files/disable-docbook2man.patch new file mode 100644 index 0000000000..0c7d4239d4 --- /dev/null +++ b/recipes/packagekit/files/disable-docbook2man.patch @@ -0,0 +1,12 @@ +Index: git/configure.ac +=================================================================== +--- git.orig/configure.ac 2008-02-20 17:57:44.000000000 +0800 ++++ git/configure.ac 2008-02-20 17:58:30.000000000 +0800 +@@ -115,6 +115,7 @@ + if test "$DOCBOOK2MAN" = "no" ; then + AC_MSG_WARN([docbook2man not found, will not be able to build man documentation]) + fi ++DOCBOOK2MAN="no" + AM_CONDITIONAL(HAVE_DOCBOOK2MAN, [test "$DOCBOOK2MAN" != "no"]) + + dnl --------------------------------------------------------------------------- diff --git a/recipes/packagekit/files/force_depends.patch b/recipes/packagekit/files/force_depends.patch new file mode 100644 index 0000000000..c0a5b0d805 --- /dev/null +++ b/recipes/packagekit/files/force_depends.patch @@ -0,0 +1,20 @@ +diff --git a/backends/opkg/pk-backend-opkg.c b/backends/opkg/pk-backend-opkg.c +index a20769f..0b9867e 100644 +--- a/backends/opkg/pk-backend-opkg.c ++++ b/backends/opkg/pk-backend-opkg.c +@@ -451,6 +451,7 @@ backend_remove_packages_thread (PkBackend *backend) + gchar **package_ids; + gboolean allow_deps; + gboolean autoremove; ++ gboolean force_depends=!!1; + gpointer *data; + + data = pk_backend_get_pointer (backend, "remove-params"); +@@ -462,6 +463,7 @@ backend_remove_packages_thread (PkBackend *backend) + + opkg_set_option (opkg, "autoremove", &autoremove); + opkg_set_option (opkg, "force_removal_of_dependent_packages", &allow_deps); ++ opkg_set_option (opkg, "force_depends", &force_depends); + + err = 0; + diff --git a/recipes/packagekit/files/modify_summary_and_adding_reposi_info.patch b/recipes/packagekit/files/modify_summary_and_adding_reposi_info.patch new file mode 100644 index 0000000000..43da548d8e --- /dev/null +++ b/recipes/packagekit/files/modify_summary_and_adding_reposi_info.patch @@ -0,0 +1,69 @@ +diff --git a/backends/opkg/pk-backend-opkg.c b/backends/opkg/pk-backend-opkg.c +index 9e71b90..92da8b0 100644 +--- a/backends/opkg/pk-backend-opkg.c ++++ b/backends/opkg/pk-backend-opkg.c +@@ -281,6 +281,7 @@ pk_opkg_package_list_cb (opkg_t *opkg, opkg_package_t *pkg, void *data) + { + SearchParams *params; + gchar *uid; ++ gchar *summary; + gchar *haystack; + gint status, match; + PkFilterEnum filters; +@@ -327,8 +328,14 @@ pk_opkg_package_list_cb (opkg_t *opkg, opkg_package_t *pkg, void *data) + break; + } + +- uid = g_strdup_printf ("%s;%s;%s;", +- pkg->name, pkg->version, pkg->architecture); ++ uid = g_strdup_printf ("%s;%s;%s;%s", ++ pkg->name, pkg->version, pkg->architecture, pkg->repository); ++ ++ if (!pkg->tags) ++ summary = g_strdup_printf("%s", pkg->description); ++ else ++ summary = g_strdup_printf("%s ;; %s", pkg->tags, pkg->description); ++ + + if (pkg->installed) + status = PK_INFO_ENUM_INSTALLED; +@@ -350,10 +357,11 @@ pk_opkg_package_list_cb (opkg_t *opkg, opkg_package_t *pkg, void *data) + if ((filters & PK_FILTER_ENUM_NOT_INSTALLED) && (pkg->installed)) + goto end_handle; + +- pk_backend_package (params->backend, status, uid, pkg->description); ++ pk_backend_package (params->backend, status, uid, summary); + + end_handle: + g_free(uid); ++ g_free(summary); + } + + static gboolean +@@ -713,6 +721,7 @@ backend_get_details_thread (PkBackend *backend) + int group_index; + PkGroupEnum group = 0; + opkg_package_t *pkg; ++ gchar *summary; + gchar *newid; + + package_id = pk_backend_get_string (backend, "package_id"); +@@ -746,13 +755,17 @@ backend_get_details_thread (PkBackend *backend) + if (opkg_check_tag(pkg, (gchar *)pk_group_enum_to_text(group))) + break; + } ++ summary = g_strdup_printf("%s ;; %s", pkg->tags, pkg->description); + } ++ else ++ summary = g_strdup_printf("%s", pkg->description); + +- pk_backend_details (backend, newid, NULL, group, pkg->description, pkg->url, pkg->size); ++ pk_backend_details (backend, newid, NULL, group, summary, pkg->url, pkg->size); + pk_backend_finished (backend); + opkg_thread_unlock(); + + g_free (newid); ++ g_free (summary); + opkg_package_free(pkg); + return TRUE; + } diff --git a/recipes/packagekit/files/racing_condition.patch b/recipes/packagekit/files/racing_condition.patch new file mode 100644 index 0000000000..ae127da861 --- /dev/null +++ b/recipes/packagekit/files/racing_condition.patch @@ -0,0 +1,244 @@ +diff --git a/backends/opkg/pk-backend-opkg.c b/backends/opkg/pk-backend-opkg.c +index a7b5244..9e71b90 100644 +--- a/backends/opkg/pk-backend-opkg.c ++++ b/backends/opkg/pk-backend-opkg.c +@@ -20,6 +20,7 @@ + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + ++#include <unistd.h> + #include <gmodule.h> + #include <glib.h> + #include <string.h> +@@ -47,6 +48,22 @@ typedef struct { + PkBackend *backend; + } SearchParams; + ++static int __opkg_lock__ = 0; ++static inline void opkg_thread_lock() ++{ ++ while ( __opkg_lock__ ) ++ usleep(500); ++ __opkg_lock__ = 1; ++} ++ ++static inline void opkg_thread_unlock() ++{ ++ if (! __opkg_lock__ ) { ++ pk_debug("Warning: opkg_thread_unlock without lock before!!\n"); ++ } ++ __opkg_lock__ = 0; ++} ++ + static void + opkg_unknown_error (PkBackend *backend, gint error_code, gchar *failed_cmd) + { +@@ -236,6 +253,7 @@ backend_refresh_cache_thread (PkBackend *backend) + opkg_unknown_error (backend, ret, "Refreshing cache"); + } + pk_backend_finished (backend); ++ opkg_thread_unlock(); + + return (ret == 0); + } +@@ -246,6 +264,7 @@ backend_refresh_cache_thread (PkBackend *backend) + static void + backend_refresh_cache (PkBackend *backend, gboolean force) + { ++ opkg_thread_lock(); + pk_backend_set_status (backend, PK_STATUS_ENUM_REFRESH_CACHE); + pk_backend_set_percentage (backend, PK_BACKEND_PERCENTAGE_INVALID); + +@@ -260,15 +279,26 @@ backend_refresh_cache (PkBackend *backend, gboolean force) + static void + pk_opkg_package_list_cb (opkg_t *opkg, opkg_package_t *pkg, void *data) + { +- SearchParams *params = (SearchParams*) data; ++ SearchParams *params; + gchar *uid; + gchar *haystack; + gint status, match; +- PkFilterEnum filters = params->filters; ++ PkFilterEnum filters; + ++ if (!opkg) { ++ pk_debug("opkg is NULL!!\n"); ++ return; ++ } ++ if (!data) { ++ pk_debug("data is NULL!!\n"); ++ return; ++ } + if (!pkg->name) + return; + ++ params = (SearchParams*) data; ++ filters = params->filters; ++ + switch (params->search_type) + { + case SEARCH_NAME: +@@ -336,6 +366,7 @@ backend_search_thread (PkBackend *backend) + opkg_list_packages (opkg, pk_opkg_package_list_cb, params); + + pk_backend_finished (params->backend); ++ opkg_thread_unlock(); + + g_free (params->needle); + g_free (params); +@@ -348,6 +379,7 @@ backend_search_name (PkBackend *backend, PkFilterEnum filters, const gchar *sear + { + SearchParams *params; + ++ opkg_thread_lock(); + + pk_backend_set_status (backend, PK_STATUS_ENUM_QUERY); + pk_backend_set_percentage (backend, PK_BACKEND_PERCENTAGE_INVALID); +@@ -370,6 +402,7 @@ backend_search_description (PkBackend *backend, PkFilterEnum filters, const gcha + { + SearchParams *params; + ++ opkg_thread_lock(); + + pk_backend_set_status (backend, PK_STATUS_ENUM_QUERY); + pk_backend_set_percentage (backend, PK_BACKEND_PERCENTAGE_INVALID); +@@ -389,6 +422,7 @@ backend_search_group (PkBackend *backend, PkFilterEnum filters, const gchar *sea + { + SearchParams *params; + ++ opkg_thread_lock(); + + pk_backend_set_status (backend, PK_STATUS_ENUM_QUERY); + pk_backend_set_percentage (backend, PK_BACKEND_PERCENTAGE_INVALID); +@@ -431,12 +465,15 @@ backend_install_packages_thread (PkBackend *backend) + } + + pk_backend_finished (backend); ++ opkg_thread_unlock(); + return (err == 0); + } + + static void + backend_install_packages (PkBackend *backend, gchar **package_ids) + { ++ opkg_thread_lock(); ++ + pk_backend_set_percentage (backend, PK_BACKEND_PERCENTAGE_INVALID); + pk_backend_set_status (backend, PK_STATUS_ENUM_INSTALL); + +@@ -493,6 +530,7 @@ backend_remove_packages_thread (PkBackend *backend) + } + + pk_backend_finished (backend); ++ opkg_thread_unlock(); + return (err == 0); + } + +@@ -500,6 +538,8 @@ static void + backend_remove_packages (PkBackend *backend, gchar **package_ids, gboolean allow_deps, gboolean autoremove) + { + gpointer *params; ++ ++ opkg_thread_lock(); + + pk_backend_set_status (backend, PK_STATUS_ENUM_REMOVE); + pk_backend_set_percentage (backend, PK_BACKEND_PERCENTAGE_INVALID); +@@ -540,12 +580,15 @@ backend_update_system_thread (PkBackend *backend) + opkg_unknown_error (backend, err, "Upgrading system"); + + pk_backend_finished (backend); ++ opkg_thread_unlock(); + return (err != 0); + } + + static void + backend_update_system (PkBackend *backend) + { ++ opkg_thread_lock(); ++ + pk_backend_set_status (backend, PK_STATUS_ENUM_UPDATE); + pk_backend_set_percentage (backend, PK_BACKEND_PERCENTAGE_INVALID); + +@@ -571,6 +614,7 @@ backend_update_package_thread (PkBackend *backend) + "Package not found"); + pk_package_id_free (pi); + pk_backend_finished (backend); ++ opkg_thread_unlock(); + return FALSE; + } + +@@ -581,6 +625,7 @@ backend_update_package_thread (PkBackend *backend) + + pk_package_id_free (pi); + pk_backend_finished (backend); ++ opkg_thread_unlock(); + return (err != 0); + } + +@@ -589,10 +634,12 @@ backend_update_packages (PkBackend *backend, gchar **package_ids) + { + gint i; + +- pk_backend_set_status (backend, PK_STATUS_ENUM_UPDATE); +- pk_backend_set_percentage (backend, PK_BACKEND_PERCENTAGE_INVALID); +- + for (i = 0; package_ids[i]; i++) { ++ ++ opkg_thread_lock(); ++ ++ pk_backend_set_status (backend, PK_STATUS_ENUM_UPDATE); ++ pk_backend_set_percentage (backend, PK_BACKEND_PERCENTAGE_INVALID); + pk_backend_set_string (backend, "pkgid", package_ids[i]); + pk_backend_thread_create (backend, backend_update_package_thread); + } +@@ -626,12 +673,14 @@ backend_get_updates_thread (PkBackend *backend) + { + opkg_list_upgradable_packages (opkg, pk_opkg_list_upgradable_cb, backend); + pk_backend_finished (backend); ++ opkg_thread_unlock(); + return TRUE; + } + + static void + backend_get_updates (PkBackend *backend, PkFilterEnum filters) + { ++ opkg_thread_lock(); + pk_backend_set_status (backend, PK_STATUS_ENUM_UPDATE); + pk_backend_set_percentage (backend, PK_BACKEND_PERCENTAGE_INVALID); + +@@ -672,6 +721,7 @@ backend_get_details_thread (PkBackend *backend) + { + pk_backend_error_code (backend, PK_ERROR_ENUM_PACKAGE_ID_INVALID, "invalid package id"); + pk_backend_finished (backend); ++ opkg_thread_unlock(); + return FALSE; + } + +@@ -683,6 +733,7 @@ backend_get_details_thread (PkBackend *backend) + { + pk_backend_error_code (backend, PK_ERROR_ENUM_PACKAGE_NOT_FOUND, NULL); + pk_backend_finished (backend); ++ opkg_thread_unlock(); + return FALSE; + } + +@@ -698,15 +749,18 @@ backend_get_details_thread (PkBackend *backend) + } + + pk_backend_details (backend, newid, NULL, group, pkg->description, pkg->url, pkg->size); ++ pk_backend_finished (backend); ++ opkg_thread_unlock(); ++ + g_free (newid); + opkg_package_free(pkg); +- pk_backend_finished (backend); + return TRUE; + } + + static void + backend_get_details (PkBackend *backend, const gchar *package_id) + { ++ opkg_thread_lock(); + pk_backend_set_percentage (backend, PK_BACKEND_PERCENTAGE_INVALID); + pk_backend_thread_create (backend, backend_get_details_thread); + } diff --git a/recipes/packagekit/files/remove_search_memory_leak.patch b/recipes/packagekit/files/remove_search_memory_leak.patch new file mode 100644 index 0000000000..bcc27adba7 --- /dev/null +++ b/recipes/packagekit/files/remove_search_memory_leak.patch @@ -0,0 +1,51 @@ +diff --git a/backends/opkg/pk-backend-opkg.c b/backends/opkg/pk-backend-opkg.c +index 0b9867e..a7b5244 100644 +--- a/backends/opkg/pk-backend-opkg.c ++++ b/backends/opkg/pk-backend-opkg.c +@@ -307,21 +307,23 @@ pk_opkg_package_list_cb (opkg_t *opkg, opkg_package_t *pkg, void *data) + + /* check filters */ + +- if ((filters & PK_FILTER_ENUM_DEVELOPMENT) && !opkg_is_devel_pkg (pkg)) +- return; ++ if ((filters & PK_FILTER_ENUM_DEVELOPMENT) && !opkg_is_devel_pkg (pkg)) ++ goto end_handle; + if ((filters & PK_FILTER_ENUM_NOT_DEVELOPMENT) && opkg_is_devel_pkg (pkg)) +- return; ++ goto end_handle; + if ((filters & PK_FILTER_ENUM_GUI) && !opkg_is_gui_pkg (pkg)) +- return; ++ goto end_handle; + if ((filters & PK_FILTER_ENUM_NOT_GUI) && opkg_is_gui_pkg (pkg)) +- return; ++ goto end_handle; + if ((filters & PK_FILTER_ENUM_INSTALLED) && (!pkg->installed)) +- return; ++ goto end_handle; + if ((filters & PK_FILTER_ENUM_NOT_INSTALLED) && (pkg->installed)) +- return; ++ goto end_handle; + + pk_backend_package (params->backend, status, uid, pkg->description); + ++end_handle: ++ g_free(uid); + } + + static gboolean +@@ -616,6 +618,7 @@ pk_opkg_list_upgradable_cb (opkg_t *opkg, opkg_package_t *pkg, void *data) + pkg->name, pkg->version, pkg->architecture); + + pk_backend_package (backend, status, uid, pkg->description); ++ g_free(uid); + } + + static gboolean +@@ -696,6 +699,7 @@ backend_get_details_thread (PkBackend *backend) + + pk_backend_details (backend, newid, NULL, group, pkg->description, pkg->url, pkg->size); + g_free (newid); ++ opkg_package_free(pkg); + pk_backend_finished (backend); + return TRUE; + } diff --git a/recipes/packagekit/files/repository-ping.patch b/recipes/packagekit/files/repository-ping.patch new file mode 100644 index 0000000000..75597e42c0 --- /dev/null +++ b/recipes/packagekit/files/repository-ping.patch @@ -0,0 +1,243 @@ +diff --git a/backends/dummy/pk-backend-dummy.c b/backends/dummy/pk-backend-dummy.c +index 5714e9f..162e6ce 100644 +--- a/backends/dummy/pk-backend-dummy.c ++++ b/backends/dummy/pk-backend-dummy.c +@@ -777,6 +777,16 @@ backend_what_provides (PkBackend *backend, PkFilterEnum filters, PkProvidesEnum + } + + /** ++ * backend_repos_ping: ++ */ ++static PkNetworkEnum ++backend_repos_ping (PkBackend *backend) ++{ ++ pk_backend_finished (backend); ++ return PK_NETWORK_ENUM_UNKNOWN; ++} ++ ++/** + * backend_get_packages: + */ + static void +@@ -821,6 +831,7 @@ PK_BACKEND_OPTIONS ( + backend_service_pack, /* service_pack */ + backend_update_packages, /* update_packages */ + backend_update_system, /* update_system */ +- backend_what_provides /* what_provides */ ++ backend_what_provides, /* what_provides */ ++ backend_repos_ping /* repos_ping */ + ); + +diff --git a/backends/opkg/pk-backend-opkg.c b/backends/opkg/pk-backend-opkg.c +index 02966c9..a20769f 100644 +--- a/backends/opkg/pk-backend-opkg.c ++++ b/backends/opkg/pk-backend-opkg.c +@@ -705,6 +705,16 @@ backend_get_details (PkBackend *backend, const gchar *package_id) + pk_backend_thread_create (backend, backend_get_details_thread); + } + ++static PkNetworkEnum ++backend_repos_ping (PkBackend *backend) ++{ ++ int opkg_ret = opkg_repository_accessibility_check(opkg); ++ pk_backend_set_percentage (backend, PK_BACKEND_PERCENTAGE_INVALID); ++ pk_backend_finished (backend); ++ pk_debug("opkg repos_ping ret = %d\n", opkg_ret); ++ return opkg_ret ? PK_NETWORK_ENUM_OFFLINE : PK_NETWORK_ENUM_ONLINE; ++} ++ + PK_BACKEND_OPTIONS ( + "opkg", /* description */ + "Thomas Wood <thomas@openedhand.com>", /* author */ +@@ -737,6 +747,7 @@ PK_BACKEND_OPTIONS ( + NULL, /* service_pack */ + backend_update_packages, /* update_packages */ + backend_update_system, /* update_system */ +- NULL /* what_provides */ ++ NULL, /* what_provides */ ++ backend_repos_ping /* repos_ping */ + ); + +diff --git a/backends/test/pk-backend-test-dbus.c b/backends/test/pk-backend-test-dbus.c +index 76686dc..9ef733d 100644 +--- a/backends/test/pk-backend-test-dbus.c ++++ b/backends/test/pk-backend-test-dbus.c +@@ -105,6 +105,7 @@ PK_BACKEND_OPTIONS ( + NULL, /* service_pack */ + NULL, /* update_packages */ + NULL, /* update_system */ +- NULL /* what_provides */ ++ NULL, /* what_provides */ ++ NULL /* repos_ping */ + ); + +diff --git a/backends/test/pk-backend-test-fail.c b/backends/test/pk-backend-test-fail.c +index b429c1b..a70564a 100644 +--- a/backends/test/pk-backend-test-fail.c ++++ b/backends/test/pk-backend-test-fail.c +@@ -275,6 +275,7 @@ PK_BACKEND_OPTIONS ( + NULL, /* service_pack */ + backend_update_packages, /* update_packages */ + backend_update_system, /* update_system */ +- NULL /* what_provides */ ++ NULL, /* what_provides */ ++ NULL /* repos_ping */ + ); + +diff --git a/backends/test/pk-backend-test-nop.c b/backends/test/pk-backend-test-nop.c +index 3526fa5..a715b9b 100644 +--- a/backends/test/pk-backend-test-nop.c ++++ b/backends/test/pk-backend-test-nop.c +@@ -55,6 +55,7 @@ PK_BACKEND_OPTIONS ( + NULL, /* service_pack */ + NULL, /* update_package */ + NULL, /* update_system */ +- NULL /* what_provides */ ++ NULL, /* what_provides */ ++ NULL /* repos_ping */ + ); + +diff --git a/backends/test/pk-backend-test-spawn.c b/backends/test/pk-backend-test-spawn.c +index 584f44c..424c7d4 100644 +--- a/backends/test/pk-backend-test-spawn.c ++++ b/backends/test/pk-backend-test-spawn.c +@@ -96,6 +96,7 @@ PK_BACKEND_OPTIONS ( + NULL, /* service_pack */ + NULL, /* update_package */ + NULL, /* update_system */ +- NULL /* what_provides */ ++ NULL, /* what_provides */ ++ NULL /* repos_ping */ + ); + +diff --git a/backends/test/pk-backend-test-succeed.c b/backends/test/pk-backend-test-succeed.c +index c046c1d..116d4fe 100644 +--- a/backends/test/pk-backend-test-succeed.c ++++ b/backends/test/pk-backend-test-succeed.c +@@ -304,6 +304,16 @@ backend_what_provides (PkBackend *backend, PkFilterEnum filters, PkProvidesEnum + } + + /** ++ * backend_repos_ping ++ */ ++static PkNetworkEnum ++backend_repos_ping (PkBackend *backend) ++{ ++ pk_backend_finished(backend); ++ return PK_NETWORK_ENUM_UNKNOWN; ++} ++ ++/** + * backend_get_packages: + */ + static void +@@ -344,6 +354,7 @@ PK_BACKEND_OPTIONS ( + backend_service_pack, /* service_pack */ + backend_update_packages, /* update_packages */ + backend_update_system, /* update_system */ +- backend_what_provides /* what_provides */ ++ backend_what_provides, /* what_provides */ ++ backend_repos_ping /* repos_ping */ + ); + +diff --git a/backends/test/pk-backend-test-thread.c b/backends/test/pk-backend-test-thread.c +index 46ee862..a00cd26 100644 +--- a/backends/test/pk-backend-test-thread.c ++++ b/backends/test/pk-backend-test-thread.c +@@ -168,6 +168,7 @@ PK_BACKEND_OPTIONS ( + NULL, /* service_pack */ + NULL, /* update_package */ + NULL, /* update_system */ +- NULL /* what_provides */ ++ NULL, /* what_provides */ ++ NULL /* repos_ping */ + ); + +diff --git a/src/pk-backend-internal.h b/src/pk-backend-internal.h +index 2bffaff..f46159c 100644 +--- a/src/pk-backend-internal.h ++++ b/src/pk-backend-internal.h +@@ -71,6 +71,8 @@ PkGroupEnum pk_backend_get_groups (PkBackend *backend); + PkFilterEnum pk_backend_get_filters (PkBackend *backend); + PkRoleEnum pk_backend_get_actions (PkBackend *backend); + ++PkNetworkEnum pk_backend_repos_ping (PkBackend *backend); ++ + G_END_DECLS + + #endif /* __PK_BACKEND_INTERNAL_H */ +diff --git a/src/pk-backend.c b/src/pk-backend.c +index 6efa55e..32ff276 100644 +--- a/src/pk-backend.c ++++ b/src/pk-backend.c +@@ -165,6 +165,23 @@ pk_backend_get_filters (PkBackend *backend) + } + + /** ++ */ ++PkNetworkEnum ++pk_backend_repos_ping (PkBackend *backend) ++{ ++ g_return_val_if_fail (PK_IS_BACKEND (backend), PK_NETWORK_ENUM_UNKNOWN); ++ g_return_val_if_fail (backend->priv->locked != FALSE, PK_NETWORK_ENUM_UNKNOWN); ++ ++ /* not compulsory */ ++ if (backend->desc->repos_ping == NULL) { ++ return PK_NETWORK_ENUM_UNKNOWN; ++ } ++ ++ pk_debug("Runing backend's repos_ping\n"); ++ return backend->desc->repos_ping (backend); ++} ++ ++/** + * pk_backend_get_actions: + **/ + PkRoleEnum +diff --git a/src/pk-backend.h b/src/pk-backend.h +index a7ba754..1f41c6c 100644 +--- a/src/pk-backend.h ++++ b/src/pk-backend.h +@@ -258,6 +258,7 @@ typedef struct { + PkFilterEnum filters, + PkProvidesEnum provides, + const gchar *search); ++ PkNetworkEnum (*repos_ping) (PkBackend *backend); + gpointer padding[10]; + } PkBackendDesc; + +@@ -266,7 +267,7 @@ typedef struct { + get_update_detail, get_updates, install_files, install_packages, \ + install_signature, refresh_cache, remove_packages, repo_enable, \ + repo_set_data, resolve, rollback, search_details, search_file, search_group, \ +- search_name, service_pack, update_packages, update_system, what_provides) \ ++ search_name, service_pack, update_packages, update_system, what_provides, repos_ping) \ + G_MODULE_EXPORT const PkBackendDesc pk_backend_desc = { \ + description, \ + author, \ +@@ -300,6 +301,7 @@ typedef struct { + update_packages, \ + update_system, \ + what_provides, \ ++ repos_ping, \ + {0} \ + } + +diff --git a/src/pk-engine.c b/src/pk-engine.c +index 14ecf41..f9359f2 100644 +--- a/src/pk-engine.c ++++ b/src/pk-engine.c +@@ -279,8 +279,11 @@ pk_engine_get_network_state (PkEngine *engine, gchar **state, GError **error) + { + PkNetworkEnum network; + g_return_val_if_fail (PK_IS_ENGINE (engine), FALSE); +- /* get the network state */ +- network = pk_network_get_network_state (engine->priv->network); ++ network = pk_backend_repos_ping(engine->priv->backend); ++ if (network == PK_NETWORK_ENUM_UNKNOWN) { ++ /* get the network state */ ++ network = pk_network_get_network_state (engine->priv->network); ++ } + *state = g_strdup (pk_network_enum_to_text (network)); + return TRUE; + } diff --git a/recipes/packagekit/gnome-packagekit_0.2.5.bb b/recipes/packagekit/gnome-packagekit_0.2.5.bb new file mode 100644 index 0000000000..6d0341056c --- /dev/null +++ b/recipes/packagekit/gnome-packagekit_0.2.5.bb @@ -0,0 +1,17 @@ +DESCRIPTION = "GNOME frontend for packagekit" +LICENSE = "GPL" + +DEPENDS = "packagekit libgnome" + +inherit gnome + +SRC_URI = "http://www.packagekit.org/releases/gnome-packagekit-${PV}.tar.gz" + +EXTRA_OECONF = " --enable-compile-warnings=no --disable-scrollkeeper " + +do_configure_prepend() { + sed -i -e s/help/docs/ Makefile.am + sed -i -e s:-Werror::g configure.ac +} + +FILES_${PN} += "${datadir}/icons ${datadir}/gnome" diff --git a/recipes/packagekit/packagekit_0.2.4.bb b/recipes/packagekit/packagekit_0.2.4.bb new file mode 100644 index 0000000000..301853c9e5 --- /dev/null +++ b/recipes/packagekit/packagekit_0.2.4.bb @@ -0,0 +1,39 @@ +DESCRIPTION = "PackageKit package management abstraction" +SECTION = "libs" +PRIORITY = "optional" +LICENSE = "GPL" +DEPENDS = "dbus (>= 1.1.1) dbus-glib glib-2.0 sqlite3 opkg intltool intltool-native (>= 0.37.1)" +RDEPENDS_${PN} = "opkg" + +PE = "1" + +SRC_URI = "http://www.packagekit.org/releases/PackageKit-${PV}.tar.gz \ + file://disable-docbook2man.patch;patch=1 \ + file://repository-ping.patch;patch=1 \ + file://force_depends.patch;patch=1 \ + file://racing_condition.patch;patch=1 \ + " + + +S = "${WORKDIR}/PackageKit-${PV}" + +inherit autotools pkgconfig + +EXTRA_OECONF = "--with-security-framework=dummy \ + --with-default-backend=opkg \ + --enable-opkg \ + ac_cv_path_XMLTO=no \ + " + + +do_configure_prepend() { + echo "EXTRA_DIST=" > gtk-doc.make + sed -i -e s:0\.1\.5:0\.1\.6:g configure.ac +} + +do_stage () { + autotools_stage_all +} + +FILES_${PN} += "${libdir}/packagekit-backend/*.so ${datadir}/dbus-1/system-services/" +FILES_${PN}-dbg += "${libdir}/packagekit-backend/.debug/*.so " diff --git a/recipes/packagekit/packagekit_git.bb b/recipes/packagekit/packagekit_git.bb new file mode 100644 index 0000000000..0e9793d050 --- /dev/null +++ b/recipes/packagekit/packagekit_git.bb @@ -0,0 +1,42 @@ +DESCRIPTION = "PackageKit package management abstraction" +SECTION = "libs" +PRIORITY = "optional" +LICENSE = "GPL" +DEPENDS = "dbus (>= 1.1.1) dbus-glib glib-2.0 sqlite3 opkg intltool intltool-native (>= 0.37.1)" +RDEPENDS_${PN} = "opkg" +PV = "0.2.3+gitr${SRCREV}" +PR = "r18" +PE = "1" + +SRC_URI = "git://anongit.freedesktop.org/git/packagekit;protocol=git \ + file://disable-docbook2man.patch;patch=1 \ + file://repository-ping.patch;patch=1 \ + file://force_depends.patch;patch=1 \ + file://remove_search_memory_leak.patch;patch=1 \ + file://racing_condition.patch;patch=1 \ + file://modify_summary_and_adding_reposi_info.patch;patch=1 \ + " + + +S = "${WORKDIR}/git" + +inherit autotools pkgconfig + +EXTRA_OECONF = "--with-security-framework=dummy \ + --with-default-backend=opkg \ + --enable-opkg \ + ac_cv_path_XMLTO=no \ + " + + +do_configure_prepend() { + echo "EXTRA_DIST=" > gtk-doc.make + sed -i -e s:0\.1\.5:0\.1\.6:g configure.ac +} + +do_stage () { + autotools_stage_all +} + +FILES_${PN} += "${libdir}/packagekit-backend/*.so ${datadir}/dbus-1/system-services/" +FILES_${PN}-dbg += "${libdir}/packagekit-backend/.debug/*.so " |