summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan McKellar <yakk@src.gnome.org>2001-02-08 01:14:31 +0000
committerIan McKellar <yakk@src.gnome.org>2001-02-08 01:14:31 +0000
commit0930369df413998cb35f6474113593ac45894b61 (patch)
treedb63b2444ec991a99b6f6dc2f2ade559b2fc5771
parent1984a70dc95f870a49b9b2113781eff6e203d3f2 (diff)
downloadnautilus-0930369df413998cb35f6474113593ac45894b61.tar.gz
If an RPM load fails then report it to Nautilus with:
* components/rpmview/nautilus-rpm-view.c: (nautilus_rpm_view_update_from_uri), (nautilus_rpm_view_load_uri), (rpm_view_load_location_callback): * components/rpmview/nautilus-rpm-view.h: If an RPM load fails then report it to Nautilus with: nautilus_view_report_load_failed, * components/services/install/lib/eazel-package-system-rpm3.c: (eazel_package_system_rpm3_packagedata_fill_from_header), (rpm_packagedata_fill_from_file): If an RPM load fails then report it to the caller. * components/services/trilobite/libtrilobite/trilobite-core-network .c: (trilobite_open_uri): Changed the unsafe `setenv' call to the safer `trilobite_setenv'.
-rw-r--r--ChangeLog20
-rw-r--r--components/rpmview/nautilus-rpm-view.c18
-rw-r--r--components/rpmview/nautilus-rpm-view.h2
-rw-r--r--components/services/install/lib/eazel-package-system-rpm3.c13
-rw-r--r--components/services/trilobite/libtrilobite/trilobite-core-network.c2
5 files changed, 44 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog
index 689e31f08..6fad5b0e3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,25 @@
2001-02-07 Ian McKellar <ian@eazel.com>
+ reviewed by: Eskil Heyn Olsen <eskil@eazel.com>
+
+ * components/rpmview/nautilus-rpm-view.c:
+ (nautilus_rpm_view_update_from_uri), (nautilus_rpm_view_load_uri),
+ (rpm_view_load_location_callback):
+ * components/rpmview/nautilus-rpm-view.h:
+ If an RPM load fails then report it to Nautilus with:
+ nautilus_view_report_load_failed,
+
+ * components/services/install/lib/eazel-package-system-rpm3.c:
+ (eazel_package_system_rpm3_packagedata_fill_from_header),
+ (rpm_packagedata_fill_from_file):
+ If an RPM load fails then report it to the caller.
+
+ * components/services/trilobite/libtrilobite/trilobite-core-network
+ .c: (trilobite_open_uri):
+ Changed the unsafe `setenv' call to the safer `trilobite_setenv'.
+
+2001-02-07 Ian McKellar <ian@eazel.com>
+
reviewed by: Maciej Stachowiak <mjs@eazel.com>
* components/services/inventory/eazel-inventory-collect-hardware.c:
diff --git a/components/rpmview/nautilus-rpm-view.c b/components/rpmview/nautilus-rpm-view.c
index 78ba94819..74c928208 100644
--- a/components/rpmview/nautilus-rpm-view.c
+++ b/components/rpmview/nautilus-rpm-view.c
@@ -460,7 +460,7 @@ add_to_clist (char *name,
/* open the package and copy the information, and then set up the appropriate views with it */
/* FIXME bugzilla.eazel.com 725: use gnome-vfs to open the package */
-static void
+static gboolean
nautilus_rpm_view_update_from_uri (NautilusRPMView *rpm_view, const char *uri)
{
char *temp_str;
@@ -481,6 +481,10 @@ nautilus_rpm_view_update_from_uri (NautilusRPMView *rpm_view, const char *uri)
PACKAGE_FILL_EVERYTHING);
g_free (path_name);
+ if (rpm_view->details->package == NULL) {
+ return FALSE;
+ }
+
/* Set the file list */
gtk_clist_freeze (GTK_CLIST (rpm_view->details->package_file_list));
gtk_clist_clear (GTK_CLIST (rpm_view->details->package_file_list));
@@ -556,6 +560,7 @@ nautilus_rpm_view_update_from_uri (NautilusRPMView *rpm_view, const char *uri)
gtk_widget_hide (rpm_view->details->package_verify_button);
}
#endif /* EAZEL_SERVICES */
+ return TRUE;
}
char*
@@ -576,12 +581,12 @@ nautilus_rpm_view_get_view (NautilusRPMView *view)
return view->details->nautilus_view;
}
-void
+gboolean
nautilus_rpm_view_load_uri (NautilusRPMView *rpm_view, const char *uri)
{
g_free(rpm_view->details->current_uri);
rpm_view->details->current_uri = g_strdup (uri);
- nautilus_rpm_view_update_from_uri(rpm_view, uri);
+ return nautilus_rpm_view_update_from_uri(rpm_view, uri);
}
static void
@@ -590,8 +595,11 @@ rpm_view_load_location_callback (NautilusView *view,
NautilusRPMView *rpm_view)
{
nautilus_view_report_load_underway (rpm_view->details->nautilus_view);
- nautilus_rpm_view_load_uri (rpm_view, location);
- nautilus_view_report_load_complete (rpm_view->details->nautilus_view);
+ if (nautilus_rpm_view_load_uri (rpm_view, location)) {
+ nautilus_view_report_load_complete (rpm_view->details->nautilus_view);
+ } else {
+ nautilus_view_report_load_failed (rpm_view->details->nautilus_view);
+ }
}
static gboolean
diff --git a/components/rpmview/nautilus-rpm-view.h b/components/rpmview/nautilus-rpm-view.h
index e57866e96..a6aa867a0 100644
--- a/components/rpmview/nautilus-rpm-view.h
+++ b/components/rpmview/nautilus-rpm-view.h
@@ -60,7 +60,7 @@ NautilusView *nautilus_rpm_view_get_nautilus_view (NautilusRPMView *view);
/* URI handling */
char* nautilus_rpm_view_get_uri (NautilusRPMView *view);
-void nautilus_rpm_view_load_uri (NautilusRPMView *view,
+gboolean nautilus_rpm_view_load_uri (NautilusRPMView *view,
const char *uri);
gboolean nautilus_rpm_view_get_installed (NautilusRPMView *view);
NautilusView* nautilus_rpm_view_get_view (NautilusRPMView *view);
diff --git a/components/services/install/lib/eazel-package-system-rpm3.c b/components/services/install/lib/eazel-package-system-rpm3.c
index b5dc87db8..0bc5ba85f 100644
--- a/components/services/install/lib/eazel-package-system-rpm3.c
+++ b/components/services/install/lib/eazel-package-system-rpm3.c
@@ -759,6 +759,7 @@ eazel_package_system_rpm3_packagedata_fill_from_header (EazelPackageSystemRpm3 *
headerGetEntry (hd,
RPMTAG_SIZE, NULL,
(void **) &sizep, NULL);
+
pack->bytesize = *sizep;
pack->packsys_struc = (gpointer)hd;
@@ -907,6 +908,7 @@ rpm_packagedata_fill_from_file (EazelPackageSystemRpm3 *system,
{
static FD_t fd;
Header hd;
+ int rpm_result;
/* Set filename field */
if (pack->filename != filename) {
@@ -930,12 +932,15 @@ rpm_packagedata_fill_from_file (EazelPackageSystemRpm3 *system,
}
/* Get Header block */
- rpmReadPackageHeader (fd, &hd, &pack->source_package, NULL, NULL);
- eazel_package_system_rpm3_packagedata_fill_from_header (system, pack, hd, detail_level);
- pack->status = PACKAGE_UNKNOWN_STATUS;
+ rpm_result = rpmReadPackageHeader (fd, &hd, &pack->source_package, NULL, NULL);
+ if (rpm_result == 0) {
+ eazel_package_system_rpm3_packagedata_fill_from_header (system, pack, hd, detail_level);
+ pack->status = PACKAGE_UNKNOWN_STATUS;
+ }
fdClose (fd);
- return TRUE;
+
+ return (rpm_result == 0) ? TRUE : FALSE;
}
static PackageData*
diff --git a/components/services/trilobite/libtrilobite/trilobite-core-network.c b/components/services/trilobite/libtrilobite/trilobite-core-network.c
index c2d7cc070..4fede526f 100644
--- a/components/services/trilobite/libtrilobite/trilobite-core-network.c
+++ b/components/services/trilobite/libtrilobite/trilobite-core-network.c
@@ -76,7 +76,7 @@ trilobite_open_uri (const char *uri_text)
GnomeVFSHandle *handle = NULL;
if (! gnome_vfs_initialized ()) {
- setenv ("GNOME_VFS_HTTP_USER_AGENT", trilobite_get_useragent_string (NULL), 1);
+ trilobite_setenv ("GNOME_VFS_HTTP_USER_AGENT", trilobite_get_useragent_string (NULL), 1);
if (! gnome_vfs_init ()) {
g_warning ("cannot initialize gnome-vfs!");