summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEskil Heyn Olsen <eskil@src.gnome.org>2000-11-03 23:28:35 +0000
committerEskil Heyn Olsen <eskil@src.gnome.org>2000-11-03 23:28:35 +0000
commitba6f56e8746e42ec894314d55ec6b5dac1b617f0 (patch)
treeaa54acf5588e8e7aa54393a658a0015f60aba3e6
parent81ce5d543fb8acc466d8736c5e8c785b5d56756d (diff)
downloadnautilus-ba6f56e8746e42ec894314d55ec6b5dac1b617f0.tar.gz
Made a last minute fix to the delete file signal change in the rpmview.
* components/rpmview/nautilus-rpm-view-install.c: (nautilus_rpm_view_download_progress_signal), (nautilus_rpm_view_install_progress_signal), (nautilus_rpm_view_dependency_check), (nautilus_rpm_view_install_done), (nautilus_rpm_view_install_package_callback): Made a last minute fix to the delete file signal change in the rpmview. The rpmview still cannot get the spinner to spin when installing/uninstalling, but I'm not going to use time on that now. * components/services/install/command-line/eazel-alt-install-corba. c: (install_failed): Fixed a typo and an error in the problem handler user * components/services/install/lib/eazel-install-logic.c: (eazel_install_check_existing_packages): Added release numbers to debug output. * components/services/install/lib/eazel-install-problem.c: (eazel_install_problem_case_to_string): Changed case_to_string message to a more imperative format * components/services/install/lib/eazel-install-protocols.c: (add_to_url): Use gnome_vfs_escape_string instead of our own. * components/services/install/lib/eazel-install-types.c: (packagedata_get_readable_name): Hack so it should also recognize EazelCandidate names * components/services/install/nautilus-view/nautilus-service-instal l-view.h: * components/services/install/nautilus-view/nautilus-service-instal l-view.c: (nautilus_install_parse_uri), (show_dialog_and_run_away), (nautilus_service_install_solve_cases), (nautilus_service_install_done), (dig_up_errors), (nautilus_service_install_failed): Fix for 4443
-rw-r--r--ChangeLog41
-rw-r--r--components/rpmview/nautilus-rpm-view-install.c19
-rw-r--r--components/services/install-view/nautilus-service-install-view.c202
-rw-r--r--components/services/install-view/nautilus-service-install-view.h1
-rw-r--r--components/services/install/command-line/eazel-alt-install-corba.c13
-rw-r--r--components/services/install/lib/eazel-install-logic.c60
-rw-r--r--components/services/install/lib/eazel-install-problem.c18
-rw-r--r--components/services/install/lib/eazel-install-protocols.c12
-rw-r--r--components/services/install/lib/eazel-install-types.c6
-rw-r--r--components/services/install/nautilus-view/nautilus-service-install-view.c202
-rw-r--r--components/services/install/nautilus-view/nautilus-service-install-view.h1
11 files changed, 365 insertions, 210 deletions
diff --git a/ChangeLog b/ChangeLog
index 880e606d2..c67b28178 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,44 @@
+2000-11-03 Eskil Heyn Olsen <eskil@eazel.com>
+
+ * components/rpmview/nautilus-rpm-view-install.c:
+ (nautilus_rpm_view_download_progress_signal),
+ (nautilus_rpm_view_install_progress_signal),
+ (nautilus_rpm_view_dependency_check),
+ (nautilus_rpm_view_install_done),
+ (nautilus_rpm_view_install_package_callback):
+ Made a last minute fix to the delete file signal change in the
+ rpmview. The rpmview still cannot get the spinner to spin when
+ installing/uninstalling, but I'm not going to use time on that
+ now.
+
+ * components/services/install/command-line/eazel-alt-install-corba.
+ c: (install_failed):
+ Fixed a typo and an error in the problem handler user
+
+ * components/services/install/lib/eazel-install-logic.c:
+ (eazel_install_check_existing_packages):
+ Added release numbers to debug output.
+ * components/services/install/lib/eazel-install-problem.c:
+ (eazel_install_problem_case_to_string):
+ Changed case_to_string message to a more imperative format
+
+ * components/services/install/lib/eazel-install-protocols.c:
+ (add_to_url):
+ Use gnome_vfs_escape_string instead of our own.
+
+ * components/services/install/lib/eazel-install-types.c:
+ (packagedata_get_readable_name):
+ Hack so it should also recognize EazelCandidate names
+
+ * components/services/install/nautilus-view/nautilus-service-instal
+ l-view.h:
+ * components/services/install/nautilus-view/nautilus-service-instal
+ l-view.c: (nautilus_install_parse_uri), (show_dialog_and_run_away),
+ (nautilus_service_install_solve_cases),
+ (nautilus_service_install_done), (dig_up_errors),
+ (nautilus_service_install_failed):
+ Fix for 4443
+
2000-11-03 Andy Hertzfeld <andy@eazel.com>
* libnautilus-extensions/nautilus-icon-canvas-item.c:
diff --git a/components/rpmview/nautilus-rpm-view-install.c b/components/rpmview/nautilus-rpm-view-install.c
index 534276d28..8dc5b0493 100644
--- a/components/rpmview/nautilus-rpm-view-install.c
+++ b/components/rpmview/nautilus-rpm-view-install.c
@@ -50,8 +50,8 @@ nautilus_rpm_view_download_progress_signal (EazelInstallCallback *service,
if (amount == total && total!=0) {
fprintf (stdout, "\n");
}
-#endif
nautilus_view_report_load_underway (nautilus_rpm_view_get_view (rpm_view));
+#endif
}
static void
@@ -79,9 +79,8 @@ nautilus_rpm_view_install_progress_signal (EazelInstallCallback *service,
fprintf (stdout, "\n");
}
-#endif
nautilus_view_report_load_underway (nautilus_rpm_view_get_view (rpm_view));
-#if 0
+
progress = total==amount ? 1.0 : (double)(((double)amount)/total);
/* nautilus_view_report_load_progress (nautilus_rpm_view_get_view (rpm_view), progress); */
#endif
@@ -201,7 +200,9 @@ nautilus_rpm_view_dependency_check (EazelInstallCallback *service,
g_message ("Doing dependency check for %s-%s - needs something, but I don't know what it was...\n",
package->name, package->version);
}
+#if 0
nautilus_view_report_load_underway (nautilus_rpm_view_get_view (rpm_view));
+#endif
}
/* get rid of the installer and root client, and reactivate buttons */
@@ -261,6 +262,14 @@ nautilus_rpm_view_install_done (EazelInstallCallback *service,
nautilus_view_report_load_complete (nautilus_rpm_view_get_view (rpm_view));
}
+ {
+ CORBA_Environment ev;
+ CORBA_exception_init (&ev);
+ eazel_install_callback_delete_files (service, &ev);
+ CORBA_exception_free (&ev);
+ }
+
+
nautilus_rpm_view_finished_working (rpm_view);
tmp = g_strdup (nautilus_rpm_view_get_uri (rpm_view));
@@ -422,11 +431,11 @@ nautilus_rpm_view_install_package_callback (GtkWidget *widget,
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);
gtk_signal_connect (GTK_OBJECT (cb), "install_failed", nautilus_rpm_view_install_failed, rpm_view);
+ gtk_signal_connect (GTK_OBJECT (cb), "uninstall_failed", nautilus_rpm_view_install_failed, rpm_view);
gtk_signal_connect (GTK_OBJECT (cb), "download_failed", nautilus_rpm_view_download_failed, rpm_view);
- gtk_signal_connect (GTK_OBJECT (cb), "dependency_check", nautilus_rpm_view_dependency_check, rpm_view);
gtk_signal_connect (GTK_OBJECT (cb), "done", nautilus_rpm_view_install_done, rpm_view);
- gtk_signal_connect (GTK_OBJECT (cb), "delete_files", GTK_SIGNAL_FUNC (delete_files), NULL);
gtk_signal_connect (GTK_OBJECT (cb), "preflight_check", GTK_SIGNAL_FUNC (preflight_check), NULL);
eazel_install_callback_install_packages (cb, categories, NULL, &ev);
diff --git a/components/services/install-view/nautilus-service-install-view.c b/components/services/install-view/nautilus-service-install-view.c
index de9eead38..ac3f7ef1d 100644
--- a/components/services/install-view/nautilus-service-install-view.c
+++ b/components/services/install-view/nautilus-service-install-view.c
@@ -410,7 +410,7 @@ nautilus_install_parse_uri (const char *uri, NautilusServiceInstallView *view, G
}
}
- package_name = g_strdup (p);
+ package_name = gnome_vfs_unescape_string_for_display (p);
pack = create_package (package_name, view->details->using_local_file);
if (q) {
pack->version = g_strdup (q);
@@ -819,11 +819,7 @@ show_dialog_and_run_away (NautilusServiceInstallView *view, const char *message)
GtkWidget *dialog;
GtkWidget *toplevel;
-#if 0
- toplevel = gtk_widget_get_ancestor (view->details->message_box, GTK_TYPE_WINDOW);
-#else
toplevel = gtk_widget_get_toplevel (view->details->message_box);
-#endif
if (GTK_IS_WINDOW (toplevel)) {
dialog = gnome_ok_dialog_parented (message, GTK_WINDOW (toplevel));
} else {
@@ -890,6 +886,48 @@ nautilus_install_service_locate_menu_entries (NautilusServiceInstallView *view)
return result;
}
+static gboolean
+nautilus_service_install_solve_cases (NautilusServiceInstallView *view)
+{
+ gboolean answer = FALSE;
+ GtkWidget *toplevel;
+ GString *messages;
+ GList *strings;
+ GtkWidget *dialog;
+
+ messages = g_string_new ("");
+
+ if (view->details->problem_cases) {
+ GList *iterator;
+ /* Create string versions to show the user */
+ g_string_sprintfa (messages, "%s\n%s\n\n",
+ _("I ran into problems while installing."),
+ _("I'd like to try the following :"));
+ strings = eazel_install_problem_cases_to_string (view->details->problem,
+ view->details->problem_cases);
+ for (iterator = strings; iterator; iterator = g_list_next (iterator)) {
+ g_string_sprintfa (messages, " \xB7 %s\n", (char*)(iterator->data));
+ }
+ g_list_foreach (strings, (GFunc)g_free, NULL);
+ g_list_free (strings);
+ g_string_sprintfa (messages, "\n%s",
+ _("Is this ok ?"));
+
+ toplevel = gtk_widget_get_toplevel (view->details->message_box);
+ if (GTK_IS_WINDOW (toplevel)) {
+ dialog = gnome_question_dialog_parented (messages->str, (GnomeReplyCallback)reply_callback,
+ &answer, GTK_WINDOW (toplevel));
+ } else {
+ dialog = gnome_question_dialog (messages->str, (GnomeReplyCallback)reply_callback, &answer);
+ }
+ gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
+ gnome_dialog_run_and_close (GNOME_DIALOG (dialog));
+ g_string_free (messages, TRUE);
+ }
+
+ return answer;
+}
+
static void
nautilus_service_install_done (EazelInstallCallback *cb, gboolean success, NautilusServiceInstallView *view)
{
@@ -898,7 +936,7 @@ nautilus_service_install_done (EazelInstallCallback *cb, gboolean success, Nauti
GtkWidget *dialog;
char *message;
char *real_message;
- gboolean answer;
+ gboolean answer = FALSE;
g_assert (NAUTILUS_IS_SERVICE_INSTALL_VIEW (view));
@@ -909,7 +947,6 @@ nautilus_service_install_done (EazelInstallCallback *cb, gboolean success, Nauti
success = FALSE;
view->details->failure = FALSE;
/* we have already indicated failure elsewhere. good day to you, sir. */
- return;
}
turn_cylon_off (view, success ? 1.0 : 0.0);
@@ -920,58 +957,66 @@ nautilus_service_install_done (EazelInstallCallback *cb, gboolean success, Nauti
message = _("Installation aborted.");
} else {
message = _("Installation failed!");
+ answer = nautilus_service_install_solve_cases (view);
}
show_overall_feedback (view, message);
- if (success && view->details->desktop_files) {
- real_message = g_strdup_printf (_("%s\n%s\nErase the leftover RPM files?"),
- message,
- nautilus_install_service_locate_menu_entries (view));
- } else {
- real_message = g_strdup_printf (_("%s\nErase the leftover RPM files?"), message);
- }
- toplevel = gtk_widget_get_toplevel (view->details->message_box);
- if (GTK_IS_WINDOW (toplevel)) {
- dialog = gnome_question_dialog_parented (real_message, (GnomeReplyCallback)reply_callback,
- &answer, GTK_WINDOW (toplevel));
- } else {
- dialog = gnome_question_dialog (real_message, (GnomeReplyCallback)reply_callback, &answer);
- }
- gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
- gnome_dialog_run_and_close (GNOME_DIALOG (dialog));
- g_free (real_message);
-
if (answer) {
- CORBA_exception_init (&ev);
- eazel_install_callback_delete_files (cb, &ev);
- CORBA_exception_free (&ev);
- }
-
- if (view->details->core_package) {
- message = _("\nA core package of Nautilus has been\n"
- "updated, you should restart Nautilus.\n\n"
- "Do you wish to do that now ?\n");
+ eazel_install_problem_handle_cases (view->details->problem,
+ view->details->installer,
+ &(view->details->problem_cases),
+ NULL);
+ } else {
+ if (success && view->details->desktop_files) {
+ real_message = g_strdup_printf (_("%s\n%s\nErase the leftover RPM files?"),
+ message,
+ nautilus_install_service_locate_menu_entries (view));
+ } else {
+ real_message = g_strdup_printf (_("%s\nErase the leftover RPM files?"), message);
+ }
+ toplevel = gtk_widget_get_toplevel (view->details->message_box);
if (GTK_IS_WINDOW (toplevel)) {
- dialog = gnome_question_dialog_parented (message, (GnomeReplyCallback)reply_callback,
+ dialog = gnome_question_dialog_parented (real_message, (GnomeReplyCallback)reply_callback,
&answer, GTK_WINDOW (toplevel));
} else {
- dialog = gnome_question_dialog (message, (GnomeReplyCallback)reply_callback, &answer);
+ dialog = gnome_question_dialog (real_message, (GnomeReplyCallback)reply_callback, &answer);
}
gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
gnome_dialog_run_and_close (GNOME_DIALOG (dialog));
+ g_free (real_message);
if (answer) {
- if (execlp ("nautilus", "nautilus", "--restart", NULL)==-1) {
- g_message ("Exec error %s", strerror (errno));
+ CORBA_exception_init (&ev);
+ eazel_install_callback_delete_files (cb, &ev);
+ CORBA_exception_free (&ev);
+ }
+
+ if (view->details->core_package) {
+ message = _("\nA core package of Nautilus has been\n"
+ "updated, you should restart Nautilus.\n\n"
+ "Do you wish to do that now ?\n");
+ if (GTK_IS_WINDOW (toplevel)) {
+ dialog = gnome_question_dialog_parented (message, (GnomeReplyCallback)reply_callback,
+ &answer, GTK_WINDOW (toplevel));
+ } else {
+ dialog = gnome_question_dialog (message, (GnomeReplyCallback)reply_callback, &answer);
}
+ gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
+ gnome_dialog_run_and_close (GNOME_DIALOG (dialog));
+
+ if (answer) {
+ if (execlp ("nautilus", "nautilus", "--restart", NULL)==-1) {
+ g_message ("Exec error %s", strerror (errno));
+ }
+ }
+ } else {
+ nautilus_view_open_location (view->details->nautilus_view, NEXT_SERVICE_VIEW);
}
- } else {
- nautilus_view_open_location (view->details->nautilus_view, NEXT_SERVICE_VIEW);
}
}
-
+#if 0
/* recursive descent of a package and its dependencies, building up a GString of errors */
static void
dig_up_errors (NautilusServiceInstallView *view,
@@ -980,22 +1025,40 @@ dig_up_errors (NautilusServiceInstallView *view,
{
GList *iter;
GList *strings;
+ GList *new_cases = NULL;
+ /* Debug code :This outputs the "raw" tree problems via g_message */
strings = eazel_install_problem_tree_to_string (view->details->problem,
package);
-
+ for (iter = strings; iter; iter = g_list_next (iter)) {
+ g_message ("install-error: %s", (char*)(iter->data));
+ }
+ g_list_foreach (strings, (GFunc)g_free, NULL);
+ g_list_free (strings);
+ /* Debug code end */
+
+
+ /* Create string versions to show the user */
+ strings = eazel_install_problem_cases_to_string (view->details->problem,
+ new_cases);
for (iter = strings; iter; iter = g_list_next (iter)) {
g_string_sprintfa (messages, " \xB7 %s\n", (char*)(iter->data));
}
g_list_foreach (strings, (GFunc)g_free, NULL);
g_list_free (strings);
+
+ /* Concat to the entire set */
+ view->details->problem_cases = g_list_concat (view->details->problem_cases,
+ new_cases);
}
+#endif
static void
-nautilus_service_install_failed (EazelInstallCallback *cb, const PackageData *pack, NautilusServiceInstallView *view)
+nautilus_service_install_failed (EazelInstallCallback *cb, const PackageData *package, NautilusServiceInstallView *view)
{
CORBA_Environment ev;
GString *message;
+ char *tmp;
g_assert (NAUTILUS_IS_SERVICE_INSTALL_VIEW (view));
@@ -1005,7 +1068,7 @@ nautilus_service_install_failed (EazelInstallCallback *cb, const PackageData *pa
/* override the "success" result for install_done signal */
view->details->failure = TRUE;
- if (pack->status == PACKAGE_ALREADY_INSTALLED) {
+ if (package->status == PACKAGE_ALREADY_INSTALLED) {
message = g_string_append (message, _("This package has already been installed."));
show_overall_feedback (view, message->str);
show_dialog_and_run_away (view, message->str);
@@ -1019,53 +1082,18 @@ nautilus_service_install_failed (EazelInstallCallback *cb, const PackageData *pa
return;
}
- g_string_sprintfa (message, _("Installation Failed!\n\n"));
- show_overall_feedback (view, message->str);
-
- dig_up_errors (view, pack, message);
- show_dialog_and_run_away (view, message->str);
- g_string_free (message, TRUE);
-
- /* always delete the RPM files in this case */
- CORBA_exception_init (&ev);
- eazel_install_callback_delete_files (cb, &ev);
- CORBA_exception_free (&ev);
-}
-
+ tmp = packagedata_get_readable_name (package);
+ g_string_sprintfa (message, _("Installation failed on %s\n\n"), tmp);
+ g_free (tmp);
-#if 0
-static gboolean
-nautilus_service_install_delete_files (EazelInstallCallback *cb, NautilusServiceInstallView *view)
-{
- GtkWidget *toplevel;
- GtkWidget *dialog;
- gboolean answer;
- const char *message;
-
- g_assert (NAUTILUS_IS_SERVICE_INSTALL_VIEW (view));
-
- message = _("Should I delete the leftover RPM files?");
-
- if (view->details->cancelled ||
- view->details->failure) {
- /* don't bother to ask on failure -- just clean up */
- return TRUE;
- }
+ show_overall_feedback (view, message->str);
- toplevel = gtk_widget_get_toplevel (view->details->message_box);
- if (GTK_IS_WINDOW (toplevel)) {
- dialog = gnome_question_dialog_parented (message, (GnomeReplyCallback)reply_callback,
- &answer, GTK_WINDOW (toplevel));
- } else {
- dialog = gnome_question_dialog (message, (GnomeReplyCallback)reply_callback, &answer);
- }
- gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
+ /* Get the new set of problem cases */
+ eazel_install_problem_tree_to_case (view->details->problem,
+ package,
+ &(view->details->problem_cases));
- gnome_dialog_run_and_close (GNOME_DIALOG (dialog));
- return answer;
}
-#endif
-
/* signal callback -- ask the user for the root password (for installs) */
static char *
diff --git a/components/services/install-view/nautilus-service-install-view.h b/components/services/install-view/nautilus-service-install-view.h
index 1ac480f13..de4ad4615 100644
--- a/components/services/install-view/nautilus-service-install-view.h
+++ b/components/services/install-view/nautilus-service-install-view.h
@@ -87,6 +87,7 @@ struct _NautilusServiceInstallViewDetails {
*/
gboolean core_package;
+ GList *problem_cases;
GList *desktop_files;
};
diff --git a/components/services/install/command-line/eazel-alt-install-corba.c b/components/services/install/command-line/eazel-alt-install-corba.c
index ce3f28953..ed78875b2 100644
--- a/components/services/install/command-line/eazel-alt-install-corba.c
+++ b/components/services/install/command-line/eazel-alt-install-corba.c
@@ -414,7 +414,7 @@ install_failed (EazelInstallCallback *service,
if (stuff) {
GList *it;
for (it = stuff; it; it = g_list_next (it)) {
- fprintf (stdout, "PRoblem : %s\n", (char*)(it->data));
+ fprintf (stdout, "Problem : %s\n", (char*)(it->data));
}
}
@@ -544,12 +544,13 @@ create_package (char *name)
return pack;
}
-static void
+static gboolean
delete_files (EazelInstallCallback *service, EazelInstallProblem *problem)
{
char answer[128];
gboolean ask_delete = TRUE;
-
+ gboolean result = TRUE;
+
if (cases) {
printf ("continue? (y/n) ");
fflush (stdout);
@@ -563,6 +564,7 @@ delete_files (EazelInstallCallback *service, EazelInstallProblem *problem)
fflush (stdout);
eazel_install_problem_handle_cases (problem, service, &cases, arg_root);
ask_delete = FALSE;
+ result = FALSE;
} else {
eazel_install_problem_case_list_destroy (cases);
cases = NULL;
@@ -584,6 +586,7 @@ delete_files (EazelInstallCallback *service, EazelInstallProblem *problem)
eazel_install_callback_delete_files (service, &ev);
}
}
+ return result;
}
static void
@@ -593,8 +596,8 @@ done (EazelInstallCallback *service,
{
fprintf (stderr, "Operation %s\n", result ? "ok" : "failed");
cli_result = result ? 0 : 1;
- delete_files (service, problem);
- if (cases == NULL) {
+
+ if (delete_files (service, problem)) {
gtk_main_quit ();
}
}
diff --git a/components/services/install/lib/eazel-install-logic.c b/components/services/install/lib/eazel-install-logic.c
index e9e4930d6..d606a0e5e 100644
--- a/components/services/install/lib/eazel-install-logic.c
+++ b/components/services/install/lib/eazel-install-logic.c
@@ -1441,8 +1441,10 @@ eazel_install_check_existing_packages (EazelInstall *service,
/* check against minor version */
if (res==0) {
- trilobite_debug ("versions are equal, comparing minor");
+ trilobite_debug ("versions are equal, comparing minosr");
if (pack->minor && existing_package->minor) {
+ trilobite_debug ("minors are %s and %s (installed)",
+ pack->minor, existing_package->minor);
res = rpmvercmp (pack->minor, existing_package->minor);
} else if (!pack->minor && existing_package->minor) {
/* If the given packages does not have a minor,
@@ -1472,23 +1474,44 @@ eazel_install_check_existing_packages (EazelInstall *service,
/* Debug output */
switch (result) {
case EAZEL_INSTALL_STATUS_QUO: {
- trilobite_debug (_("%s version %s already installed"),
- pack->name,
- existing_package->version);
+ if (pack->minor && existing_package->minor) {
+ trilobite_debug (_("%s-%s version %s-%s already installed"),
+ pack->name, pack->minor,
+ existing_package->version, existing_package->minor);
+ } else {
+ trilobite_debug (_("%s version %s already installed"),
+ pack->name,
+ existing_package->version);
+ }
}
break;
case EAZEL_INSTALL_STATUS_UPGRADES: {
- trilobite_debug (_("%s upgrades from version %s to %s"),
- pack->name,
- existing_package->version,
- pack->version);
+ /* This is certainly ugly as helll */
+ if (pack->minor && existing_package->minor) {
+ trilobite_debug (_("%s upgrades from version %s-%s to %s-%s"),
+ pack->name,
+ existing_package->version, existing_package->minor,
+ pack->version, pack->minor);
+ } else {
+ trilobite_debug (_("%s upgrades from version %s-%s to %s-%s"),
+ pack->name,
+ existing_package->version, existing_package->minor,
+ pack->version, pack->minor);
+ }
}
break;
case EAZEL_INSTALL_STATUS_DOWNGRADES: {
- trilobite_debug (_("%s downgrades from version %s to %s"),
- pack->name,
- existing_package->version,
- pack->version);
+ if (pack->minor && existing_package->minor) {
+ trilobite_debug (_("%s downgrades from version %s-%s to %s-%s"),
+ pack->name,
+ existing_package->version, existing_package->minor,
+ pack->version, pack->minor);
+ } else {
+ trilobite_debug (_("%s downgrades from version %s to %s"),
+ pack->name,
+ existing_package->version,
+ pack->version);
+ }
}
break;
default:
@@ -1505,9 +1528,16 @@ eazel_install_check_existing_packages (EazelInstall *service,
}
}
} else {
- trilobite_debug (_("%s installs version %s"),
- pack->name,
- pack->version);
+ if (pack->minor) {
+ trilobite_debug (_("%s installs version %s-%s"),
+ pack->name,
+ pack->version,
+ pack->minor);
+ } else {
+ trilobite_debug (_("%s installs version %s"),
+ pack->name,
+ pack->version);
+ }
}
return result;
diff --git a/components/services/install/lib/eazel-install-problem.c b/components/services/install/lib/eazel-install-problem.c
index 07c5fe349..7da4a87b0 100644
--- a/components/services/install/lib/eazel-install-problem.c
+++ b/components/services/install/lib/eazel-install-problem.c
@@ -151,10 +151,6 @@ get_detailed_messages_foreach (PackageData *pack, GetErrorsForEachData *data)
} else {
switch (pack->modify_status) {
case PACKAGE_MOD_UNTOUCHED:
- if (pack->modifies) {
- } else {
- message = g_strdup_printf (_("%s is already installed"), required);
- }
break;
case PACKAGE_MOD_UPGRADED:
break;
@@ -450,14 +446,14 @@ eazel_install_problem_case_to_string (EazelInstallProblemCase *pcase)
switch (pcase->problem) {
case EI_PROBLEM_UPDATE: {
char *required = packagedata_get_readable_name (pcase->u.update.pack);
- message = g_strdup_printf ("%s needs update", required);
+ message = g_strdup_printf ("Update %s", required);
g_free (required);
}
break;
case EI_PROBLEM_FORCE_INSTALL_BOTH: {
char *required_1 = packagedata_get_readable_name (pcase->u.force_install_both.pack_1);
char *required_2 = packagedata_get_readable_name (pcase->u.force_install_both.pack_2);
- message = g_strdup_printf ("%s and %s are both needed",
+ message = g_strdup_printf ("Install both %s and %s",
required_1,
required_2);
g_free (required_1);
@@ -466,13 +462,13 @@ eazel_install_problem_case_to_string (EazelInstallProblemCase *pcase)
break;
case EI_PROBLEM_REMOVE: {
char *required = packagedata_get_readable_name (pcase->u.remove.pack);
- message = g_strdup_printf ("%s needs to be removed", required);
+ message = g_strdup_printf ("Remove %s", required);
g_free (required);
}
break;
case EI_PROBLEM_FORCE_REMOVE: {
char *required = packagedata_get_readable_name (pcase->u.force_remove.pack);
- message = g_strdup_printf ("%s needs to be forcefully removed", required);
+ message = g_strdup_printf ("Force remove %s", required);
g_free (required);
}
break;
@@ -633,17 +629,21 @@ void
eazel_install_problem_step (EazelInstallProblem *problem)
{
P_SANITY (problem);
+#ifdef EIP_DEBUG
g_message ("g_hash_table_size (problem->pre_step_attempts) = %d",
g_hash_table_size (problem->pre_step_attempts));
g_message ("g_hash_table_size (problem->attempts) = %d",
g_hash_table_size (problem->attempts));
+#endif
g_hash_table_foreach_remove (problem->pre_step_attempts,
(GHRFunc)problem_step_foreach_remove,
problem->attempts);
+#ifdef EIP_DEBUG
g_message ("g_hash_table_size (problem->pre_step_attempts) = %d",
g_hash_table_size (problem->pre_step_attempts));
g_message ("g_hash_table_size (problem->attempts) = %d",
g_hash_table_size (problem->attempts));
+#endif
}
/* This returns a GList<EazelInstallProblemCase> list containing the
@@ -719,12 +719,14 @@ find_dominant_problem_type (EazelInstallProblem *problem,
EazelInstallProblemCase *pcase = (EazelInstallProblemCase*)(iterator->data);
if (pcase->problem > dominant) {
dominant = pcase->problem;
+#ifdef EIP_DEBUG
{
char *message = eazel_install_problem_case_to_string (pcase);
g_message ("dominant problem is now %d", dominant);
g_message ("aka %s", message);
g_free (message);
}
+#endif
}
}
return dominant;
diff --git a/components/services/install/lib/eazel-install-protocols.c b/components/services/install/lib/eazel-install-protocols.c
index 17d7aaa73..c4e365a86 100644
--- a/components/services/install/lib/eazel-install-protocols.c
+++ b/components/services/install/lib/eazel-install-protocols.c
@@ -616,6 +616,17 @@ add_to_url (char **url,
const char *cgi_string,
const char *val)
{
+ char *tmp;
+
+ if (val) {
+ tmp = g_strconcat (*url,
+ cgi_string,
+ gnome_vfs_escape_string (val),
+ NULL);
+ g_free (*url);
+ (*url) = tmp;
+ }
+#if 0
char *tmp, *quoted, *q;
const char *p;
int needs_quoting;
@@ -657,6 +668,7 @@ add_to_url (char **url,
if (needs_quoting) {
g_free (quoted);
}
+#endif
}
static char*
diff --git a/components/services/install/lib/eazel-install-types.c b/components/services/install/lib/eazel-install-types.c
index 21fe3e51e..9ff14789c 100644
--- a/components/services/install/lib/eazel-install-types.c
+++ b/components/services/install/lib/eazel-install-types.c
@@ -622,16 +622,16 @@ packagedata_get_readable_name (const PackageData *pack)
} else if (pack->name && pack->version) {
/* This is a hack to shorten EazelSourceSnapshot names
into the build date/time */
- if (strstr (pack->version, "EazelSourceSnapshot.2000") != NULL) {
+ if (strstr (pack->version, "Eazel")!=NULL && strstr (pack->version, ".2000") != NULL) {
char *month[] = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug",
"Sep", "Oct", "Nov", "Dec"};
char *temp, *temp2;
int mo, da, ho, mi;
/* this crap is too long to display ! */
temp = g_strdup (pack->version);
- temp2 = strstr (temp, "EazelSourceSnapshot.2000");
+ temp2 = strstr (temp, ".2000");
strcpy (temp2, "ESS");
- temp2 += strlen ("EazelSourceSnapshot.2000");
+ temp2 += strlen (".2000");
sscanf (temp2, "%2d%2d%2d%2d", &mo, &da, &ho, &mi);
result = g_strdup_printf ("%s of %d %s, %02d:%02d",
pack->name,
diff --git a/components/services/install/nautilus-view/nautilus-service-install-view.c b/components/services/install/nautilus-view/nautilus-service-install-view.c
index de9eead38..ac3f7ef1d 100644
--- a/components/services/install/nautilus-view/nautilus-service-install-view.c
+++ b/components/services/install/nautilus-view/nautilus-service-install-view.c
@@ -410,7 +410,7 @@ nautilus_install_parse_uri (const char *uri, NautilusServiceInstallView *view, G
}
}
- package_name = g_strdup (p);
+ package_name = gnome_vfs_unescape_string_for_display (p);
pack = create_package (package_name, view->details->using_local_file);
if (q) {
pack->version = g_strdup (q);
@@ -819,11 +819,7 @@ show_dialog_and_run_away (NautilusServiceInstallView *view, const char *message)
GtkWidget *dialog;
GtkWidget *toplevel;
-#if 0
- toplevel = gtk_widget_get_ancestor (view->details->message_box, GTK_TYPE_WINDOW);
-#else
toplevel = gtk_widget_get_toplevel (view->details->message_box);
-#endif
if (GTK_IS_WINDOW (toplevel)) {
dialog = gnome_ok_dialog_parented (message, GTK_WINDOW (toplevel));
} else {
@@ -890,6 +886,48 @@ nautilus_install_service_locate_menu_entries (NautilusServiceInstallView *view)
return result;
}
+static gboolean
+nautilus_service_install_solve_cases (NautilusServiceInstallView *view)
+{
+ gboolean answer = FALSE;
+ GtkWidget *toplevel;
+ GString *messages;
+ GList *strings;
+ GtkWidget *dialog;
+
+ messages = g_string_new ("");
+
+ if (view->details->problem_cases) {
+ GList *iterator;
+ /* Create string versions to show the user */
+ g_string_sprintfa (messages, "%s\n%s\n\n",
+ _("I ran into problems while installing."),
+ _("I'd like to try the following :"));
+ strings = eazel_install_problem_cases_to_string (view->details->problem,
+ view->details->problem_cases);
+ for (iterator = strings; iterator; iterator = g_list_next (iterator)) {
+ g_string_sprintfa (messages, " \xB7 %s\n", (char*)(iterator->data));
+ }
+ g_list_foreach (strings, (GFunc)g_free, NULL);
+ g_list_free (strings);
+ g_string_sprintfa (messages, "\n%s",
+ _("Is this ok ?"));
+
+ toplevel = gtk_widget_get_toplevel (view->details->message_box);
+ if (GTK_IS_WINDOW (toplevel)) {
+ dialog = gnome_question_dialog_parented (messages->str, (GnomeReplyCallback)reply_callback,
+ &answer, GTK_WINDOW (toplevel));
+ } else {
+ dialog = gnome_question_dialog (messages->str, (GnomeReplyCallback)reply_callback, &answer);
+ }
+ gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
+ gnome_dialog_run_and_close (GNOME_DIALOG (dialog));
+ g_string_free (messages, TRUE);
+ }
+
+ return answer;
+}
+
static void
nautilus_service_install_done (EazelInstallCallback *cb, gboolean success, NautilusServiceInstallView *view)
{
@@ -898,7 +936,7 @@ nautilus_service_install_done (EazelInstallCallback *cb, gboolean success, Nauti
GtkWidget *dialog;
char *message;
char *real_message;
- gboolean answer;
+ gboolean answer = FALSE;
g_assert (NAUTILUS_IS_SERVICE_INSTALL_VIEW (view));
@@ -909,7 +947,6 @@ nautilus_service_install_done (EazelInstallCallback *cb, gboolean success, Nauti
success = FALSE;
view->details->failure = FALSE;
/* we have already indicated failure elsewhere. good day to you, sir. */
- return;
}
turn_cylon_off (view, success ? 1.0 : 0.0);
@@ -920,58 +957,66 @@ nautilus_service_install_done (EazelInstallCallback *cb, gboolean success, Nauti
message = _("Installation aborted.");
} else {
message = _("Installation failed!");
+ answer = nautilus_service_install_solve_cases (view);
}
show_overall_feedback (view, message);
- if (success && view->details->desktop_files) {
- real_message = g_strdup_printf (_("%s\n%s\nErase the leftover RPM files?"),
- message,
- nautilus_install_service_locate_menu_entries (view));
- } else {
- real_message = g_strdup_printf (_("%s\nErase the leftover RPM files?"), message);
- }
- toplevel = gtk_widget_get_toplevel (view->details->message_box);
- if (GTK_IS_WINDOW (toplevel)) {
- dialog = gnome_question_dialog_parented (real_message, (GnomeReplyCallback)reply_callback,
- &answer, GTK_WINDOW (toplevel));
- } else {
- dialog = gnome_question_dialog (real_message, (GnomeReplyCallback)reply_callback, &answer);
- }
- gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
- gnome_dialog_run_and_close (GNOME_DIALOG (dialog));
- g_free (real_message);
-
if (answer) {
- CORBA_exception_init (&ev);
- eazel_install_callback_delete_files (cb, &ev);
- CORBA_exception_free (&ev);
- }
-
- if (view->details->core_package) {
- message = _("\nA core package of Nautilus has been\n"
- "updated, you should restart Nautilus.\n\n"
- "Do you wish to do that now ?\n");
+ eazel_install_problem_handle_cases (view->details->problem,
+ view->details->installer,
+ &(view->details->problem_cases),
+ NULL);
+ } else {
+ if (success && view->details->desktop_files) {
+ real_message = g_strdup_printf (_("%s\n%s\nErase the leftover RPM files?"),
+ message,
+ nautilus_install_service_locate_menu_entries (view));
+ } else {
+ real_message = g_strdup_printf (_("%s\nErase the leftover RPM files?"), message);
+ }
+ toplevel = gtk_widget_get_toplevel (view->details->message_box);
if (GTK_IS_WINDOW (toplevel)) {
- dialog = gnome_question_dialog_parented (message, (GnomeReplyCallback)reply_callback,
+ dialog = gnome_question_dialog_parented (real_message, (GnomeReplyCallback)reply_callback,
&answer, GTK_WINDOW (toplevel));
} else {
- dialog = gnome_question_dialog (message, (GnomeReplyCallback)reply_callback, &answer);
+ dialog = gnome_question_dialog (real_message, (GnomeReplyCallback)reply_callback, &answer);
}
gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
gnome_dialog_run_and_close (GNOME_DIALOG (dialog));
+ g_free (real_message);
if (answer) {
- if (execlp ("nautilus", "nautilus", "--restart", NULL)==-1) {
- g_message ("Exec error %s", strerror (errno));
+ CORBA_exception_init (&ev);
+ eazel_install_callback_delete_files (cb, &ev);
+ CORBA_exception_free (&ev);
+ }
+
+ if (view->details->core_package) {
+ message = _("\nA core package of Nautilus has been\n"
+ "updated, you should restart Nautilus.\n\n"
+ "Do you wish to do that now ?\n");
+ if (GTK_IS_WINDOW (toplevel)) {
+ dialog = gnome_question_dialog_parented (message, (GnomeReplyCallback)reply_callback,
+ &answer, GTK_WINDOW (toplevel));
+ } else {
+ dialog = gnome_question_dialog (message, (GnomeReplyCallback)reply_callback, &answer);
}
+ gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
+ gnome_dialog_run_and_close (GNOME_DIALOG (dialog));
+
+ if (answer) {
+ if (execlp ("nautilus", "nautilus", "--restart", NULL)==-1) {
+ g_message ("Exec error %s", strerror (errno));
+ }
+ }
+ } else {
+ nautilus_view_open_location (view->details->nautilus_view, NEXT_SERVICE_VIEW);
}
- } else {
- nautilus_view_open_location (view->details->nautilus_view, NEXT_SERVICE_VIEW);
}
}
-
+#if 0
/* recursive descent of a package and its dependencies, building up a GString of errors */
static void
dig_up_errors (NautilusServiceInstallView *view,
@@ -980,22 +1025,40 @@ dig_up_errors (NautilusServiceInstallView *view,
{
GList *iter;
GList *strings;
+ GList *new_cases = NULL;
+ /* Debug code :This outputs the "raw" tree problems via g_message */
strings = eazel_install_problem_tree_to_string (view->details->problem,
package);
-
+ for (iter = strings; iter; iter = g_list_next (iter)) {
+ g_message ("install-error: %s", (char*)(iter->data));
+ }
+ g_list_foreach (strings, (GFunc)g_free, NULL);
+ g_list_free (strings);
+ /* Debug code end */
+
+
+ /* Create string versions to show the user */
+ strings = eazel_install_problem_cases_to_string (view->details->problem,
+ new_cases);
for (iter = strings; iter; iter = g_list_next (iter)) {
g_string_sprintfa (messages, " \xB7 %s\n", (char*)(iter->data));
}
g_list_foreach (strings, (GFunc)g_free, NULL);
g_list_free (strings);
+
+ /* Concat to the entire set */
+ view->details->problem_cases = g_list_concat (view->details->problem_cases,
+ new_cases);
}
+#endif
static void
-nautilus_service_install_failed (EazelInstallCallback *cb, const PackageData *pack, NautilusServiceInstallView *view)
+nautilus_service_install_failed (EazelInstallCallback *cb, const PackageData *package, NautilusServiceInstallView *view)
{
CORBA_Environment ev;
GString *message;
+ char *tmp;
g_assert (NAUTILUS_IS_SERVICE_INSTALL_VIEW (view));
@@ -1005,7 +1068,7 @@ nautilus_service_install_failed (EazelInstallCallback *cb, const PackageData *pa
/* override the "success" result for install_done signal */
view->details->failure = TRUE;
- if (pack->status == PACKAGE_ALREADY_INSTALLED) {
+ if (package->status == PACKAGE_ALREADY_INSTALLED) {
message = g_string_append (message, _("This package has already been installed."));
show_overall_feedback (view, message->str);
show_dialog_and_run_away (view, message->str);
@@ -1019,53 +1082,18 @@ nautilus_service_install_failed (EazelInstallCallback *cb, const PackageData *pa
return;
}
- g_string_sprintfa (message, _("Installation Failed!\n\n"));
- show_overall_feedback (view, message->str);
-
- dig_up_errors (view, pack, message);
- show_dialog_and_run_away (view, message->str);
- g_string_free (message, TRUE);
-
- /* always delete the RPM files in this case */
- CORBA_exception_init (&ev);
- eazel_install_callback_delete_files (cb, &ev);
- CORBA_exception_free (&ev);
-}
-
+ tmp = packagedata_get_readable_name (package);
+ g_string_sprintfa (message, _("Installation failed on %s\n\n"), tmp);
+ g_free (tmp);
-#if 0
-static gboolean
-nautilus_service_install_delete_files (EazelInstallCallback *cb, NautilusServiceInstallView *view)
-{
- GtkWidget *toplevel;
- GtkWidget *dialog;
- gboolean answer;
- const char *message;
-
- g_assert (NAUTILUS_IS_SERVICE_INSTALL_VIEW (view));
-
- message = _("Should I delete the leftover RPM files?");
-
- if (view->details->cancelled ||
- view->details->failure) {
- /* don't bother to ask on failure -- just clean up */
- return TRUE;
- }
+ show_overall_feedback (view, message->str);
- toplevel = gtk_widget_get_toplevel (view->details->message_box);
- if (GTK_IS_WINDOW (toplevel)) {
- dialog = gnome_question_dialog_parented (message, (GnomeReplyCallback)reply_callback,
- &answer, GTK_WINDOW (toplevel));
- } else {
- dialog = gnome_question_dialog (message, (GnomeReplyCallback)reply_callback, &answer);
- }
- gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
+ /* Get the new set of problem cases */
+ eazel_install_problem_tree_to_case (view->details->problem,
+ package,
+ &(view->details->problem_cases));
- gnome_dialog_run_and_close (GNOME_DIALOG (dialog));
- return answer;
}
-#endif
-
/* signal callback -- ask the user for the root password (for installs) */
static char *
diff --git a/components/services/install/nautilus-view/nautilus-service-install-view.h b/components/services/install/nautilus-view/nautilus-service-install-view.h
index 1ac480f13..de4ad4615 100644
--- a/components/services/install/nautilus-view/nautilus-service-install-view.h
+++ b/components/services/install/nautilus-view/nautilus-service-install-view.h
@@ -87,6 +87,7 @@ struct _NautilusServiceInstallViewDetails {
*/
gboolean core_package;
+ GList *problem_cases;
GList *desktop_files;
};