Commit 0f7688c1 authored by Eskil Heyn Olsen's avatar Eskil Heyn Olsen
Browse files

Fixed bug 5119, update rpmview to use EazelPackageSystem. I still need to


	* components/rpmview/Makefile.am:
	* components/rpmview/nautilus-rpm-verify-window.c:
	(nautilus_rpm_verify_window_initialize),
	(nautilus_rpm_verify_window_set_message),
	(nautilus_rpm_verify_window_update_message),
	(nautilus_rpm_verify_window_set_progress),
	(nautilus_rpm_verify_window_set_error_mode):
	* components/rpmview/nautilus-rpm-verify-window.h:
	* components/rpmview/nautilus-rpm-view-install.c:
	(nautilus_rpm_view_install_package_callback),
	(nautilus_rpm_view_uninstall_package_callback):
	* components/rpmview/nautilus-rpm-view-private.h:
	* components/rpmview/nautilus-rpm-view.c:
	(nautilus_rpm_view_initialize), (nautilus_rpm_view_destroy),
	(add_to_clist), (nautilus_rpm_view_update_from_uri),
	(verify_failed_signal), (verify_progress_signal),
	(nautilus_rpm_view_verify_files),
	(nautilus_rpm_view_verify_package_callback):
	Fixed bug 5119, update rpmview to use EazelPackageSystem. I
	still need to hook up the continue signal from the verifywindow,
	this is opened as bug 5123.

	* components/services/install/command-line/Makefile.am:
	* components/services/install/command-line/eazel-alt-install-corba.
	c:
	include eazel-package-system-types instead of
	eazel-install-types.h

	* components/services/install/command-line/eazel-test-packsys.c:
	(progress_signal), (failed_signal), (test_verify), (main):
	Implemented the test for verfiy.

	* components/services/install/lib/Makefile.am:
	Mangled to fix 5121.

	* components/services/install/lib/eazel-softcat.h:
	* components/services/install/lib/eazel-install-tests.h:
	* components/services/install/lib/eazel-install-xml-package-list.h:
	* components/services/install/lib/eazel-install-protocols.h:
	* components/services/install/lib/eazel-install-public.h:
	* components/services/install/lib/eazel-install-query.h:
	* components/services/install/lib/eazel-install-logic.h:
	* components/services/install/lib/eazel-install-metadata.h:
	* components/services/install/lib/eazel-install-object.c:
	* components/services/install/lib/eazel-install-problem.h:
	* components/services/install/lib/eazel-install-corba-callback.h:
	* components/services/install/lib/eazel-install-corba-types.h:
	include eazel-package-system-types instead of
	eazel-install-types.h

	* components/services/install/lib/eazel-install-logic.c:
	(eazel_install_download_packages),
	(eazel_install_check_for_file_conflicts),
	(eazel_install_start_signal), (eazel_install_end_signal),
	(eazel_install_progress_signal),
	(eazel_install_check_existing_packages),
	(eazel_uninstall_upward_traverse),
	(eazel_uninstall_downward_traverse),
	(eazel_uninstall_check_for_install):
	Fixed signals and use FILL_NO_DIRS_IN_PROVIDES

	* components/services/install/lib/eazel-install-protocols.c:
	(gnome_vfs_fetch_remote_file), (eazel_install_fetch_package):
	Use FILL_NO_DIRS_IN_PROVIDES

	* components/services/install/lib/eazel-install-rpm-glue.h:
	* components/services/install/lib/eazel-install-rpm-glue.c:
	(eazel_install_do_rpm_dependency_check):
	include eazel-package-system-types instead of
	eazel-install-types.h
	Also open/close the db when doing the rpmdepCheck call.

	* components/services/install/lib/eazel-install-types.c:
	* components/services/install/lib/eazel-install-types.h:
	Removed

	* components/services/install/lib/eazel-package-system.h:
	* components/services/install/lib/eazel-package-system-private.h:
	* components/services/install/lib/eazel-package-system.c:
	(eazel_package_system_load_implementation),
	(eazel_package_system_verify),
	(eazel_package_system_emit_progress):
	* components/services/install/lib/eazel-package-system-rpm3-private
	.h:
	* components/services/install/lib/eazel-package-system-rpm3.c:
	(monitor_rpm_process_pipe), (eazel_package_system_rpm3_create_dbs),
	(eazel_package_system_rpm3_open_dbs),
	(eazel_package_system_rpm3_close_dbs),
	(eazel_package_system_rpm3_free_dbs),
	(rpm_packagedata_fill_from_rpm_header),
	(rpm_packagedata_fill_from_file), (rpm_packagedata_new_from_file),
	(eazel_package_system_rpm3_load_package),
	(eazel_package_system_rpm3_query_impl),
	(eazel_package_system_rpm3_query_substr),
	(eazel_package_system_rpm3_query), (check_if_all_packages_seen),
	(eazel_package_system_rpm3_install_uninstall),
	(eazel_package_system_rpm3_verify_impl),
	(get_num_of_files_in_packages), (eazel_package_system_rpm3_verify),
	(eazel_package_system_rpm3_finalize),
	(eazel_package_system_rpm3_new),
	(eazel_package_system_implementation):
	* components/services/install/lib/eazel-package-system-rpm4.c:
	(eazel_package_system_rpm4_query),
	(eazel_package_system_rpm4_finalize),
	(eazel_package_system_rpm4_class_initialize),
	(eazel_package_system_rpm4_initialize),
	(eazel_package_system_rpm4_get_type),
	(eazel_package_system_rpm4_new),
	(eazel_package_system_implementation):
	* components/services/install/lib/eazel-package-system-rpm4.h:
	* components/services/install/lib/eazel-package-system-skeleton.c:
	(eazel_package_system_skeleton_verify):
	Shuffled the order of the info longs and the package in the
	progress signal.
	Implemented verify in rpm3 (fixes bug 5120)
	First pieces of code for the rpm4 module.
	Unfortunately, since rpmview now also has a eazelpackagesystem
	object, I ran into the problem of database locking. The rpmview
	would have a read-only version of all the db files, thereby
	failing in install because trilobite-eazel-install-service spawned
	a rpm that could not get exclusive lock. To fix this, I now have
	the db closed at all times, but open/close it everytime I do
	something. Unfortunately for the queryloops in
	eazel-install-logic, this means opening/closing on every
	query. Optionally, I should consider exposing
	eazel_package_system_open/close_dbs, so the caller can do it. But
	that makes the api a bit more cumbersome.

	* components/services/install/lib/eazel-package-system-types.h:
	* components/services/install/lib/eazel-package-system-types.c:
	(eazel_install_protocol_as_string), (categorydata_new),
	(categorydata_list_copy), (categorydata_copy),
	(categorydata_destroy_foreach), (categorydata_destroy),
	(categorydata_list_destroy), (packagedata_new),
	(packagedata_list_copy), (packagedata_copy),
	(packagedata_fill_in_missing), (packagedata_destroy),
	(packagedata_remove_soft_dep), (rpmfilename_from_packagedata),
	(rpmname_from_packagedata), (packagedata_get_readable_name),
	(packagedata_get_name), (packagedata_hash_equal),
	(packagedata_status_enum_to_str), (packagedata_status_str_to_enum),
	(packagedata_modstatus_enum_to_str),
	(packagedata_modstatus_str_to_enum), (packagedata_add_pack_to),
	(packagedata_add_pack_to_breaks),
	(packagedata_add_pack_to_soft_depends),
	(packagedata_add_pack_to_hard_depends),
	(packagedata_add_pack_to_modifies), (packagedata_list_prune),
	(packagerequirement_new),
	(eazel_install_package_provides_basename_compare),
	(eazel_install_package_provides_compare),
	(eazel_install_package_name_compare),
	(eazel_install_package_compare),
	(eazel_install_requirement_dep_compare),
	(eazel_install_requirement_dep_name_compare),
	(eazel_install_package_version_compare),
	(eazel_install_package_other_version_compare),
	(eazel_install_package_matches_versioning),
	(eazel_install_gtk_marshal_NONE__POINTER_INT_INT_INT_INT_INT_INT),
	(gstr_indent), (dump_package_list), (packagedata_dump_int),
	(packagedata_dump):
	Renamed eazel-install-types to eazel-package-system-types

	* components/services/install/nautilus-view/Makefile.am:
	Fixed linking after fix to 5121.

	* components/services/install/nautilus-view/nautilus-service-instal
	l-view.h:
	include eazel-package-system-types instead of
	eazel-install-types.h

	* components/services/install/server/Makefile.am:
	Fixed linking after fix to 5121.

	* components/services/trilobite/libtrilobite/trilobite-root-helper.
	c: (eazel_helper_start):
	Don't mention the info msg's from userhelper.

	* po/POTFILES.in:
	Renamed eazel-install-types to eazel-package-system-types.
