[packagekit] packagekit: Branch 'master' - 3 commits
Richard Hughes
hughsient at kemper.freedesktop.org
Fri Sep 21 13:06:05 PDT 2007
backends/BACKENDS | 2 +-
backends/box/pk-backend-box.c | 18 ++++++++++++++++--
libpackagekit/pk-enum.c | 39 +++++++++++++++++++++++++++++++++++++++
3 files changed, 56 insertions(+), 3 deletions(-)
New commits:
diff-tree d15aa3fe6099dddc2f08355ca3d5295f0e058527 (from parents)
Merge: 5b60ab423a4f5939672a286bb11211e34e6380a0 2d8bca993bdf008baabfb536684a1ccaceaa13bd
Author: Richard Hughes <richard at hughsie.com>
Date: Fri Sep 21 21:04:51 2007 +0100
Merge branch 'master' of git+ssh://hughsie@git.packagekit.org/srv/git/PackageKit
diff-tree 2d8bca993bdf008baabfb536684a1ccaceaa13bd (from 0582120fd35073f71d9a317ccc7189e8990de773)
Author: Grzegorz Dabrowski <gdx at o2.pl>
Date: Fri Sep 21 21:11:19 2007 +0000
[box] implemented Resolve method
diff --git a/backends/BACKENDS b/backends/BACKENDS
index 6ae45eb..800cf8d 100644
--- a/backends/BACKENDS
+++ b/backends/BACKENDS
@@ -2,7 +2,7 @@ Current status of the backends
| conary | yum | apt | box | alpm |
-----------------------------------------------------
-resolve | | | | | |
+resolve | | | | X | |
refresh-cache | X | X | X | X | |
get-updates | X | X | | X | |
update-system | | X | | | |
diff --git a/backends/box/pk-backend-box.c b/backends/box/pk-backend-box.c
index ad6a906..c6cc469 100644
--- a/backends/box/pk-backend-box.c
+++ b/backends/box/pk-backend-box.c
@@ -34,7 +34,8 @@
enum PkgSearchType {
SEARCH_TYPE_NAME = 0,
SEARCH_TYPE_DETAILS = 1,
- SEARCH_TYPE_FILE = 2
+ SEARCH_TYPE_FILE = 2,
+ SEARCH_TYPE_RESOLVE = 3
};
@@ -164,6 +165,10 @@ find_packages_real (PkBackend *backend,
list = box_db_repos_search_file (db, search);
add_packages_from_list (backend, list);
box_db_repos_package_list_free (list);
+ } else if (mode == SEARCH_TYPE_RESOLVE) {
+ list = box_db_repos_packages_search_one (db, (gchar *)search);
+ add_packages_from_list (backend, list);
+ box_db_repos_package_list_free (list);
} else {
if (installed == FALSE && available == FALSE) {
pk_backend_error_code (backend, PK_ERROR_ENUM_UNKNOWN, "invalid search mode");
@@ -425,6 +430,15 @@ backend_remove_package (PkBackend *backe
pk_backend_spawn_helper (backend, "remove-package.sh", deps, package_id, NULL);
}
+/**
+ * backend_resolve:
+ */
+static void
+backend_resolve (PkBackend *backend, const gchar *package)
+{
+ g_return_if_fail (backend != NULL);
+ find_packages (backend, package, "none", SEARCH_TYPE_RESOLVE);
+}
/**
* backend_search_details:
@@ -491,7 +505,7 @@ PK_BACKEND_OPTIONS (
backend_install_file, /* install_file */
backend_refresh_cache, /* refresh_cache */
backend_remove_package, /* remove_package */
- NULL, /* resolve */
+ backend_resolve, /* resolve */
backend_search_details, /* search_details */
backend_search_file, /* search_file */
NULL, /* search_group */
diff-tree 5b60ab423a4f5939672a286bb11211e34e6380a0 (from 0582120fd35073f71d9a317ccc7189e8990de773)
Author: Richard Hughes <richard at hughsie.com>
Date: Fri Sep 21 21:04:36 2007 +0100
add an extra test
diff --git a/libpackagekit/pk-enum.c b/libpackagekit/pk-enum.c
index de1c1b4..830c8e2 100644
--- a/libpackagekit/pk-enum.c
+++ b/libpackagekit/pk-enum.c
@@ -309,10 +309,49 @@ pk_filter_enum_to_text (PkFilterEnum fil
void
libst_enum (LibSelfTest *test)
{
+ const gchar *string;
+ PkRoleEnum value;
+
if (libst_start (test, "PkEnum", CLASS_AUTO) == FALSE) {
return;
}
+ /************************************************************/
+ libst_title (test, "find value");
+ value = pk_task_enum_find_value (task_role, "search-file");
+ if (PK_ROLE_ENUM_SEARCH_FILE) {
+ libst_success (test, NULL);
+ } else {
+ libst_failed (test, NULL);
+ }
+
+ /************************************************************/
+ libst_title (test, "find string");
+ string = pk_task_enum_find_string (task_role, PK_ROLE_ENUM_SEARCH_FILE);
+ if (strcmp (string, "search-file") == 0) {
+ libst_success (test, NULL);
+ } else {
+ libst_failed (test, NULL);
+ }
+
+ /************************************************************/
+ libst_title (test, "find value");
+ value = pk_role_enum_from_text ("search-file");
+ if (PK_ROLE_ENUM_SEARCH_FILE) {
+ libst_success (test, NULL);
+ } else {
+ libst_failed (test, NULL);
+ }
+
+ /************************************************************/
+ libst_title (test, "find string");
+ string = pk_role_enum_to_text (PK_ROLE_ENUM_SEARCH_FILE);
+ if (strcmp (string, "search-file") == 0) {
+ libst_success (test, NULL);
+ } else {
+ libst_failed (test, NULL);
+ }
+
libst_end (test);
}
#endif
More information about the PackageKit
mailing list