diff options
author | Eskil Heyn Olsen <eskil@src.gnome.org> | 2001-03-28 20:47:28 +0000 |
---|---|---|
committer | Eskil Heyn Olsen <eskil@src.gnome.org> | 2001-03-28 20:47:28 +0000 |
commit | 5a9e529f92ee9a1bc2f8fd9f573127f5ba7efcf9 (patch) | |
tree | 2f112d96bbf27f8d80ab4a0dc8da4e685961cae2 /components | |
parent | 8c92da756961f0dbc183388d69e86dc3e27edd44 (diff) | |
download | nautilus-5a9e529f92ee9a1bc2f8fd9f573127f5ba7efcf9.tar.gz |
Added a (bool)packagedata_is_suite call which checks if the suite_id field
* components/services/install/lib/eazel-package-system-types.h:
* components/services/install/lib/eazel-package-system-types.c:
(flatten_packagedata_dependency_tree), (packagedata_list_prune),
(packagedata_is_suite):
Added a (bool)packagedata_is_suite call which checks if the
suite_id field is actually a suite or something else.
* components/services/install/lib/eazel-install-logic2.c:
(prune_failed_packages_helper), (get_softcat_info), (post_check),
(check_dependencies_foreach), (do_dep_check_internal),
(check_no_two_packages_has_same_file),
(check_conflicts_against_already_installed_packages):
* components/services/install/lib/eazel-install-protocols.c:
(eazel_install_fetch_package):
Use the packagedata_is_suite call.
Diffstat (limited to 'components')
4 files changed, 30 insertions, 9 deletions
diff --git a/components/services/install/lib/eazel-install-logic2.c b/components/services/install/lib/eazel-install-logic2.c index 3a55aaa10..adf33a081 100644 --- a/components/services/install/lib/eazel-install-logic2.c +++ b/components/services/install/lib/eazel-install-logic2.c @@ -201,7 +201,9 @@ prune_failed_packages_helper (EazelInstall *service, } /* If it's a suite and no dependencies, cancel it */ - if (pack->suite_id && g_list_length (pack->depends)==0 && pack->status == PACKAGE_PARTLY_RESOLVED) { + if (packagedata_is_suite (pack) && + g_list_length (pack->depends)==0 && + pack->status == PACKAGE_PARTLY_RESOLVED) { pack->status = PACKAGE_ALREADY_INSTALLED; } @@ -771,7 +773,7 @@ get_softcat_info (EazelInstall *service, } } } - if ((result != NO_SOFTCAT_HIT) && ((*package)->suite_id == NULL)) { + if ((result != NO_SOFTCAT_HIT) && !packagedata_is_suite ((*package))) { post_get_softcat_info (service, package, result); } return result; @@ -817,7 +819,7 @@ post_check (EazelInstall *service, (*package)->status = PACKAGE_PARTLY_RESOLVED; - if ((*package)->md5==NULL && (*package)->suite_id!=NULL) { + if ((*package)->md5==NULL && packagedata_is_suite ((*package))) { return result; } @@ -1345,7 +1347,7 @@ check_dependencies_foreach (EazelInstall *service, return; } - if (package->suite_id!=NULL) { + if (packagedata_is_suite (package)) { for (iterator = package->depends; iterator; iterator = g_list_next (iterator)) { PackageDependency *dep = PACKAGEDEPENDENCY (iterator->data); dep->package->fillflag = PACKAGE_FILL_INVALID; @@ -1483,7 +1485,7 @@ do_dep_check_internal (EazelInstall *service, for (diterator = pack->depends; diterator; diterator = g_list_next (diterator)) { PackageDependency *dep = PACKAGEDEPENDENCY (diterator->data); if (((~dep->package->fillflag & MUST_HAVE) || - (pack->suite_id)) && + packagedata_is_suite (pack)) && (g_list_find (K, dep->package)==NULL)) { K = g_list_prepend (K, dep); } @@ -2278,7 +2280,7 @@ check_no_two_packages_has_same_file (EazelInstall *service, pack = PACKAGEDATA (iter->data); - if (pack->suite_id) { + if (packagedata_is_suite (pack)) { continue; } @@ -2413,7 +2415,7 @@ check_conflicts_against_already_installed_packages (EazelInstall *service, for (iter = g_list_first (flat_packages); iter != NULL; iter = g_list_next (iter)) { pack = PACKAGEDATA (iter->data); - if (pack->conflicts_checked || pack->suite_id) { + if (pack->conflicts_checked || packagedata_is_suite (pack)) { continue; } diff --git a/components/services/install/lib/eazel-install-protocols.c b/components/services/install/lib/eazel-install-protocols.c index 83377106f..ad3d089f5 100644 --- a/components/services/install/lib/eazel-install-protocols.c +++ b/components/services/install/lib/eazel-install-protocols.c @@ -623,7 +623,7 @@ eazel_install_fetch_package (EazelInstall *service, char *name = g_strdup (package->name); char *version = g_strdup (package->version); - if (package->suite_id != NULL) { + if (packagedata_is_suite (package)) { trilobite_debug ("suites has no urls..."); g_free (name); g_free (version); diff --git a/components/services/install/lib/eazel-package-system-types.c b/components/services/install/lib/eazel-package-system-types.c index 242976407..fc6eb9246 100644 --- a/components/services/install/lib/eazel-package-system-types.c +++ b/components/services/install/lib/eazel-package-system-types.c @@ -1028,7 +1028,7 @@ flatten_packagedata_dependency_tree (GList *packages) } /* Don't add suites */ - if (pack->suite_id == NULL) { + if (!packagedata_is_suite (pack)) { result = g_list_prepend (result, pack); } } @@ -1081,6 +1081,23 @@ packagedata_list_prune (GList **input, } } +gboolean +packagedata_is_suite (PackageData *package) +{ + gboolean result = FALSE; + + g_assert (package); + g_assert (IS_PACKAGEDATA (package)); + + if (package->suite_id) { + if (strncmp (package->suite_id, "S:", 2)==0) { + result = TRUE; + } + } + + return result; +} + PackageRequirement* packagerequirement_new (PackageData *pack, PackageData *req) diff --git a/components/services/install/lib/eazel-package-system-types.h b/components/services/install/lib/eazel-package-system-types.h index cd3faad45..ef424f7f9 100644 --- a/components/services/install/lib/eazel-package-system-types.h +++ b/components/services/install/lib/eazel-package-system-types.h @@ -290,6 +290,8 @@ GList *flatten_packagedata_dependency_tree (GList *packages); */ void packagedata_list_prune (GList **input, GList *remove_list, gboolean destroy, gboolean deep); +gboolean packagedata_is_suite (PackageData *package); + /*************************************************************************************************/ typedef enum { |