Commit 293ae8b1 authored by Robey Pointer's avatar Robey Pointer
Browse files

reviewed by: Eskil Heyn Olsen <eskil@eazel.com>

	* components/services/install/lib/eazel-install-corba-callback.c:
	(impl_install_failed), (impl_uninstall_failed):

	Change direct casts to GtkObject-style casts.

	* components/services/install/nautilus-view/forms.c:
	(make_query_box):

	Vera'fy the installer text.

	* nautilus-installer/install-lib/Makefile.am:
	* nautilus-installer/src/Makefile.am:
	* nautilus-installer/src/create-eazel-installer.sh:

	Cause installer to be built with -g -O2, and to notice a debug
	build and not strip the binary.

	* nautilus-installer/src/installer.c: (report_unusual_errors),
	(install_failed), (uninstall_failed), (download_failed),
	(install_done):
	* nautilus-installer/src/installer.h:

	Remove crufted error-tree parsing code (install lib does this for
	us now).  Notice when any install or download fails, and treat
	that as an overall failure, even if install_done is called with
	success = TRUE.

	* nautilus-installer/src/main.c: (segv_handler), (main):

	Catch more signals, but only in debug mode.

	* nautilus-installer/src/package-tree.c:

	Remove references to nonexistent icons.
parent b6b7d0b2
2001-02-22 Robey Pointer <robey@eazel.com>
reviewed by: Eskil Heyn Olsen <eskil@eazel.com>
* components/services/install/lib/eazel-install-corba-callback.c:
(impl_install_failed), (impl_uninstall_failed):
* components/services/install/nautilus-view/forms.c:
(make_query_box):
Vera'fy the installer text.
* nautilus-installer/install-lib/Makefile.am:
* nautilus-installer/src/Makefile.am:
* nautilus-installer/src/create-eazel-installer.sh:
Cause installer to be built with -g -O2, and to notice a debug
build and not strip the binary.
* nautilus-installer/src/installer.c: (report_unusual_errors),
(install_failed), (uninstall_failed), (download_failed),
(install_done):
* nautilus-installer/src/installer.h:
Remove crufted error-tree parsing code (install lib does this for
us now). Notice when any install or download fails, and treat
that as an overall failure, even if install_done is called with
success = TRUE.
* nautilus-installer/src/main.c: (segv_handler), (main):
Catch more signals, but only in debug mode.
* nautilus-installer/src/package-tree.c:
Remove references to nonexistent icons.
2001-02-22 Ian McKellar <ian@eazel.com>
reviewed by: Eskil Heyn Olsen <eskil@eazel.com>
......
......@@ -374,13 +374,14 @@ make_query_box (NautilusServiceInstallView *view, EazelInstallCallbackOperation
{
GtkWidget *top_label;
GtkWidget *bottom_label;
GtkWidget *bottom_label_2;
GtkWidget *hbox_list;
GtkWidget *vbox_list;
GtkWidget *list_label;
GtkWidget *hbox_buttons;
GtkWidget *button_ok;
GtkWidget *button_cancel;
char *text;
char *text, *text2;
GList *iter;
unsigned long total_k;
PackageData *package;
......@@ -389,16 +390,20 @@ make_query_box (NautilusServiceInstallView *view, EazelInstallCallbackOperation
switch (op) {
case EazelInstallCallbackOperation_INSTALL:
text = _("These packages are about to be downloaded and installed:");
text = _("These packages are ready to be downloaded and installed:");
text2 = _("If you wish to download and install these packages, click Continue.");
break;
case EazelInstallCallbackOperation_UNINSTALL:
text = _("These packages are about to be uninstalled:");
text = _("These packages are ready to be uninstalled:");
text2 = _("If you wish to uninstall these packages, click Continue.");
break;
case EazelInstallCallbackOperation_REVERT:
text = _("These packages are about to be reverted:");
text = _("These packages are ready to be reverted:");
text2 = _("If you wish to revert these packages, click Continue.");
break;
default:
text = "???";
text2 = "";
}
top_label = eazel_services_label_new (NULL, 0, 0.0, 0.0, 0, 0,
EAZEL_SERVICES_BODY_TEXT_COLOR_RGB,
......@@ -408,6 +413,14 @@ make_query_box (NautilusServiceInstallView *view, EazelInstallCallbackOperation
nautilus_label_set_justify (NAUTILUS_LABEL (top_label), GTK_JUSTIFY_LEFT);
gtk_widget_show (top_label);
bottom_label_2 = eazel_services_label_new (NULL, 0, 0.0, 0.0, 0, 0,
EAZEL_SERVICES_BODY_TEXT_COLOR_RGB,
EAZEL_SERVICES_BACKGROUND_COLOR_RGB,
NULL, -1, FALSE);
nautilus_label_set_text (NAUTILUS_LABEL (bottom_label_2), text2);
nautilus_label_set_justify (NAUTILUS_LABEL (bottom_label_2), GTK_JUSTIFY_LEFT);
gtk_widget_show (bottom_label_2);
/* build up vbox list of packages */
vbox_list = gtk_vbox_new (FALSE, 0);
for (iter = g_list_first (package_list); iter != NULL; iter = g_list_next (iter)) {
......@@ -476,7 +489,8 @@ make_query_box (NautilusServiceInstallView *view, EazelInstallCallbackOperation
gtk_box_pack_start (GTK_BOX (view->details->query_box), top_label, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (view->details->query_box), hbox_list, FALSE, FALSE, 10);
gtk_box_pack_start (GTK_BOX (view->details->query_box), bottom_label, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (view->details->query_box), hbox_buttons, FALSE, FALSE, 10);
gtk_box_pack_start (GTK_BOX (view->details->query_box), bottom_label_2, FALSE, FALSE, 15);
gtk_box_pack_start (GTK_BOX (view->details->query_box), hbox_buttons, FALSE, FALSE, 0);
gtk_widget_show (view->details->query_box);
gtk_container_set_focus_child (GTK_CONTAINER (view->details->form), button_ok);
......
......@@ -246,7 +246,7 @@ impl_install_failed (impl_POA_GNOME_Trilobite_Eazel_InstallCallback *servant,
g_warning ("install_failed called with error in package tree!");
} else {
/* always called with only one package at the root of the tree */
gtk_signal_emit (GTK_OBJECT (servant->object), signals[INSTALL_FAILED], (PackageData *)(packages->data));
gtk_signal_emit (GTK_OBJECT (servant->object), signals[INSTALL_FAILED], PACKAGEDATA (packages->data));
}
g_list_foreach (packages, (GFunc)gtk_object_unref, NULL);
g_list_free (packages);
......@@ -264,7 +264,7 @@ impl_uninstall_failed (impl_POA_GNOME_Trilobite_Eazel_InstallCallback *servant,
g_warning ("uninstall_failed called with error in package tree!");
} else {
/* always called with only one package at the root of the tree */
gtk_signal_emit (GTK_OBJECT (servant->object), signals[UNINSTALL_FAILED], (PackageData *)(packages->data));
gtk_signal_emit (GTK_OBJECT (servant->object), signals[UNINSTALL_FAILED], PACKAGEDATA (packages->data));
}
g_list_foreach (packages, (GFunc)gtk_object_unref, NULL);
}
......
......@@ -374,13 +374,14 @@ make_query_box (NautilusServiceInstallView *view, EazelInstallCallbackOperation
{
GtkWidget *top_label;
GtkWidget *bottom_label;
GtkWidget *bottom_label_2;
GtkWidget *hbox_list;
GtkWidget *vbox_list;
GtkWidget *list_label;
GtkWidget *hbox_buttons;
GtkWidget *button_ok;
GtkWidget *button_cancel;
char *text;
char *text, *text2;
GList *iter;
unsigned long total_k;
PackageData *package;
......@@ -389,16 +390,20 @@ make_query_box (NautilusServiceInstallView *view, EazelInstallCallbackOperation
switch (op) {
case EazelInstallCallbackOperation_INSTALL:
text = _("These packages are about to be downloaded and installed:");
text = _("These packages are ready to be downloaded and installed:");
text2 = _("If you wish to download and install these packages, click Continue.");
break;
case EazelInstallCallbackOperation_UNINSTALL:
text = _("These packages are about to be uninstalled:");
text = _("These packages are ready to be uninstalled:");
text2 = _("If you wish to uninstall these packages, click Continue.");
break;
case EazelInstallCallbackOperation_REVERT:
text = _("These packages are about to be reverted:");
text = _("These packages are ready to be reverted:");
text2 = _("If you wish to revert these packages, click Continue.");
break;
default:
text = "???";
text2 = "";
}
top_label = eazel_services_label_new (NULL, 0, 0.0, 0.0, 0, 0,
EAZEL_SERVICES_BODY_TEXT_COLOR_RGB,
......@@ -408,6 +413,14 @@ make_query_box (NautilusServiceInstallView *view, EazelInstallCallbackOperation
nautilus_label_set_justify (NAUTILUS_LABEL (top_label), GTK_JUSTIFY_LEFT);
gtk_widget_show (top_label);
bottom_label_2 = eazel_services_label_new (NULL, 0, 0.0, 0.0, 0, 0,
EAZEL_SERVICES_BODY_TEXT_COLOR_RGB,
EAZEL_SERVICES_BACKGROUND_COLOR_RGB,
NULL, -1, FALSE);
nautilus_label_set_text (NAUTILUS_LABEL (bottom_label_2), text2);
nautilus_label_set_justify (NAUTILUS_LABEL (bottom_label_2), GTK_JUSTIFY_LEFT);
gtk_widget_show (bottom_label_2);
/* build up vbox list of packages */
vbox_list = gtk_vbox_new (FALSE, 0);
for (iter = g_list_first (package_list); iter != NULL; iter = g_list_next (iter)) {
......@@ -476,7 +489,8 @@ make_query_box (NautilusServiceInstallView *view, EazelInstallCallbackOperation
gtk_box_pack_start (GTK_BOX (view->details->query_box), top_label, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (view->details->query_box), hbox_list, FALSE, FALSE, 10);
gtk_box_pack_start (GTK_BOX (view->details->query_box), bottom_label, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (view->details->query_box), hbox_buttons, FALSE, FALSE, 10);
gtk_box_pack_start (GTK_BOX (view->details->query_box), bottom_label_2, FALSE, FALSE, 15);
gtk_box_pack_start (GTK_BOX (view->details->query_box), hbox_buttons, FALSE, FALSE, 0);
gtk_widget_show (view->details->query_box);
gtk_container_set_focus_child (GTK_CONTAINER (view->details->form), button_ok);
......
......@@ -6,6 +6,8 @@ endif
noinst_LIBRARIES = $(LIBRARY)
CFLAGS = -g -O2 -Wall -Werror
libeazelinstall_minimal_a_SOURCES = \
eazel-install-metadata.c \
eazel-install-protocols.c \
......
......@@ -2,7 +2,7 @@
NULL =
OGFLAG = -g
OG_FLAG = -g -O2 -DDEBUG
#OGFLAG = -O
WARN_FLAG = -Wall -Werror
......@@ -92,4 +92,4 @@ eazel_installer_LDADD = \
# $(NULL)
eazel-installer.sh: eazel-installer prescript
sh create-eazel-installer.sh
export CFLAGS="$(CFLAGS)" && sh create-eazel-installer.sh
#!/bin/sh
echo "* Stripping"
strip eazel-installer
echo $CFLAGS | grep -q "DEBUG"
if [ $? != 0 ]; then
echo "* Stripping"
strip eazel-installer
fi
echo "* Packing"
......
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 8; tab-width: 8 -*- */
/*
* Copyright (C) 2000, 2001 Eazel, Inc.
*
......@@ -54,15 +54,6 @@
#include "bootstrap-background.xpm" /* background for every panel */
#include "error-symbol.xpm" /* icon to add to error panel */
/* Data argument to get_detailed_errors_foreach.
Contains the installer and a path in the tree
leading to the actual package */
typedef struct {
EazelInstaller *installer;
GList *path;
GList *touched;
} GetErrorsForEachData;
/* this means the services have to keep an insecure version running, that has enough stuff for ppl
* to install nautilus.
*/
......@@ -185,7 +176,7 @@ char *text_labels[LAST_LABEL];
/* FIXME -- CHANGE THIS BEFORE RELEASING! */
int installer_debug = 1;
char *installer_server = "checkpoint.eazel.com";
char *installer_server = "triggerfish.eazel.com";
int installer_server_port = 8888;
int installer_spam = 0; /* dump logging stuff to stderr (automatically adds --debug) */
......@@ -937,51 +928,31 @@ add_force_remove (EazelInstaller *installer,
}
#endif
static void get_detailed_errors_foreach (PackageData *pack, GetErrorsForEachData *data);
static void
get_detailed_errors_foreach_dep (PackageDependency *dep, GetErrorsForEachData *data)
report_unusual_errors (const PackageData *pack, EazelInstaller *installer)
{
get_detailed_errors_foreach (dep->package, data);
}
static void
get_detailed_errors_foreach (PackageData *pack, GetErrorsForEachData *data)
{
char *message, *distro;
EazelInstaller *installer = data->installer;
PackageData *pack_in;
CategoryData *cat;
CategoryData *category;
PackageData *top_pack;
GList *iter, *iter2;
char *name, *message, *distro;
if (data->path != NULL) {
if (g_list_find (data->path, pack) != NULL) {
/* recursing... */
return;
}
}
name = packagedata_get_readable_name (pack);
log_debug ("error handling begins: errant package %s", name);
g_free (name);
if (data->touched != NULL) {
if (g_list_find (data->touched, pack) != NULL) {
/* revisiting a part of the tree we've already seen */
return;
}
if (eazel_install_failed_because_of_disk_full (installer->service)) {
installer->failure_info = g_list_prepend (installer->failure_info,
g_strdup (_("You've run out of disk space!")));
}
log_debug ("pack->name = %s, pack->status = %d", pack->name, pack->status);
/* is this the right place for this check anymore? */
if (pack->status == PACKAGE_CANNOT_OPEN) {
/* check if the package we could not open was in categories, since
then it's a distro issue. Don't use install_categories, as if eg.
gnumeric is added because of need upgrade, but fails for some reason,
people get told that it could be a distro issue. */
for (iter = installer->categories; iter; iter = g_list_next (iter)) {
cat = (CategoryData *)iter->data;
for (iter2 = cat->packages; iter2 ; iter2 = g_list_next (iter2)) {
pack_in = PACKAGEDATA (iter2->data);
log_debug ("pack->name = %s, pack_in->name = %s", pack->name, pack_in->name);
if (strcmp (pack->name, pack_in->name) == 0) {
/* check if it was a toplevel package */
for (iter = g_list_first (installer->categories); iter != NULL; iter = g_list_next (iter)) {
category = (CategoryData *)(iter->data);
for (iter2 = g_list_first (category->packages); iter2 != NULL; iter2 = g_list_next (iter2)) {
top_pack = PACKAGEDATA (iter2->data);
if (strcmp (pack->name, top_pack->name) == 0) {
g_message ("bad mojo: cannot open package %s", pack->name);
distro = trilobite_get_distribution_name (trilobite_get_distribution (),
TRUE, FALSE);
......@@ -995,58 +966,6 @@ get_detailed_errors_foreach (PackageData *pack, GetErrorsForEachData *data)
}
}
}
/*
if (pack->conflicts_checked && !pack->toplevel) {
GList *packages;
CategoryData *cat = (CategoryData*)(installer->install_categories->data);
g_message ("adding %s to install_categories", required);
packages = cat->packages;
packages = g_list_prepend (packages, pack);
cat->packages = packages;
}
*/
/* Create the path list */
data->path = g_list_prepend (data->path, pack);
data->touched = g_list_prepend (data->touched, pack);
g_list_foreach (pack->depends, (GFunc)get_detailed_errors_foreach_dep, data);
g_list_foreach (pack->modifies, (GFunc)get_detailed_errors_foreach, data);
g_list_foreach (pack->breaks, (GFunc)get_detailed_errors_foreach, data);
/* Pop the currect pack from the path */
data->path = g_list_remove (data->path, pack);
}
static void
get_detailed_errors (const PackageData *pack, EazelInstaller *installer)
{
GetErrorsForEachData data;
PackageData *non_const_pack;
char *name;
name = packagedata_get_readable_name (pack);
log_debug ("error tree traversal begins: errant package %s", name);
g_free (name);
if (eazel_install_failed_because_of_disk_full (installer->service)) {
installer->failure_info = g_list_prepend (installer->failure_info,
_("You've run out of disk space!"));
}
data.installer = installer;
data.path = NULL;
data.touched = NULL;
log_debug ("copying package");
non_const_pack = PACKAGEDATA (pack);
gtk_object_ref (GTK_OBJECT (non_const_pack));
// non_const_pack = packagedata_copy (pack, TRUE);
log_debug ("getting detailed errors");
get_detailed_errors_foreach (non_const_pack, &data);
log_debug ("destroying copy");
gtk_object_unref (GTK_OBJECT (non_const_pack));
g_list_free (data.touched);
}
......@@ -1087,8 +1006,9 @@ install_failed (EazelInstall *service,
{
g_message ("INSTALL FAILED.");
get_detailed_errors (pd, installer);
report_unusual_errors (pd, installer);
collect_failure_info (service, pd, installer, FALSE);
installer->had_failures = TRUE;
}
static void
......@@ -1098,6 +1018,7 @@ uninstall_failed (EazelInstall *service,
{
g_message ("UNINSTALL FAILED.");
collect_failure_info (service, pd, installer, TRUE);
installer->had_failures = TRUE;
}
static void
......@@ -1112,6 +1033,7 @@ download_failed (EazelInstall *service,
installer->failure_info = g_list_append (installer->failure_info, temp);
}
g_message ("Download FAILED for %s", package->name);
installer->had_failures = TRUE;
}
static gboolean
......@@ -1229,9 +1151,15 @@ install_done (EazelInstall *service,
{
char *temp = NULL;
installer->successful = result;
if (installer->had_failures) {
/* overrides a "TRUE" result */
installer->successful = FALSE;
} else {
installer->successful = result;
}
log_debug ("Done, result is %s", result ? "good" : "evil");
if (result == FALSE) {
if (! installer->successful) {
/* will call jump_to_error_page later */
if (installer->problems == NULL) {
if (! installer->failure_info) {
......
......@@ -84,6 +84,7 @@ struct _EazelInstaller
unsigned long last_KB;
gboolean successful;
gboolean had_failures;
/* once we've got this, we know mystery errors were caused by rpm (this is kind of a hack) */
gboolean got_dep_check;
......
......@@ -120,9 +120,9 @@ check_disk_space (void)
}
static void
segv_handler (int unused)
segv_handler (int signo)
{
fprintf (stderr, "\n\nSEGV -- CRASH BOOM, THE INSTALLER IS HOSED.\n\n");
fprintf (stderr, "\n\nSEGV (%d) -- SOMEBODY SET US UP THE BOMB.\n\n", signo);
while (1) {
sleep (1);
}
......@@ -157,7 +157,13 @@ main (int argc, char *argv[])
gnome_init_with_popt_table ("eazel-installer", VERSION, argc, argv, options, 0, NULL);
#ifdef DEBUG
signal (SIGSEGV, segv_handler);
signal (SIGABRT, segv_handler);
signal (SIGILL, segv_handler);
signal (SIGBUS, segv_handler);
signal (SIGFPE, segv_handler);
#endif
gdk_rgb_init ();
if (installer_show_build) {
......
......@@ -37,9 +37,15 @@
/* pixmaps */
#include "bootstrap-background.xpm"
#if 0 /* LATER */
#include "/h/robey/info.xpm"
#include "/h/robey/bong.xpm"
#include "/h/robey/rpm.xpm"
#else
char *info_xpm[] = { "" };
char *bong_xpm[] = { "" };
char *rpm_xpm[] = { "" };
#endif
#define RGB_BLACK 0x000000
#define RGB_RED 0xFF0000
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment