diff options
author | Eskil Heyn Olsen <eskil@src.gnome.org> | 2001-01-23 04:14:55 +0000 |
---|---|---|
committer | Eskil Heyn Olsen <eskil@src.gnome.org> | 2001-01-23 04:14:55 +0000 |
commit | 9f54d5eb9cc72ec7669b19d64ce067018a36056f (patch) | |
tree | 4a0b173002c02b2e8bd9726d8d113f37b4769213 | |
parent | c06f72b936b60391511a1e740995a1a9497351b2 (diff) | |
download | nautilus-9f54d5eb9cc72ec7669b19d64ce067018a36056f.tar.gz |
Removed the --port argument (since --server is now in server:port form).
* components/services/install/command-line/eazel-alt-install-corba.
c: (set_parameters_from_command_line), (something_failed):
Removed the --port argument (since --server is now in server:port
form).
Removed --tmp as you shouldn't set it anymore.
Rename --noauth to --no-auth and --ssl_rename to --ssl-rename.
Default behaviour is now that no server or no-auth argument causes
eazel-install to use trilobite server setting and proxy. --no-auth
just uses trilobite server and no proxy, --server sets the server
and no proxy.
Changed output in something_failed.
* components/services/install/lib/eazel-install-logic.c:
(eazel_install_start_signal), (eazel_install_failed_signal):
Don't emit progress in uninstall (since the EazelInstall object
didn't have them, I was currently emitting install progress
signals)
Only emit failed signals on the toplevel.
* components/services/install/lib/eazel-install-logic2.c:
(eazel_install_check_existing_packages), (get_softcat_info),
(is_satisfied):
More ifdeffed debug.
Uncommented a commented out gtk_object_unref.
Commented out a unref and emit_failed, since the pruner is doing
this.
In is_satisifed, if no version in dep, check if package is
installed before checking features list. Faster and safer.
* components/services/install/lib/eazel-package-system-rpm3.c:
(make_rpm_argument_list),
(monitor_rpm_process_pipe_percent_output),
(monitor_rpm_process_pipe), (eazel_package_system_rpm3_execute):
Some ifdeffed code for --percent handling.
Set go==FALSE in execute if root helper fails (fixes a bug where
the installer would hang if wrong password was entered).
* components/services/install/nautilus-view/nautilus-service-instal
l-view.c: (nautilus_service_install_view_update_from_uri):
Default to port 80 if trilobite_get_services_address did not
include a port.
7 files changed, 151 insertions, 47 deletions
@@ -1,3 +1,47 @@ +2001-01-22 Eskil Heyn Olsen <eskil@eazel.com> + + * components/services/install/command-line/eazel-alt-install-corba. + c: (set_parameters_from_command_line), (something_failed): + Removed the --port argument (since --server is now in server:port + form). + Removed --tmp as you shouldn't set it anymore. + Rename --noauth to --no-auth and --ssl_rename to --ssl-rename. + Default behaviour is now that no server or no-auth argument causes + eazel-install to use trilobite server setting and proxy. --no-auth + just uses trilobite server and no proxy, --server sets the server + and no proxy. + Changed output in something_failed. + + * components/services/install/lib/eazel-install-logic.c: + (eazel_install_start_signal), (eazel_install_failed_signal): + Don't emit progress in uninstall (since the EazelInstall object + didn't have them, I was currently emitting install progress + signals) + Only emit failed signals on the toplevel. + + * components/services/install/lib/eazel-install-logic2.c: + (eazel_install_check_existing_packages), (get_softcat_info), + (is_satisfied): + More ifdeffed debug. + Uncommented a commented out gtk_object_unref. + Commented out a unref and emit_failed, since the pruner is doing + this. + In is_satisifed, if no version in dep, check if package is + installed before checking features list. Faster and safer. + + * components/services/install/lib/eazel-package-system-rpm3.c: + (make_rpm_argument_list), + (monitor_rpm_process_pipe_percent_output), + (monitor_rpm_process_pipe), (eazel_package_system_rpm3_execute): + Some ifdeffed code for --percent handling. + Set go==FALSE in execute if root helper fails (fixes a bug where + the installer would hang if wrong password was entered). + + * components/services/install/nautilus-view/nautilus-service-instal + l-view.c: (nautilus_service_install_view_update_from_uri): + Default to port 80 if trilobite_get_services_address did not + include a port. + 2001-01-22 Ramiro Estrugo <ramiro@eazel.com> reviewed by: Pavel Cisler <pavel@eazel.com> diff --git a/components/services/install-view/nautilus-service-install-view.c b/components/services/install-view/nautilus-service-install-view.c index a5611d237..ac0484654 100644 --- a/components/services/install-view/nautilus-service-install-view.c +++ b/components/services/install-view/nautilus-service-install-view.c @@ -1504,7 +1504,7 @@ nautilus_service_install_view_update_from_uri (NautilusServiceInstallView *view, *p = 0; port = atoi (p+1); } else { - port = 443; + port = 80; } username = NULL; set_auth = !(nautilus_install_parse_uri (uri, view, &host, &port, &username)); 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 523180a2f..c7b001cdc 100644 --- a/components/services/install/command-line/eazel-alt-install-corba.c +++ b/components/services/install/command-line/eazel-alt-install-corba.c @@ -57,7 +57,6 @@ int arg_dry_run, arg_ftp, arg_local, arg_debug, - arg_port, arg_delay, arg_file, arg_force, @@ -77,7 +76,6 @@ char *arg_server, *arg_cgi, *arg_config_file, *arg_package_list, - *arg_tmp_dir, *arg_username, *arg_root, *arg_batch; @@ -106,17 +104,15 @@ static const struct poptOption options[] = { {"http", 'h', POPT_ARG_NONE, &arg_http, 0, N_("Use http"), NULL}, {"id", 'i', POPT_ARG_NONE, &arg_id, 0, N_("RPM args are Eazel Ids"), NULL}, {"no-percent", '\0', POPT_ARG_NONE, &arg_no_pct, 0, N_("Don't print fancy percent output"), NULL}, - {"noauth", '\0', POPT_ARG_NONE, &arg_no_auth, 0, N_("don't use eazel auth stuff"), NULL}, + {"no-auth", '\0', POPT_ARG_NONE, &arg_no_auth, 0, N_("don't use eazel auth stuff"), NULL}, {"packagefile", '\0', POPT_ARG_STRING, &arg_package_list, 0, N_("Specify package file"), NULL}, - {"port", '\0', POPT_ARG_INT, &arg_port, 0 , N_("Set port numer (80)"), NULL}, {"provides", '\0', POPT_ARG_NONE, &arg_provides, 0, N_("RPM args are needed files"), NULL}, {"query", 'q', POPT_ARG_NONE, &arg_query, 0, N_("Run Query"), NULL}, {"revert", 'r', POPT_ARG_NONE, &arg_revert, 0, N_("Revert"), NULL}, {"root", '\0', POPT_ARG_STRING, &arg_root, 0, N_("Set root"), NULL}, {"server", '\0', POPT_ARG_STRING, &arg_server, 0, N_("Specify server"), NULL}, - {"ssl_rename", 's', POPT_ARG_NONE, &arg_ssl_rename, 0, N_("Perform ssl renaming"), NULL}, + {"ssl-rename", 's', POPT_ARG_NONE, &arg_ssl_rename, 0, N_("Perform ssl renaming"), NULL}, {"test", 't', POPT_ARG_NONE, &arg_dry_run, 0, N_("Test run"), NULL}, - {"tmp", '\0', POPT_ARG_STRING, &arg_tmp_dir, 0, N_("Set tmp dir (/tmp)"), NULL}, {"username", '\0', POPT_ARG_STRING, &arg_username, 0, N_("Allow username"), NULL}, {"upgrade", 'u', POPT_ARG_NONE, &arg_upgrade, 0, N_("Allow upgrades"), NULL}, {"verbose", 'v', POPT_ARG_NONE, &arg_verbose, 0, N_("Verbose output"), NULL}, @@ -184,12 +180,34 @@ set_parameters_from_command_line (GNOME_Trilobite_Eazel_Install service) colon++; port = atoi (colon); GNOME_Trilobite_Eazel_Install__set_server (service, host, &ev); + check_ev ("set_server"); GNOME_Trilobite_Eazel_Install__set_server_port (service, port, &ev); + check_ev ("set_port"); g_free (host); } else { GNOME_Trilobite_Eazel_Install__set_server (service, arg_server, &ev); + check_ev ("set_server"); } + GNOME_Trilobite_Eazel_Install__set_auth (service, FALSE, &ev); + check_ev ("set_auth"); + } else if (arg_no_auth==0) { + char *host, *p; + int port; + + host = g_strdup (trilobite_get_services_address ()); + if ((p = strchr (host, ':')) != NULL) { + *p = 0; + port = atoi (p+1); + } else { + port = 80; + } + GNOME_Trilobite_Eazel_Install__set_auth (service, TRUE, &ev); + check_ev ("set_auth"); + GNOME_Trilobite_Eazel_Install__set_server (service, host, &ev); check_ev ("set_server"); + GNOME_Trilobite_Eazel_Install__set_server_port (service, port, &ev); + check_ev ("set_port"); + g_free (host); } if (arg_username) { GNOME_Trilobite_Eazel_Install__set_username (service, arg_username, &ev); @@ -211,33 +229,7 @@ set_parameters_from_command_line (GNOME_Trilobite_Eazel_Install service) if (arg_no_auth) { GNOME_Trilobite_Eazel_Install__set_auth (service, FALSE, &ev); check_ev ("set_auth"); - } else { - GNOME_Trilobite_Eazel_Install__set_auth (service, TRUE, &ev); - check_ev ("set_auth"); - } - -#define RANDCHAR ('A' + (rand () % 23)) - if (arg_tmp_dir == NULL) { - int tries; - srand (time (NULL)); - for (tries = 0; tries < 50; tries++) { - arg_tmp_dir = g_strdup_printf ("/tmp/eazel-installer.%c%c%c%c%c%c%d", - RANDCHAR, RANDCHAR, RANDCHAR, RANDCHAR, - RANDCHAR, RANDCHAR, (rand () % 1000)); - if (g_file_test (arg_tmp_dir, G_FILE_TEST_ISDIR)==0) { - break; - } - g_free (arg_tmp_dir); - } - } -/* - GNOME_Trilobite_Eazel_Install__set_tmp_dir (service, arg_tmp_dir, &ev); - check_ev ("set_tmp_dir"); -*/ - if (arg_port) { - GNOME_Trilobite_Eazel_Install__set_server_port (service, arg_port, &ev); - check_ev ("set_server_port"); - } + } if (arg_dry_run) { GNOME_Trilobite_Eazel_Install__set_test_mode (service, TRUE, &ev); } @@ -465,19 +457,19 @@ something_failed (EazelInstallCallback *service, char *title; GList *stuff = NULL; - fprintf (stderr, "\nin something failed\n"); - gtk_object_ref (GTK_OBJECT (pd)); if (uninstall) { - title = g_strdup_printf ("\nPackage %s failed to uninstall. Here's the tree...\n", pd->name); + title = g_strdup_printf ("\nPackage %s failed to uninstall.\n", pd->name); } else { - title = g_strdup_printf ("\nPackage %s failed to install. Here's the tree...\n", pd->name); + title = g_strdup_printf ("\nPackage %s failed to install.\n", pd->name); } if (arg_debug) { tree_helper (service, pd, "", "", 4, title); fprintf (stdout, "\n"); + } else { + fprintf (stdout, "%s", title); } g_free (title); diff --git a/components/services/install/lib/eazel-install-logic.c b/components/services/install/lib/eazel-install-logic.c index c300b4423..e683cc28c 100644 --- a/components/services/install/lib/eazel-install-logic.c +++ b/components/services/install/lib/eazel-install-logic.c @@ -803,6 +803,7 @@ gboolean eazel_install_start_signal (EazelPackageSystem *system, service->private->infoblock[2]++; switch (op) { case EAZEL_PACKAGE_SYSTEM_OPERATION_INSTALL: + break; case EAZEL_PACKAGE_SYSTEM_OPERATION_UNINSTALL: eazel_install_emit_install_progress (service, pack, @@ -866,10 +867,13 @@ gboolean eazel_install_failed_signal (EazelPackageSystem *system, EazelInstall *service) { trilobite_debug ("*** %s failed", pack->name); - if (op==EAZEL_PACKAGE_SYSTEM_OPERATION_INSTALL) { - eazel_install_emit_install_failed (service, pack); - } else if (op==EAZEL_PACKAGE_SYSTEM_OPERATION_UNINSTALL) { - eazel_install_emit_uninstall_failed (service, pack); + if (pack->toplevel) { + trilobite_debug ("emiting failed for %s", pack->name); + if (op==EAZEL_PACKAGE_SYSTEM_OPERATION_INSTALL) { + eazel_install_emit_install_failed (service, pack); + } else if (op==EAZEL_PACKAGE_SYSTEM_OPERATION_UNINSTALL) { + eazel_install_emit_uninstall_failed (service, pack); + } } return TRUE; } diff --git a/components/services/install/lib/eazel-install-logic2.c b/components/services/install/lib/eazel-install-logic2.c index c220419c0..5391e6049 100644 --- a/components/services/install/lib/eazel-install-logic2.c +++ b/components/services/install/lib/eazel-install-logic2.c @@ -240,6 +240,9 @@ eazel_install_check_existing_packages (EazelInstall *service, GList *existing_packages; EazelInstallStatus result; +#if EI2_DEBUG & 0x4 + trilobite_debug ("check_existing %s", pack->name); +#endif result = EAZEL_INSTALL_STATUS_NEW_PACKAGE; /* query for existing package of same name */ existing_packages = eazel_package_system_query (service->private->package_system, @@ -289,7 +292,7 @@ eazel_install_check_existing_packages (EazelInstall *service, /* check against minor version */ if (res==0) { #if EI2_DEBUG & 0x4 - trilobite_debug ("versions are equal, comparing minors"); + trilobite_debug ("versions are equal (%s), comparing minors", pack->version); #endif if (pack->minor && existing_package->minor) { #if EI2_DEBUG & 0x4 @@ -391,7 +394,7 @@ eazel_install_check_existing_packages (EazelInstall *service, } else { pack->status = PACKAGE_ALREADY_INSTALLED; } - //gtk_object_unref (GTK_OBJECT (existing_package)); + gtk_object_unref (GTK_OBJECT (existing_package)); } /* Free the list structure from _simple_query */ @@ -477,6 +480,10 @@ get_softcat_info (EazelInstall *service, p1 = g_hash_table_lookup (service->private->dedupe_hash, (*package)->eazel_id); if (p1) { +#if EI2_DEBUG & 0x4 + trilobite_debug ("deduping %p %s", *package, (*package)->name); +#endif + gtk_object_ref (GTK_OBJECT (p1)); gtk_object_unref (GTK_OBJECT (*package)); (*package) = p1; @@ -495,8 +502,10 @@ get_softcat_info (EazelInstall *service, case EAZEL_INSTALL_STATUS_DOWNGRADES: case EAZEL_INSTALL_STATUS_QUO: (*package)->status = PACKAGE_ALREADY_INSTALLED; +/* eazel_install_emit_install_failed (service, *package); gtk_object_unref (GTK_OBJECT (*package)); +*/ result = PACKAGE_SKIPPED; break; } @@ -666,11 +675,22 @@ is_satisfied (EazelInstall *service, NULL, dep->sense)) { #if EI2_DEBUG & 0x4 - trilobite_debug ("\t--> installed"); + trilobite_debug ("\t--> installed with version"); #endif result = TRUE; } + } else if (eazel_package_system_is_installed (service->private->package_system, + service->private->cur_root, + dep->package->name, + NULL, + NULL, + EAZEL_SOFTCAT_SENSE_ANY)) { +#if EI2_DEBUG & 0x4 + trilobite_debug ("\t--> installed"); +#endif + result = TRUE; } else { + if (dep->package->features && is_satisfied_features (service, dep->package)) { #if EI2_DEBUG & 0x4 trilobite_debug ("\t--> features of package are satisfied"); diff --git a/components/services/install/lib/eazel-package-system-rpm3.c b/components/services/install/lib/eazel-package-system-rpm3.c index 86aa93977..beb5138ea 100644 --- a/components/services/install/lib/eazel-package-system-rpm3.c +++ b/components/services/install/lib/eazel-package-system-rpm3.c @@ -62,6 +62,8 @@ #define DEFAULT_DB_PATH "/var/lib/rpm" #define DEFAULT_ROOT "/" +#undef USE_PERCENT + EazelPackageSystem* eazel_package_system_implementation (GList*); /* This is the parent class pointer */ @@ -156,6 +158,10 @@ make_rpm_argument_list (EazelPackageSystemRpm3 *system, } } +#ifdef USE_PERCENT + (*args) = g_list_prepend (*args, g_strdup ("--percent")); +#endif + if (op == EAZEL_PACKAGE_SYSTEM_OPERATION_UNINSTALL) { (*args) = g_list_prepend (*args, g_strdup ("-e")); } else { @@ -222,6 +228,36 @@ get_total_size_of_packages (const GList *packages) return result; } +#ifdef USE_PERCENT +/* This monitors an rpm process pipe and emits + signals during execution */ +static gboolean +monitor_rpm_process_pipe_percent_output (GIOChannel *source, + GIOCondition condition, + struct RpmMonitorPiggyBag *pig) +{ + char tmp; + ssize_t bytes_read; + char line[80]; + int bytes_read_in_line = 0; + gboolean result = TRUE; + + g_io_channel_read (source, &tmp, 1, &bytes_read); + + if (bytes_read) { + if (tmp=='\n') { + trilobite_debug ("RPM: %s", line); + } else { + line[bytes_read_in_line] = tmp; + bytes_read_in_line++; + } + } + + return result; +} +#endif + +#ifndef USE_PERCENT /* This monitors an rpm process pipe and emits signals during execution */ static gboolean @@ -232,7 +268,7 @@ monitor_rpm_process_pipe (GIOChannel *source, char tmp; ssize_t bytes_read; gboolean result = TRUE; - + g_io_channel_read (source, &tmp, 1, &bytes_read); if (bytes_read) { @@ -361,6 +397,7 @@ monitor_rpm_process_pipe (GIOChannel *source, return result; } +#endif static void rpm_create_db (char *dbpath, @@ -1041,19 +1078,26 @@ eazel_package_system_rpm3_execute (EazelPackageSystemRpm3 *system, root_helper_stat = trilobite_root_helper_start (root_helper); if (root_helper_stat != TRILOBITE_ROOT_HELPER_SUCCESS) { g_warning ("Error in starting trilobite_root_helper"); + go = FALSE; } else if (trilobite_root_helper_run (root_helper, TRILOBITE_ROOT_HELPER_RUN_RPM, args, &fd) != TRILOBITE_ROOT_HELPER_SUCCESS) { g_warning ("Error in running trilobite_root_helper"); trilobite_root_helper_destroy (GTK_OBJECT (root_helper)); + go = FALSE; } } else { /* FIXME: ugh, start /bin/rpm manually, see code in eazel-install-logic.c rev 1.26 */ g_assert (root_helper); + go = FALSE; } if (go) { +#ifdef USE_PERCENT + monitor_subcommand_pipe (system, fd, (GIOFunc)monitor_rpm_process_pipe_percent_output, pig); +#else monitor_subcommand_pipe (system, fd, (GIOFunc)monitor_rpm_process_pipe, pig); +#endif } else { /* FIXME: fail all the packages in pig */ } 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 a5611d237..ac0484654 100644 --- a/components/services/install/nautilus-view/nautilus-service-install-view.c +++ b/components/services/install/nautilus-view/nautilus-service-install-view.c @@ -1504,7 +1504,7 @@ nautilus_service_install_view_update_from_uri (NautilusServiceInstallView *view, *p = 0; port = atoi (p+1); } else { - port = 443; + port = 80; } username = NULL; set_auth = !(nautilus_install_parse_uri (uri, view, &host, &port, &username)); |