summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEskil Heyn Olsen <eskil@src.gnome.org>2001-01-26 15:08:45 +0000
committerEskil Heyn Olsen <eskil@src.gnome.org>2001-01-26 15:08:45 +0000
commit67ce82fdb6b4b2014b6b6208d86c567cbd42996a (patch)
treea98a2be48c2a9f58c75f02bdeeaf4d82a4557967
parentc2d72c727a1787d40cc6158d744b334a14735714 (diff)
downloadnautilus-67ce82fdb6b4b2014b6b6208d86c567cbd42996a.tar.gz
reviewed by: Ramiro & Pavel
* components/rpmview/nautilus-rpm-view-install.c: (nautilus_rpm_view_install_done), (nautilus_rpm_view_set_server), (nautilus_rpm_view_install_package_callback): Don't set servername to "", but get the configured services server. Always set port to 80 and auth to FALSE. * components/services/install/lib/eazel-install-logic2.c: (dump_tree_helper), (prune_failed_packages_helper), (prune_failed_packages), (eazel_install_check_existing_packages), (get_softcat_info), (dedupe_foreach_depends), (is_satisfied), (check_tree_helper), (check_tree_for_conflicts), (download_packages), (set_toplevel), (install_packages): Check status of package if info is loaded using EazelPackageSystem (badbad) Fake an eazel_id if none is set to ensure deduping in case user adds the same package several times. Added some checks for eazel_id==NULL. Only call fetch_package if filename==NULL. Set toplevel to TRUE on all packages on start (fixes problem in emit_preflight) Much recursion tests on the dependencies. * components/services/install/lib/eazel-install-object.c: (eazel_install_emit_preflight_check): whitespace diff * components/services/install/lib/eazel-install-protocols.c: (eazel_install_fetch_package): If the package as a remote_uri set, don't get it again. * components/services/install/lib/eazel-install-xml-package-list.c: (eazel_install_packagedata_to_xml): A real nasty recursion test. * components/services/install/lib/eazel-package-system-rpm3.c: (make_rpm_argument_list), (eazel_package_system_rpm3_packagedata_fill_from_header), (rpm_packagedata_new_from_file), (eazel_package_system_rpm3_load_package): Don't add --percent if uninstalling. Specialcase ld-linux.so so it's never added as a feature.. Saner use of the load_package return val. * components/services/install/lib/eazel-package-system.c: (eazel_package_system_load_package): Add MD5 when loading package from file.
-rw-r--r--ChangeLog51
-rw-r--r--components/rpmview/nautilus-rpm-view-install.c39
-rw-r--r--components/services/install/lib/eazel-install-logic2.c86
-rw-r--r--components/services/install/lib/eazel-install-object.c2
-rw-r--r--components/services/install/lib/eazel-install-protocols.c36
-rw-r--r--components/services/install/lib/eazel-install-xml-package-list.c17
-rw-r--r--components/services/install/lib/eazel-package-system-rpm3.c22
-rw-r--r--components/services/install/lib/eazel-package-system.c6
8 files changed, 201 insertions, 58 deletions
diff --git a/ChangeLog b/ChangeLog
index 0e931c11a..c3de7d4e8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,54 @@
+2001-01-26 Eskil Olsen <eskil@eazel.com>
+
+ reviewed by: Ramiro & Pavel
+
+ * components/rpmview/nautilus-rpm-view-install.c:
+ (nautilus_rpm_view_install_done), (nautilus_rpm_view_set_server),
+ (nautilus_rpm_view_install_package_callback):
+ Don't set servername to "", but get the configured services
+ server. Always set port to 80 and auth to FALSE.
+
+ * components/services/install/lib/eazel-install-logic2.c:
+ (dump_tree_helper), (prune_failed_packages_helper),
+ (prune_failed_packages), (eazel_install_check_existing_packages),
+ (get_softcat_info), (dedupe_foreach_depends), (is_satisfied),
+ (check_tree_helper), (check_tree_for_conflicts),
+ (download_packages), (set_toplevel), (install_packages):
+ Check status of package if info is loaded using
+ EazelPackageSystem (badbad)
+ Fake an eazel_id if none is set to ensure deduping in case user
+ adds the same package several times.
+ Added some checks for eazel_id==NULL.
+ Only call fetch_package if filename==NULL.
+ Set toplevel to TRUE on all packages on start
+ (fixes problem in emit_preflight)
+ Much recursion tests on the dependencies.
+
+ * components/services/install/lib/eazel-install-object.c:
+ (eazel_install_emit_preflight_check):
+ whitespace diff
+
+ * components/services/install/lib/eazel-install-protocols.c:
+ (eazel_install_fetch_package):
+ If the package as a remote_uri set, don't get it again.
+
+ * components/services/install/lib/eazel-install-xml-package-list.c:
+ (eazel_install_packagedata_to_xml):
+ A real nasty recursion test.
+
+ * components/services/install/lib/eazel-package-system-rpm3.c:
+ (make_rpm_argument_list),
+ (eazel_package_system_rpm3_packagedata_fill_from_header),
+ (rpm_packagedata_new_from_file),
+ (eazel_package_system_rpm3_load_package):
+ Don't add --percent if uninstalling.
+ Specialcase ld-linux.so so it's never added as a feature..
+ Saner use of the load_package return val.
+
+ * components/services/install/lib/eazel-package-system.c:
+ (eazel_package_system_load_package):
+ Add MD5 when loading package from file.
+
2001-01-26 Ramiro Estrugo <ramiro@eazel.com>
reviewed by: Pavel Cisler <pavel@eazel.com>
diff --git a/components/rpmview/nautilus-rpm-view-install.c b/components/rpmview/nautilus-rpm-view-install.c
index dc79fe14d..357447479 100644
--- a/components/rpmview/nautilus-rpm-view-install.c
+++ b/components/rpmview/nautilus-rpm-view-install.c
@@ -28,10 +28,6 @@
#include "libtrilobite/libtrilobite.h"
#include "nautilus-rpm-view-private.h"
-/* don't try to access a remote server for install */
-#define DEFAULT_SERVICES_HOST ""
-#define DEFAULT_SERVICES_PORT 80
-
#define OAF_ID "OAFIID:trilobite_eazel_install_service:8ff6e815-1992-437c-9771-d932db3b4a17"
static void
@@ -254,7 +250,7 @@ nautilus_rpm_view_install_done (EazelInstallCallback *service,
detailed,
GTK_WINDOW (window));
- /* gnome_dialog_run_and_close (d); */
+ gnome_dialog_run_and_close (d);
g_free (terse);
g_free (dialog_title);
g_free (detailed);
@@ -270,9 +266,8 @@ nautilus_rpm_view_install_done (EazelInstallCallback *service,
CORBA_exception_free (&ev);
}
-
nautilus_rpm_view_finished_working (rpm_view);
-
+
tmp = g_strdup (nautilus_rpm_view_get_uri (rpm_view));
nautilus_rpm_view_load_uri (rpm_view, tmp);
g_free (tmp);
@@ -390,6 +385,29 @@ preflight_check (EazelInstallCallback *cb, const GList *packages,
return TRUE;
}
+static void
+nautilus_rpm_view_set_server (NautilusRPMView *rpm_view,
+ EazelInstallCallback *cb,
+ CORBA_Environment *ev)
+{
+ int port;
+ char *host, *p;
+
+ /* get default host/port */
+ host = g_strdup (trilobite_get_services_address ());
+ if ((p = strchr (host, ':')) != NULL) {
+ *p = 0;
+ }
+ /* always go for the no auth port */
+ port = 80;
+
+ GNOME_Trilobite_Eazel_Install__set_server (eazel_install_callback_corba_objref (cb), host, ev);
+ GNOME_Trilobite_Eazel_Install__set_server_port (eazel_install_callback_corba_objref (cb), port, ev);
+
+ /* For now always set auth to FALSE, so users are not required to
+ login to services to install local rpm files */
+ GNOME_Trilobite_Eazel_Install__set_auth (eazel_install_callback_corba_objref (cb), FALSE, ev);
+}
void
nautilus_rpm_view_install_package_callback (GtkWidget *widget,
@@ -419,9 +437,8 @@ nautilus_rpm_view_install_package_callback (GtkWidget *widget,
rpm_view->details->root_client = set_root_client (eazel_install_callback_bonobo (cb), rpm_view);
GNOME_Trilobite_Eazel_Install__set_protocol (eazel_install_callback_corba_objref (cb), GNOME_Trilobite_Eazel_PROTOCOL_HTTP, &ev);
- GNOME_Trilobite_Eazel_Install__set_server (eazel_install_callback_corba_objref (cb), DEFAULT_SERVICES_HOST, &ev);
- GNOME_Trilobite_Eazel_Install__set_server_port (eazel_install_callback_corba_objref (cb), DEFAULT_SERVICES_PORT, &ev);
-
+ nautilus_rpm_view_set_server (rpm_view, cb, &ev);
+
gtk_signal_connect (GTK_OBJECT (cb), "download_progress", nautilus_rpm_view_download_progress_signal, rpm_view);
gtk_signal_connect (GTK_OBJECT (cb), "install_progress", nautilus_rpm_view_install_progress_signal, rpm_view);
gtk_signal_connect (GTK_OBJECT (cb), "dependency_check", nautilus_rpm_view_dependency_check, rpm_view);
@@ -434,7 +451,7 @@ nautilus_rpm_view_install_package_callback (GtkWidget *widget,
eazel_install_callback_install_packages (cb, categories, NULL, &ev);
/* Leak the categories here */
-
+
CORBA_exception_free (&ev);
}
diff --git a/components/services/install/lib/eazel-install-logic2.c b/components/services/install/lib/eazel-install-logic2.c
index 6bdd199a9..72d750fa1 100644
--- a/components/services/install/lib/eazel-install-logic2.c
+++ b/components/services/install/lib/eazel-install-logic2.c
@@ -83,7 +83,7 @@ dump_tree_helper (GList *packages, char *indent, GList *path)
pack->status == PACKAGE_CANNOT_OPEN ? " but failed" : "");
tmp = g_strdup_printf ("%s ", indent);
if (g_list_find_custom (path, name, (GCompareFunc)strcmp)) {
- trilobite_debug ("%s ... recurses ...", indent);
+ trilobite_debug ("%s... %p %s recurses .., softcat is probably in flux", indent, pack, pack->name);
} else {
path = g_list_prepend (path, name);
dump_tree_helper (pack->depends, tmp, path);
@@ -162,13 +162,14 @@ check_md5_on_files (EazelInstall *service,
void prune_failed_packages (EazelInstall *service, GList **packages);
void prune_failed_packages_helper (EazelInstall *service, PackageData *root,
- PackageData *pack, GList *packages, GList **result);
+ PackageData *pack, GList *packages, GList **path, GList **result);
void
prune_failed_packages_helper (EazelInstall *service,
PackageData *root,
PackageData *pack,
GList *packages,
+ GList **path,
GList **result)
{
GList *iterator;
@@ -179,6 +180,13 @@ prune_failed_packages_helper (EazelInstall *service,
packagedata_status_enum_to_str (pack->status));
#endif
+ if (g_list_find (*path, pack)) {
+#if EI2_DEBUG & 0x4
+ trilobite_debug ("... %p %s recurses .., softcat is probably in flux", pack, pack->name);
+#endif
+ return;
+ }
+
if (pack->status != PACKAGE_PARTLY_RESOLVED) {
#if EI2_DEBUG & 0x4
trilobite_debug ("subpruner kill root %s because of %s", root->name, pack->name);
@@ -187,7 +195,9 @@ prune_failed_packages_helper (EazelInstall *service,
} else {
for (iterator = pack->depends; iterator; iterator = g_list_next (iterator)) {
PackageDependency *dep = PACKAGEDEPENDENCY (iterator->data);
- prune_failed_packages_helper (service, root, dep->package, packages, result);
+ (*path) = g_list_prepend (*path, pack);
+ prune_failed_packages_helper (service, root, dep->package, packages, path, result);
+ (*path) = g_list_remove (*path, pack);
}
}
}
@@ -201,7 +211,8 @@ prune_failed_packages (EazelInstall *service,
for (iterator = *packages; iterator; iterator = g_list_next (iterator)) {
PackageData *pack = PACKAGEDATA (iterator->data);
- prune_failed_packages_helper (service, pack, pack, *packages, &result);
+ GList *path = NULL;
+ prune_failed_packages_helper (service, pack, pack, *packages, &path, &result);
}
for (iterator = result; iterator; iterator = g_list_next (iterator)) {
@@ -241,7 +252,7 @@ eazel_install_check_existing_packages (EazelInstall *service,
EazelInstallStatus result;
#if EI2_DEBUG & 0x4
- trilobite_debug ("check_existing %s", pack->name);
+ trilobite_debug ("check existing %p %s", pack, pack->name);
#endif
result = EAZEL_INSTALL_STATUS_NEW_PACKAGE;
/* query for existing package of same name */
@@ -448,10 +459,19 @@ get_softcat_info (EazelInstall *service,
if ((*package)->filename) {
if (g_file_test ((*package)->filename, G_FILE_TEST_ISFILE) &&
access ((*package)->filename, R_OK)==0) {
- (*package) = eazel_package_system_load_package (service->private->package_system,
- *package,
- (*package)->filename,
- MUST_HAVE);
+ PackageData *loaded_package;
+#if EI2_DEBUG & 0x4
+ trilobite_debug ("%p %s load from disk", *package, (*package)->name);
+#endif
+ loaded_package = eazel_package_system_load_package (service->private->package_system,
+ *package,
+ (*package)->filename,
+ MUST_HAVE);
+ if (loaded_package==NULL) {
+ (*package)->status = PACKAGE_CANNOT_OPEN;
+ } else {
+ (*package)->status = PACKAGE_PARTLY_RESOLVED;
+ }
result = SOFTCAT_HIT_OK;
}
@@ -475,7 +495,12 @@ get_softcat_info (EazelInstall *service,
}
}
if (result != NO_SOFTCAT_HIT) {
- PackageData *p1;
+ PackageData *p1 = NULL;
+
+ if ((*package)->eazel_id == NULL) {
+ (*package)->eazel_id = g_strdup_printf ("%s-%s-%s",
+ (*package)->name, (*package)->version, (*package)->minor);
+ }
p1 = g_hash_table_lookup (service->private->dedupe_hash, (*package)->eazel_id);
@@ -572,8 +597,14 @@ dedupe_foreach_depends (PackageDependency *d,
p1 = d->package;
+ if (p1->eazel_id == NULL) {
+ /* Package info not received from SoftCat */
+ return;
+ }
+
if (~p1->fillflag & MUST_HAVE) {
PackageData *p11;
+
p11 = g_hash_table_lookup (service->private->dedupe_hash, p1->eazel_id);
if (p11) {
gtk_object_ref (GTK_OBJECT (p11));
@@ -626,7 +657,7 @@ is_satisfied (EazelInstall *service,
PackageDependency *dep)
{
char *key;
- int previous_check_state;
+ int previous_check_state = 0;
g_assert (dep);
g_assert (IS_PACKAGEDEPENDENCY (dep));
@@ -662,7 +693,9 @@ is_satisfied (EazelInstall *service,
key = g_strdup (dep->package->eazel_id);
}
- previous_check_state = GPOINTER_TO_INT (g_hash_table_lookup (service->private->dep_ok_hash, key));
+ if (key) {
+ previous_check_state = GPOINTER_TO_INT (g_hash_table_lookup (service->private->dep_ok_hash, key));
+ }
switch (previous_check_state) {
case DEPENDENCY_OK: {
#if EI2_DEBUG & 0x4
@@ -859,10 +892,18 @@ void check_tree_for_conflicts (EazelInstall *service, GList **packages, GList **
static void
check_tree_helper (EazelInstall *service,
PackageData *pack,
- GList **extra_packages)
+ GList **extra_packages,
+ GList **path)
{
GList *iterator;
+ if (g_list_find (*path, pack)) {
+#if EI2_DEBUG & 0x4
+ trilobite_debug ("... %p %s recurses .., softcat is probably in flux", pack, pack->name);
+#endif
+ return;
+ }
+
#if EI2_DEBUG & 0x4
trilobite_debug ("-> check_tree_for_conflicts_helper");
#endif
@@ -888,7 +929,9 @@ check_tree_helper (EazelInstall *service,
for (iterator = pack->depends; iterator; iterator = g_list_next (iterator)) {
PackageDependency *dep = PACKAGEDEPENDENCY (iterator->data);
- check_tree_helper (service, dep->package, extra_packages);
+ (*path) = g_list_prepend (*path, pack);
+ check_tree_helper (service, dep->package, extra_packages, path);
+ (*path) = g_list_remove (*path, pack);
}
#if EI2_DEBUG & 0x4
trilobite_debug ("<- check_tree_for_conflicts_helper");
@@ -911,7 +954,8 @@ check_tree_for_conflicts (EazelInstall *service,
#endif
for (iterator = g_list_first (*packages); iterator != NULL; iterator = g_list_next (iterator)) {
PackageData *pack = PACKAGEDATA (iterator->data);
- check_tree_helper (service, pack, extra_packages);
+ GList *path = NULL;
+ check_tree_helper (service, pack, extra_packages, &path);
}
#if EI2_DEBUG & 0x4
trilobite_debug ("<- check_tree_for_conflicts");
@@ -1395,7 +1439,9 @@ download_packages (EazelInstall *service,
#endif
for (iterator = flat_packages; iterator; iterator = g_list_next (iterator)) {
PackageData *pack = PACKAGEDATA (iterator->data);
- eazel_install_fetch_package (service, pack);
+ if (pack->filename == NULL) {
+ eazel_install_fetch_package (service, pack);
+ }
}
g_list_free (flat_packages);
@@ -1510,6 +1556,13 @@ install_packages_helper (EazelInstall *service,
return;
}
+static void
+set_toplevel (PackageData *package,
+ EazelInstall *service)
+{
+ package->toplevel = TRUE;
+}
+
EazelInstallOperationStatus
install_packages (EazelInstall *service, GList *categories)
{
@@ -1518,6 +1571,7 @@ install_packages (EazelInstall *service, GList *categories)
GList *extra_packages = NULL;
packages = packagedata_list_copy (categorylist_flatten_to_packagelist (categories), TRUE);
+ g_list_foreach (packages, (GFunc)set_toplevel, service);
do {
extra_packages = NULL;
install_packages_helper (service, &packages, &extra_packages);
diff --git a/components/services/install/lib/eazel-install-object.c b/components/services/install/lib/eazel-install-object.c
index 7d2230dd9..0cd026791 100644
--- a/components/services/install/lib/eazel-install-object.c
+++ b/components/services/install/lib/eazel-install-object.c
@@ -1356,7 +1356,7 @@ eazel_install_emit_preflight_check (EazelInstall *service,
if (eazel_install_get_ei2 (service) || pack->toplevel) {
packages_in_signal = g_list_prepend (packages_in_signal, pack);
- }
+ }
}
gtk_signal_emit (GTK_OBJECT (service),
diff --git a/components/services/install/lib/eazel-install-protocols.c b/components/services/install/lib/eazel-install-protocols.c
index 7e5d2698f..d564af834 100644
--- a/components/services/install/lib/eazel-install-protocols.c
+++ b/components/services/install/lib/eazel-install-protocols.c
@@ -612,23 +612,27 @@ eazel_install_fetch_package (EazelInstall *service,
char *name = g_strdup (package->name);
char *version = g_strdup (package->version);
- switch (eazel_install_get_protocol (service)) {
- case PROTOCOL_FTP:
- case PROTOCOL_HTTP:
- {
- if (eazel_softcat_get_info (service->private->softcat, package, EAZEL_SOFTCAT_SENSE_GE,
- PACKAGE_FILL_NO_PROVIDES | PACKAGE_FILL_NO_DEPENDENCIES)
- == EAZEL_SOFTCAT_SUCCESS) {
- url = g_strdup (package->remote_url);
- } else {
- url = NULL;
- }
+ if (package->remote_url != NULL) {
+ url = g_strdup (package->remote_url);
+ } else {
+ switch (eazel_install_get_protocol (service)) {
+ case PROTOCOL_FTP:
+ case PROTOCOL_HTTP:
+ {
+ if (eazel_softcat_get_info (service->private->softcat, package, EAZEL_SOFTCAT_SENSE_GE,
+ PACKAGE_FILL_NO_PROVIDES | PACKAGE_FILL_NO_DEPENDENCIES)
+ == EAZEL_SOFTCAT_SUCCESS) {
+ url = g_strdup (package->remote_url);
+ } else {
+ url = NULL;
+ }
+ }
+ break;
+ case PROTOCOL_LOCAL:
+ url = g_strdup_printf ("%s", rpmfilename_from_packagedata (package));
+ break;
+ };
}
- break;
- case PROTOCOL_LOCAL:
- url = g_strdup_printf ("%s", rpmfilename_from_packagedata (package));
- break;
- };
if (url == NULL) {
char *rname = packagedata_get_readable_name (package);
diff --git a/components/services/install/lib/eazel-install-xml-package-list.c b/components/services/install/lib/eazel-install-xml-package-list.c
index 634448b48..632f05a6f 100644
--- a/components/services/install/lib/eazel-install-xml-package-list.c
+++ b/components/services/install/lib/eazel-install-xml-package-list.c
@@ -542,6 +542,9 @@ eazel_install_packagedata_to_xml (const PackageData *pack,
xmlNodePtr root, node;
char *tmp;
GList *iterator;
+ /* This is a horrible crackpatch for PR3 used to check for recursive
+ depends... */
+ static GList *path = NULL;
if (droot) {
g_assert (title != NULL);
@@ -587,12 +590,16 @@ eazel_install_packagedata_to_xml (const PackageData *pack,
}
node = xmlNewChild (root, NULL, "PROVIDES", tmp);
}
-
+
for (iterator = pack->depends; iterator; iterator = iterator->next) {
- eazel_install_packagedata_to_xml (((PackageDependency*)iterator->data)->package,
- "SOFT_DEPEND",
- root,
- include_provides);
+ if (g_list_find (path, ((PackageDependency*)iterator->data)->package) == NULL) {
+ path = g_list_prepend (path, ((PackageDependency*)iterator->data)->package);
+ eazel_install_packagedata_to_xml (((PackageDependency*)iterator->data)->package,
+ "SOFT_DEPEND",
+ root,
+ include_provides);
+ path = g_list_remove (path, ((PackageDependency*)iterator->data)->package);
+ }
}
for (iterator = pack->soft_depends; iterator; iterator = iterator->next) {
eazel_install_packagedata_to_xml ((PackageData*)iterator->data,
diff --git a/components/services/install/lib/eazel-package-system-rpm3.c b/components/services/install/lib/eazel-package-system-rpm3.c
index bfd8b52c7..251f21150 100644
--- a/components/services/install/lib/eazel-package-system-rpm3.c
+++ b/components/services/install/lib/eazel-package-system-rpm3.c
@@ -203,10 +203,6 @@ make_rpm_argument_list (EazelPackageSystemRpm3 *system,
}
}
-#ifdef USE_PERCENT
- (*args) = g_list_prepend (*args, g_strdup ("--percent"));
-#endif
-
if (op == EAZEL_PACKAGE_SYSTEM_OPERATION_UNINSTALL) {
(*args) = g_list_prepend (*args, g_strdup ("-e"));
} else {
@@ -215,12 +211,14 @@ make_rpm_argument_list (EazelPackageSystemRpm3 *system,
}
if (flags & EAZEL_PACKAGE_SYSTEM_OPERATION_UPGRADE) {
#ifdef USE_PERCENT
+ (*args) = g_list_prepend (*args, g_strdup ("--percent"));
(*args) = g_list_prepend (*args, g_strdup ("-Uv"));
#else
(*args) = g_list_prepend (*args, g_strdup ("-Uvh"));
#endif
} else {
#ifdef USE_PERCENT
+ (*args) = g_list_prepend (*args, g_strdup ("--percent"));
(*args) = g_list_prepend (*args, g_strdup ("-iv"));
#else
(*args) = g_list_prepend (*args, g_strdup ("-ivh"));
@@ -859,14 +857,15 @@ eazel_package_system_rpm3_packagedata_fill_from_header (EazelPackageSystemRpm3 *
for (index = 0; index < count; index++) {
PackageData *package = packagedata_new ();
PackageDependency *pack_dep = packagedependency_new ();
-
+
/* If it's a lib*.so* or a /yadayada, add to provides */
if ((strncmp (requires_name[index], "lib", 3)==0 &&
strstr (requires_name[index], ".so")) ||
- *requires_name[index]=='/') {
+ (strncmp (requires_name[index], "ld-linux.so",11)==0) ||
+ (*requires_name[index]=='/')) {
/* Unless it has a ( in the name */
if (strchr (requires_name[index], '(')==NULL) {
- package->provides = g_list_prepend (package->provides,
+ package->features = g_list_prepend (package->features,
g_strdup (requires_name[index]));
}
} else {
@@ -943,7 +942,10 @@ rpm_packagedata_new_from_file (EazelPackageSystemRpm3 *system,
PackageData *pack;
pack = packagedata_new ();
- rpm_packagedata_fill_from_file (system, pack, file, detail_level);
+ if (rpm_packagedata_fill_from_file (system, pack, file, detail_level)==FALSE) {
+ gtk_object_unref (GTK_OBJECT (pack));
+ pack = NULL;
+ }
return pack;
}
@@ -957,7 +959,9 @@ eazel_package_system_rpm3_load_package (EazelPackageSystemRpm3 *system,
if (in_package) {
result = in_package;
- rpm_packagedata_fill_from_file (system, result, filename, detail_level);
+ if (rpm_packagedata_fill_from_file (system, result, filename, detail_level)==FALSE) {
+ result = NULL;
+ }
} else {
result = rpm_packagedata_new_from_file (system, filename, detail_level);
}
diff --git a/components/services/install/lib/eazel-package-system.c b/components/services/install/lib/eazel-package-system.c
index cc7ca713a..53034d698 100644
--- a/components/services/install/lib/eazel-package-system.c
+++ b/components/services/install/lib/eazel-package-system.c
@@ -27,6 +27,7 @@
#include "eazel-package-system-private.h"
#include <libtrilobite/trilobite-core-distribution.h>
#include <libtrilobite/trilobite-core-utils.h>
+#include <libtrilobite/trilobite-md5-tools.h>
enum {
START,
@@ -246,9 +247,14 @@ eazel_package_system_load_package (EazelPackageSystem *system,
int detail_level)
{
PackageData *result = NULL;
+ char md5[16];
EPS_SANE_VAL (system, NULL);
g_assert (system->private->load_package);
result = (*system->private->load_package) (system, in_package, filename, detail_level);
+ if (result) {
+ trilobite_md5_get_digest_from_file (filename, md5);
+ result->md5 = g_strdup (trilobite_md5_get_string_from_md5_digest (md5));
+ }
return result;
}