parent 100d4d5c
2000-12-10 Eskil Heyn Olsen <eskil@eazel.com>
* components/rpmview/Makefile.am:
* components/rpmview/nautilus-rpm-verify-window.c:
(nautilus_rpm_verify_window_initialize),
(nautilus_rpm_verify_window_set_message),
(nautilus_rpm_verify_window_update_message),
(nautilus_rpm_verify_window_set_progress),
(nautilus_rpm_verify_window_set_error_mode):
* components/rpmview/nautilus-rpm-verify-window.h:
* components/rpmview/nautilus-rpm-view-install.c:
(nautilus_rpm_view_install_package_callback),
(nautilus_rpm_view_uninstall_package_callback):
* components/rpmview/nautilus-rpm-view-private.h:
* components/rpmview/nautilus-rpm-view.c:
(nautilus_rpm_view_initialize), (nautilus_rpm_view_destroy),
(add_to_clist), (nautilus_rpm_view_update_from_uri),
(verify_failed_signal), (verify_progress_signal),
(nautilus_rpm_view_verify_files),
(nautilus_rpm_view_verify_package_callback):
Fixed bug 5119, update rpmview to use EazelPackageSystem. I
still need to hook up the continue signal from the verifywindow,
this is opened as bug 5123.
* components/services/install/command-line/Makefile.am:
* components/services/install/command-line/eazel-alt-install-corba.
c:
include eazel-package-system-types instead of
eazel-install-types.h
* components/services/install/command-line/eazel-test-packsys.c:
(progress_signal), (failed_signal), (test_verify), (main):
Implemented the test for verfiy.
* components/services/install/lib/Makefile.am:
Mangled to fix 5121.
* components/services/install/lib/eazel-softcat.h:
* components/services/install/lib/eazel-install-tests.h:
* components/services/install/lib/eazel-install-xml-package-list.h:
* components/services/install/lib/eazel-install-protocols.h:
* components/services/install/lib/eazel-install-public.h:
* components/services/install/lib/eazel-install-query.h:
* components/services/install/lib/eazel-install-logic.h:
* components/services/install/lib/eazel-install-metadata.h:
* components/services/install/lib/eazel-install-object.c:
* components/services/install/lib/eazel-install-problem.h:
* components/services/install/lib/eazel-install-corba-callback.h:
* components/services/install/lib/eazel-install-corba-types.h:
include eazel-package-system-types instead of
eazel-install-types.h
* components/services/install/lib/eazel-install-logic.c:
(eazel_install_download_packages),
(eazel_install_check_for_file_conflicts),
(eazel_install_start_signal), (eazel_install_end_signal),
(eazel_install_progress_signal),
(eazel_install_check_existing_packages),
(eazel_uninstall_upward_traverse),
(eazel_uninstall_downward_traverse),
(eazel_uninstall_check_for_install):
Fixed signals and use FILL_NO_DIRS_IN_PROVIDES
* components/services/install/lib/eazel-install-protocols.c:
(gnome_vfs_fetch_remote_file), (eazel_install_fetch_package):
Use FILL_NO_DIRS_IN_PROVIDES
* components/services/install/lib/eazel-install-rpm-glue.h:
* components/services/install/lib/eazel-install-rpm-glue.c:
(eazel_install_do_rpm_dependency_check):
include eazel-package-system-types instead of
eazel-install-types.h
Also open/close the db when doing the rpmdepCheck call.
* components/services/install/lib/eazel-install-types.c:
* components/services/install/lib/eazel-install-types.h:
Removed
* components/services/install/lib/eazel-package-system.h:
* components/services/install/lib/eazel-package-system-private.h:
* components/services/install/lib/eazel-package-system.c:
(eazel_package_system_load_implementation),
(eazel_package_system_verify),
(eazel_package_system_emit_progress):
* components/services/install/lib/eazel-package-system-rpm3-private
.h:
* components/services/install/lib/eazel-package-system-rpm3.c:
(monitor_rpm_process_pipe), (eazel_package_system_rpm3_create_dbs),
(eazel_package_system_rpm3_open_dbs),
(eazel_package_system_rpm3_close_dbs),
(eazel_package_system_rpm3_free_dbs),
(rpm_packagedata_fill_from_rpm_header),
(rpm_packagedata_fill_from_file), (rpm_packagedata_new_from_file),
(eazel_package_system_rpm3_load_package),
(eazel_package_system_rpm3_query_impl),
(eazel_package_system_rpm3_query_substr),
(eazel_package_system_rpm3_query), (check_if_all_packages_seen),
(eazel_package_system_rpm3_install_uninstall),
(eazel_package_system_rpm3_verify_impl),
(get_num_of_files_in_packages), (eazel_package_system_rpm3_verify),
(eazel_package_system_rpm3_finalize),
(eazel_package_system_rpm3_new),
(eazel_package_system_implementation):
* components/services/install/lib/eazel-package-system-rpm4.c:
(eazel_package_system_rpm4_query),
(eazel_package_system_rpm4_finalize),
(eazel_package_system_rpm4_class_initialize),
(eazel_package_system_rpm4_initialize),
(eazel_package_system_rpm4_get_type),
(eazel_package_system_rpm4_new),
(eazel_package_system_implementation):
* components/services/install/lib/eazel-package-system-rpm4.h:
* components/services/install/lib/eazel-package-system-skeleton.c:
(eazel_package_system_skeleton_verify):
Shuffled the order of the info longs and the package in the
progress signal.
Implemented verify in rpm3 (fixes bug 5120)
First pieces of code for the rpm4 module.
Unfortunately, since rpmview now also has a eazelpackagesystem
object, I ran into the problem of database locking. The rpmview
would have a read-only version of all the db files, thereby
failing in install because trilobite-eazel-install-service spawned
a rpm that could not get exclusive lock. To fix this, I now have
the db closed at all times, but open/close it everytime I do
something. Unfortunately for the queryloops in
eazel-install-logic, this means opening/closing on every
query. Optionally, I should consider exposing
eazel_package_system_open/close_dbs, so the caller can do it. But
that makes the api a bit more cumbersome.
* components/services/install/lib/eazel-package-system-types.h:
* components/services/install/lib/eazel-package-system-types.c:
(eazel_install_protocol_as_string), (categorydata_new),
(categorydata_list_copy), (categorydata_copy),
(categorydata_destroy_foreach), (categorydata_destroy),
(categorydata_list_destroy), (packagedata_new),
(packagedata_list_copy), (packagedata_copy),
(packagedata_fill_in_missing), (packagedata_destroy),
(packagedata_remove_soft_dep), (rpmfilename_from_packagedata),
(rpmname_from_packagedata), (packagedata_get_readable_name),
(packagedata_get_name), (packagedata_hash_equal),
(packagedata_status_enum_to_str), (packagedata_status_str_to_enum),
(packagedata_modstatus_enum_to_str),
(packagedata_modstatus_str_to_enum), (packagedata_add_pack_to),
(packagedata_add_pack_to_breaks),
(packagedata_add_pack_to_soft_depends),
(packagedata_add_pack_to_hard_depends),
(packagedata_add_pack_to_modifies), (packagedata_list_prune),
(packagerequirement_new),
(eazel_install_package_provides_basename_compare),
(eazel_install_package_provides_compare),
(eazel_install_package_name_compare),
(eazel_install_package_compare),
(eazel_install_requirement_dep_compare),
(eazel_install_requirement_dep_name_compare),
(eazel_install_package_version_compare),
(eazel_install_package_other_version_compare),
(eazel_install_package_matches_versioning),
(eazel_install_gtk_marshal_NONE__POINTER_INT_INT_INT_INT_INT_INT),
(gstr_indent), (dump_package_list), (packagedata_dump_int),
(packagedata_dump):
Renamed eazel-install-types to eazel-package-system-types
* components/services/install/nautilus-view/Makefile.am:
Fixed linking after fix to 5121.
* components/services/install/nautilus-view/nautilus-service-instal
l-view.h:
include eazel-package-system-types instead of
eazel-install-types.h
* components/services/install/server/Makefile.am:
Fixed linking after fix to 5121.
* components/services/trilobite/libtrilobite/trilobite-root-helper.
c: (eazel_helper_start):
Don't mention the info msg's from userhelper.
* po/POTFILES.in:
Renamed eazel-install-types to eazel-package-system-types.
2000-12-10 J Shane Culpepper <pepper@eazel.com>
* components/services/summary/nautilus-view/Makefile.am:
......
......@@ -24,7 +24,6 @@ bin_PROGRAMS = nautilus-rpm-view
if EAZEL_SERVICES
extra_libs = \
$(top_builddir)/components/services/install/lib/libeazelinstall.la \
$(top_builddir)/components/services/install/lib/libeazelsoftcat.la \
$(top_builddir)/components/services/install/lib/libeazelpackagesystem.la \
$(top_builddir)/components/services/install/lib/libeazelpackagesystem-rpm3.la \
$(top_builddir)/components/services/trilobite/libtrilobite/libtrilobite.la
......
......@@ -53,6 +53,9 @@ struct NautilusRPMVerifyWindowDetails {
gboolean error_mode;
GtkWidget *continue_button;
GtkWidget *cancel_button;
unsigned long amount, total;
char *current_file;
};
enum {
......@@ -123,7 +126,7 @@ nautilus_rpm_verify_window_initialize (NautilusRPMVerifyWindow *rpm_verify_windo
GtkWidget *label, *button_box;
rpm_verify_window->details = g_new0 (NautilusRPMVerifyWindowDetails, 1);
rpm_verify_window->details->current_file = NULL;
/* allocate a vbox to hold the contents */
window_contents = gtk_vbox_new (FALSE, 0);
......@@ -133,7 +136,7 @@ nautilus_rpm_verify_window_initialize (NautilusRPMVerifyWindow *rpm_verify_windo
/* allocate the package title label */
label = nautilus_label_new ("");
gtk_widget_show (label);
nautilus_label_set_font_size (NAUTILUS_LABEL (label), 20);
nautilus_label_set_font_size (NAUTILUS_LABEL (label), 14);
nautilus_label_set_text_justification (NAUTILUS_LABEL(label), GTK_JUSTIFY_CENTER);
gtk_box_pack_start (GTK_BOX (window_contents), label, FALSE, FALSE, 8);
rpm_verify_window->details->package_name = label;
......@@ -141,7 +144,7 @@ nautilus_rpm_verify_window_initialize (NautilusRPMVerifyWindow *rpm_verify_windo
/* allocate the message label */
label = nautilus_label_new ("");
gtk_widget_show (label);
nautilus_label_set_font_size (NAUTILUS_LABEL (label), 14);
nautilus_label_set_font_size (NAUTILUS_LABEL (label), 12);
nautilus_label_set_text_justification (NAUTILUS_LABEL(label), GTK_JUSTIFY_CENTER);
gtk_box_pack_start (GTK_BOX (window_contents), label, FALSE, FALSE, 8);
rpm_verify_window->details->file_message = label;
......@@ -160,7 +163,7 @@ nautilus_rpm_verify_window_initialize (NautilusRPMVerifyWindow *rpm_verify_windo
gtk_signal_connect(GTK_OBJECT (rpm_verify_window->details->cancel_button), "clicked", GTK_SIGNAL_FUNC (cancel_button_callback), rpm_verify_window);
/* configure the dialog */
gtk_widget_set_usize (GTK_WIDGET (rpm_verify_window), 320, 180);
gtk_widget_set_usize (GTK_WIDGET (rpm_verify_window), 420, 180);
gnome_dialog_append_button ( GNOME_DIALOG(rpm_verify_window),
GNOME_STOCK_BUTTON_OK);
......@@ -193,6 +196,39 @@ void
nautilus_rpm_verify_window_set_message (NautilusRPMVerifyWindow *window, const char *message)
{
nautilus_label_set_text (NAUTILUS_LABEL (window->details->file_message), message);
while (gtk_events_pending ()) {
gtk_main_iteration ();
}
}
static void
nautilus_rpm_verify_window_update_message (NautilusRPMVerifyWindow *window)
{
char *message = NULL;
if (window->details->error_mode) {
message = g_strdup_printf (_("Failed on \"%s\""), window->details->current_file);
} else {
/* TRANSLATORS: this is printed while verifying files from packages,
%s is the filename, %d/%d is filenumber of total-number-of-files */
message = g_strdup_printf (_("Checking \"%s\" (%d/%d)"),
window->details->current_file,
window->details->amount,
window->details->total);
}
nautilus_rpm_verify_window_set_message (window, message);
g_free (message);
}
void
nautilus_rpm_verify_window_set_progress (NautilusRPMVerifyWindow *window,
const char *file,
unsigned long amount,
unsigned long total)
{
g_free (window->details->current_file);
window->details->current_file = g_strdup (file);
window->details->amount = amount;
window->details->total = total;
}
void
......@@ -207,6 +243,7 @@ nautilus_rpm_verify_window_set_error_mode (NautilusRPMVerifyWindow *window, gboo
gtk_widget_hide (window->details->continue_button);
gtk_widget_hide (window->details->cancel_button);
}
nautilus_rpm_verify_window_update_message (window);
}
}
......@@ -60,6 +60,10 @@ struct NautilusRPMVerifyWindowClass {
GtkType nautilus_rpm_verify_window_get_type (void);
GtkWidget* nautilus_rpm_verify_window_new (const char *package_name);
void nautilus_rpm_verify_window_set_message (NautilusRPMVerifyWindow *window, const char *message);
void nautilus_rpm_verify_window_set_progress (NautilusRPMVerifyWindow *window,
const char *file,
unsigned long amount,
unsigned long total);
void nautilus_rpm_verify_window_set_error_mode (NautilusRPMVerifyWindow *window, gboolean error_mode);
#ifdef __cplusplus
......
......@@ -21,11 +21,11 @@
*/
#include "nautilus-rpm-view-install.h"
#include <libtrilobite/libtrilobite.h>
#include <libeazelinstall.h>
#include "libtrilobite/libtrilobite.h"
#include "libeazelinstall.h"
#include <libnautilus-extensions/nautilus-stock-dialogs.h>
#include <libnautilus-extensions/nautilus-password-dialog.h>
#include <libtrilobite/libtrilobite.h>
#include "libtrilobite/libtrilobite.h"
#include "nautilus-rpm-view-private.h"
/* don't try to access a remote server for install */
......@@ -395,7 +395,6 @@ nautilus_rpm_view_install_package_callback (GtkWidget *widget,
NautilusRPMView *rpm_view)
{
GList *categories;
PackageData *pack;
CategoryData *category;
CORBA_Environment ev;
EazelInstallCallback *cb;
......@@ -414,14 +413,13 @@ nautilus_rpm_view_install_package_callback (GtkWidget *widget,
gtk_widget_set_sensitive (GTK_WIDGET (rpm_view->details->package_uninstall_button), FALSE);
nautilus_view_report_load_underway (nautilus_rpm_view_get_view (rpm_view));
pack = (PackageData *) gtk_object_get_data (GTK_OBJECT (rpm_view), "packagedata");
g_assert (pack);
g_assert (rpm_view->details->package);
category = categorydata_new ();
category->packages = g_list_prepend (NULL, pack);
category->packages = g_list_prepend (NULL, rpm_view->details->package);
categories = g_list_prepend (NULL, category);
cb = eazel_install_callback_new ();
rpm_view->details->installer = cb;
rpm_view->details->root_client = set_root_client (eazel_install_callback_bonobo (cb), rpm_view);
......@@ -440,8 +438,7 @@ nautilus_rpm_view_install_package_callback (GtkWidget *widget,
eazel_install_callback_install_packages (cb, categories, NULL, &ev);
g_list_foreach (categories, (GFunc)categorydata_destroy_foreach, NULL);
gtk_object_set_data (GTK_OBJECT (rpm_view), "packagedata", NULL);
/* Leak the categories here */
CORBA_exception_free (&ev);
}
......@@ -452,7 +449,6 @@ nautilus_rpm_view_uninstall_package_callback (GtkWidget *widget,
{
CategoryData *category;
GList *categories;
PackageData *pack;
CORBA_Environment ev;
EazelInstallCallback *cb;
......@@ -470,13 +466,13 @@ nautilus_rpm_view_uninstall_package_callback (GtkWidget *widget,
gtk_widget_set_sensitive (GTK_WIDGET (rpm_view->details->package_uninstall_button), FALSE);
nautilus_view_report_load_underway (nautilus_rpm_view_get_view (rpm_view));
pack = (PackageData *) gtk_object_get_data (GTK_OBJECT (rpm_view), "packagedata");
g_assert (pack);
g_assert (rpm_view->details->package);
category = categorydata_new ();
category->packages = g_list_prepend (NULL, pack);
category->packages = g_list_prepend (NULL, rpm_view->details->package);
categories = g_list_prepend (NULL, category);
cb = eazel_install_callback_new ();
rpm_view->details->installer = cb;
rpm_view->details->root_client = set_root_client (eazel_install_callback_bonobo (cb), rpm_view);
......@@ -491,9 +487,7 @@ nautilus_rpm_view_uninstall_package_callback (GtkWidget *widget,
gtk_signal_connect (GTK_OBJECT (cb), "preflight_check", GTK_SIGNAL_FUNC (preflight_check), NULL);
eazel_install_callback_uninstall_packages (cb, categories, NULL, &ev);
g_list_foreach (categories, (GFunc)categorydata_destroy_foreach, NULL);
gtk_object_set_data (GTK_OBJECT (rpm_view), "packagedata", NULL);
/* Leak the categories here */
CORBA_exception_free (&ev);
}
......@@ -29,6 +29,13 @@
# include <config.h>
#endif
#ifdef EAZEL_SERVICES
#include "libeazelinstall.h"
#include "libtrilobite/libtrilobite.h"
#include "eazel-package-system.h"
#include "nautilus-rpm-view-install.h"
#endif /* EAZEL_SERVICES */
struct NautilusRPMViewDetails {
char *current_uri;
char *package_name;
......@@ -69,8 +76,10 @@ struct NautilusRPMViewDetails {
#ifdef EAZEL_SERVICES
/* for installing an rpm */
EazelInstallCallback *installer;
EazelPackageSystem *package_system;
TrilobiteRootClient *root_client;
PackageData *package;
/* for password queries */
char *remembered_password;
int password_attempts;
......
This diff is collapsed.
......@@ -43,7 +43,6 @@ nautilus_service_install_view_LDADD = \
$(top_builddir)/components/services/install/lib/libeazelinstall.la \
$(top_builddir)/components/services/install/lib/libeazelpackagesystem.la \
$(top_builddir)/components/services/install/lib/libeazelpackagesystem-rpm3.la \
$(top_builddir)/components/services/install/lib/libeazelsoftcat.la \
$(top_builddir)/components/services/trilobite/libtrilobite/libtrilobite.la \
$(top_builddir)/components/services/nautilus-dependent-shared/libnautilusdepshared.a \
$(BONOBO_LIBS) \
......
......@@ -25,7 +25,7 @@
#include <libnautilus/nautilus-view.h>
#include <gtk/gtk.h>
#include <eazel-install-types.h>
#include <eazel-package-system-types.h>
#include <eazel-install-corba-types.h>
#include <eazel-install-corba-callback.h>
#include <eazel-install-problem.h>
......
......@@ -5,4 +5,5 @@ Makefile.in
eazel-gen-xml
eazel-install
eazel-test-packsys
eazel-softcat
package-list.xml*
......@@ -20,10 +20,6 @@ INCLUDES = \
$(NULL)
LDADD = \
$(top_builddir)/components/services/install/lib/libeazelinstall.la \
$(top_builddir)/components/services/install/lib/libeazelpackagesystem.la \
$(top_builddir)/components/services/install/lib/libeazelpackagesystem-rpm3.la \
$(top_builddir)/components/services/install/lib/libeazelsoftcat.la \
$(top_builddir)/components/services/trilobite/libtrilobite/libtrilobite.la \
$(BONOBO_LIBS) \
$(GNOME_LIBS) \
......@@ -39,24 +35,47 @@ eazel_install_SOURCES = \
eazel-alt-install-corba.c \
$(NULL)
eazel_install_LDADD = \
$(LDADD) \
$(top_builddir)/components/services/install/lib/libeazelinstall.la \
$(top_builddir)/components/services/install/lib/libeazelpackagesystem.la \
$(top_builddir)/components/services/install/lib/libeazelpackagesystem-rpm3.la \
$(NULL)
eazel_gen_xml_SOURCES = \
eazel-gen-xml.c \
$(NULL)
eazel_gen_xml_LDADD = \
$(LDADD) \
$(top_builddir)/components/services/install/lib/libeazelinstall.la \
$(top_builddir)/components/services/install/lib/libeazelpackagesystem.la \
$(top_builddir)/components/services/install/lib/libeazelpackagesystem-rpm3.la \
$(NULL)
eazel_test_packsys_SOURCES = \
eazel-test-packsys.c \
$(NULL)
eazel_test_packsys_LDADD = \
$(top_builddir)/components/services/install/lib/libeazelpackagesystem.la \
$(top_builddir)/components/services/install/lib/libeazelpackagesystem-rpm3.la \
$(LDADD) \
$(top_builddir)/components/services/install/lib/libeazelpackagesystem.la \
$(NULL)
eazel_test_types_SOURCES = \
eazel-test-types.c \
$(NULL)
eazel_test_types_LDADD = \
$(LDADD) \
$(top_builddir)/components/services/install/lib/libeazelpackagesystem.la \
$(NULL)
eazel_softcat_SOURCES = \
eazel-test-softcat.c \
$(NULL)
eazel_softcat_LDADD = \
$(LDADD) \
$(top_builddir)/components/services/install/lib/libeazelpackagesystem.la \
$(NULL)
......@@ -27,7 +27,7 @@
#include <bonobo.h>
#include <sys/utsname.h>
#include <eazel-install-types.h>
#include <eazel-package-system-types.h>
#include <eazel-install-corba-types.h>
#include <eazel-install-corba-callback.h>
#include <eazel-install-problem.h>
......
......@@ -189,9 +189,26 @@ progress_signal (EazelPackageSystem *system,
const PackageData *pack,
gboolean *signals)
{
if (op==EAZEL_PACKAGE_SYSTEM_OPERATION_VERIFY) {
g_message ("checking file \"%s\" (%ld/%ld %ld/%ld %ld/%ld)",
(char*)((g_list_nth (pack->provides, info[0]-1))->data),
info [0], info [1],
info [2], info [3],
info [4], info [5]);
}
signals[1] = TRUE;
return TRUE;
}
static gboolean
failed_signal (EazelPackageSystem *system,
EazelPackageSystemOperation op,
const PackageData *package,
gpointer unused)
{
return TRUE;
}
static gboolean
is_installed (EazelPackageSystem *packsys,
......@@ -321,10 +338,37 @@ test_verify (EazelPackageSystem *packsys,
const char *package_file_name)
{
GList *packages = get_package_list (packsys, package_file_name);
gboolean *signals;
guint h1, h2, h3, h4;
signals = g_new0 (gboolean, 4);
h1 = gtk_signal_connect (GTK_OBJECT (packsys),
"start",
(GtkSignalFunc)start_signal,
signals);
h2 = gtk_signal_connect (GTK_OBJECT (packsys),
"end",
(GtkSignalFunc)end_signal,
signals);
h3 = gtk_signal_connect (GTK_OBJECT (packsys),
"progress",
(GtkSignalFunc)progress_signal,
signals);
h4 = gtk_signal_connect (GTK_OBJECT (packsys),
"failed",
(GtkSignalFunc)failed_signal,
signals);
eazel_package_system_verify (packsys,
dbpath,
packages,
0);
packages);
gtk_signal_disconnect (GTK_OBJECT (packsys), h1);
gtk_signal_disconnect (GTK_OBJECT (packsys), h2);
gtk_signal_disconnect (GTK_OBJECT (packsys), h3);
gtk_signal_disconnect (GTK_OBJECT (packsys), h4);
g_free (signals);
}
int main(int argc, char *argv[]) {
......@@ -338,7 +382,7 @@ int main(int argc, char *argv[]) {
gnome_init ("Eazel Test Packsys", "1.0", argc, argv);
home_dbpath = g_strdup_printf ("%s/.nautilus/packagedb", g_get_home_dir ());
packsys = init_package_system (home_dbpath, g_strdup (g_get_home_dir ()));
eazel_package_system_set_debug (packsys, EAZEL_PACKAGE_SYSTEM_DEBUG_VERBOSE);
eazel_package_system_set_debug (packsys, EAZEL_PACKAGE_SYSTEM_DEBUG_FAIL);
test_package_load (packsys, argv[1]);
test_matches_query (packsys);
......
......@@ -21,9 +21,9 @@ INCLUDES = \
lib_LTLIBRARIES = \
libeazelinstall.la \
libeazelsoftcat.la \
libeazelpackagesystem.la \
libeazelpackagesystem-rpm3.la \
libeazelpackagesystem-rpm4.la \
libeazelpackagesystem-skeleton.la \
$(NULL)
......@@ -36,7 +36,6 @@ libeazelinstallinclude_HEADERS = \
eazel-install-public.h \
trilobite-eazel-install.h \
libeazelinstall.h \
eazel-install-types.h \
eazel-install-corba-types.h \
eazel-install-logic.h \
eazel-install-md5.h \
......@@ -46,7 +45,6 @@ libeazelinstallinclude_HEADERS = \
eazel-install-rpm-signature.h \
eazel-install-query.h \
eazel-install-tests.h \
eazel-install-xml-package-list.h \
eazel-install-private.h \
eazel-install-corba-callback.h \
eazel-install-problem.h \
......@@ -57,7 +55,6 @@ libeazelinstall_la_SOURCES = \
eazel-install-corba.c \
eazel-install-corba-types.c \
eazel-install-corba-callback.c \
eazel-install-types.c \
eazel-install-md5.c \
eazel-install-metadata.c \
eazel-install-protocols.c \
......@@ -65,7 +62,6 @@ libeazelinstall_la_SOURCES = \
eazel-install-rpm-glue.c \
eazel-install-rpm-signature.c \
eazel-install-tests.c \