diff options
author | Robey Pointer <robey@src.gnome.org> | 2001-02-13 03:01:58 +0000 |
---|---|---|
committer | Robey Pointer <robey@src.gnome.org> | 2001-02-13 03:01:58 +0000 |
commit | 82116959587e75e49396aefe4c7fa3b0e3cfe53d (patch) | |
tree | a83414cab603f999885da2610eaf253b740183b3 | |
parent | b28f5a6e9b63e0ae375dd7a5280b6139549beedc (diff) | |
download | nautilus-82116959587e75e49396aefe4c7fa3b0e3cfe53d.tar.gz |
Erase the package if it didn't finish downloading.
* components/services/install/lib/eazel-install-protocols.c:
(gnome_vfs_fetch_remote_file):
Erase the package if it didn't finish downloading.
* components/services/trilobite/libtrilobite/trilobite-core-messagi
ng.c:
Add <string.h> header for RH7.
* nautilus-installer/src/callbacks.c: (druid_cancel),
(druid_delete), (druid_finish):
* nautilus-installer/src/main.c: (main):
Clean up object unref'ing to quiet up the install lib's memory
checker. Don't hook up with the session manager.
* nautilus-installer/src/installer.c: (eazel_download_progress),
(eazel_install_preflight), (check_system),
(eazel_installer_finalize), (eazel_installer_set_default_texts),
(eazel_installer_initialize):
* nautilus-installer/src/installer.h:
* nautilus-installer/src/link.sh:
Change the no-RH7 message into RH6 and RH7 specific messages, so
we can build one installer for each platform. Don't ask to delete
files if none were downloaded.
-rw-r--r-- | ChangeLog | 30 | ||||
-rw-r--r-- | components/services/install/lib/eazel-install-protocols.c | 1 | ||||
-rw-r--r-- | components/services/trilobite/libtrilobite/trilobite-core-messaging.c | 1 | ||||
-rw-r--r-- | nautilus-installer/src/callbacks.c | 13 | ||||
-rw-r--r-- | nautilus-installer/src/installer.c | 47 | ||||
-rw-r--r-- | nautilus-installer/src/installer.h | 1 | ||||
-rwxr-xr-x | nautilus-installer/src/link.sh | 6 | ||||
-rw-r--r-- | nautilus-installer/src/main.c | 8 |
8 files changed, 88 insertions, 19 deletions
@@ -1,3 +1,33 @@ +2001-02-12 Robey Pointer <robey@eazel.com> + + * components/services/install/lib/eazel-install-protocols.c: + (gnome_vfs_fetch_remote_file): + + Erase the package if it didn't finish downloading. + + * components/services/trilobite/libtrilobite/trilobite-core-messagi + ng.c: + + Add <string.h> header for RH7. + + * nautilus-installer/src/callbacks.c: (druid_cancel), + (druid_delete), (druid_finish): + * nautilus-installer/src/main.c: (main): + + Clean up object unref'ing to quiet up the install lib's memory + checker. Don't hook up with the session manager. + + * nautilus-installer/src/installer.c: (eazel_download_progress), + (eazel_install_preflight), (check_system), + (eazel_installer_finalize), (eazel_installer_set_default_texts), + (eazel_installer_initialize): + * nautilus-installer/src/installer.h: + * nautilus-installer/src/link.sh: + + Change the no-RH7 message into RH6 and RH7 specific messages, so + we can build one installer for each platform. Don't ask to delete + files if none were downloaded. + 2001-02-12 Ramiro Estrugo <ramiro@eazel.com> reviewed by: Darin Adler <darin@eazel.com> diff --git a/components/services/install/lib/eazel-install-protocols.c b/components/services/install/lib/eazel-install-protocols.c index ea367cfe4..6bdc513e2 100644 --- a/components/services/install/lib/eazel-install-protocols.c +++ b/components/services/install/lib/eazel-install-protocols.c @@ -411,6 +411,7 @@ gnome_vfs_fetch_remote_file (EazelInstall *service, rename (target_file_premove, target_file); } else { trilobite_debug ("File download failed"); + unlink (target_file_premove); if (result == GNOME_VFS_ERROR_BAD_PARAMETERS) { trilobite_debug ("gnome_vfs_xfer_uri returned BAD_PARAMETERS"); } diff --git a/components/services/trilobite/libtrilobite/trilobite-core-messaging.c b/components/services/trilobite/libtrilobite/trilobite-core-messaging.c index d4d678a4c..8f67e8080 100644 --- a/components/services/trilobite/libtrilobite/trilobite-core-messaging.c +++ b/components/services/trilobite/libtrilobite/trilobite-core-messaging.c @@ -24,6 +24,7 @@ #include <unistd.h> #include <sys/time.h> #include <stdarg.h> +#include <string.h> #include "trilobite-core-utils.h" #include "trilobite-core-messaging.h" diff --git a/nautilus-installer/src/callbacks.c b/nautilus-installer/src/callbacks.c index 09be360a4..cbefdcdd8 100644 --- a/nautilus-installer/src/callbacks.c +++ b/nautilus-installer/src/callbacks.c @@ -85,6 +85,9 @@ void druid_cancel (GnomeDruid *gnomedruid, EazelInstaller *installer) { + if (installer != NULL) { + gtk_object_unref (GTK_OBJECT (installer)); + } g_mem_profile (); if (ask_are_you_sure (installer)) { exit (1); @@ -94,6 +97,9 @@ druid_cancel (GnomeDruid *gnomedruid, void druid_delete (GtkWidget *widget, GdkEvent *event, EazelInstaller *installer) { + if (installer != NULL) { + gtk_object_unref (GTK_OBJECT (installer)); + } g_mem_profile (); exit (1); } @@ -175,8 +181,13 @@ druid_finish (GnomeDruidPage *gnomedruidpage, EazelInstaller *installer) { g_message ("Farewell!"); - ask_to_delete_rpms (installer); + if (installer->downloaded_anything) { + ask_to_delete_rpms (installer); + } + if (installer != NULL) { + gtk_object_unref (GTK_OBJECT (installer)); + } g_mem_profile (); exit (0); } diff --git a/nautilus-installer/src/installer.c b/nautilus-installer/src/installer.c index f5731b461..dd1f20351 100644 --- a/nautilus-installer/src/installer.c +++ b/nautilus-installer/src/installer.c @@ -130,9 +130,12 @@ static const char untranslated_error_untested_RPM_based_system[] = "RPM-based Linux distribution. I'll try anyways, but\n"\ "it will most likely not work."); static const char untranslated_error_untested_RPM_based_system_title[]= N_("Unsupported distribution"); -static const char untranslated_error_Red_Hat_7_not_supported[] = - N_("Sorry, but this preview installer won't work for Red Hat\n" - "Linux 7.x systems."); +static const char untranslated_error_RedHat_6_only[] = + N_("Sorry, but this is the installer for RedHat 6.\n" \ + "You need to download the installer for RedHat 7."); +static const char untranslated_error_RedHat_7_only[] = + N_("Sorry, but this is the installer for RedHat 7.\n" \ + "You need to download the installer for RedHat 6."); #define ERROR_NEED_TO_SET_PROXY _(untranslated_error_need_to_set_proxy) #define D_WAIT_LABEL _(untranslated_wait_label) @@ -148,14 +151,16 @@ static const char untranslated_error_Red_Hat_7_not_supported[] = #define D_ERROR_NON_RPM_BASED_SYSTEM _(untranslated_error_non_RPM_based_system) #define D_ERROR_UNTESTED_RPM_BASED_SYSTEM_TEXT _(untranslated_error_untested_RPM_based_system) #define D_ERROR_UNTESTED_RPM_BASED_SYSTEM_TITLE _(untranslated_error_untested_RPM_based_system_title) -#define D_ERROR_RED_HAT_7_NOT_SUPPORTED _(untranslated_error_Red_Hat_7_not_supported) +#define D_ERROR_REDHAT_6_ONLY _(untranslated_error_RedHat_6_only) +#define D_ERROR_REDHAT_7_ONLY _(untranslated_error_RedHat_7_only) #define NAUTILUS_INSTALLER_RELEASE #undef THAT_DAMN_CHECKBOX enum { ERROR_RPM_4_NOT_SUPPORTED, - ERROR_RED_HAT_7_NOT_SUPPORTED, + ERROR_REDHAT_6_ONLY, + ERROR_REDHAT_7_ONLY, ERROR_NON_RPM_BASED_SYSTEM, ERROR_UNTESTED_RPM_BASED_SYSTEM_TITLE, @@ -875,6 +880,7 @@ eazel_download_progress (EazelInstall *service, gtk_label_set_text (GTK_LABEL (label_single), temp); g_free (temp); installer->last_KB = 0; + installer->downloaded_anything = TRUE; } gtk_progress_set_value (GTK_PROGRESS (progress_single), (float)amount); @@ -1159,6 +1165,7 @@ eazel_install_preflight (EazelInstall *service, log_debug ("PREFLIGHT: %s", temp); g_free (temp); + installer->downloaded_anything = TRUE; installer->total_packages = num_packages; installer->total_size = total_size; installer->total_mb = total_mb; @@ -1515,11 +1522,22 @@ check_system (EazelInstaller *installer) ""); return FALSE; } +#if RPM_MAJOR == 3 } else if (dist.version_major == 7) { - jump_to_error_page (installer, NULL, - text_labels [ERROR_RED_HAT_7_NOT_SUPPORTED], - ""); - return FALSE; + jump_to_error_page (installer, NULL, text_labels [ERROR_REDHAT_6_ONLY], ""); + return FALSE; +#else +#if RPM_MAJOR == 4 + } else if (dist.version_major == 6) { + jump_to_error_page (installer, NULL, text_labels [ERROR_REDHAT_7_ONLY], ""); + return FALSE; +#else + } else { + insert_info_page (installer, + text_labels [ERROR_UNTESTED_RPM_BASED_SYSTEM_TITLE], + text_labels [ERROR_UNTESTED_RPM_BASED_SYSTEM_TEXT]); +#endif +#endif } return TRUE; @@ -1685,7 +1703,12 @@ eazel_installer_finalize (GtkObject *object) } g_list_foreach (installer->categories, (GFunc)categorydata_destroy_foreach, NULL); g_list_free (installer->categories); - eazel_install_unref (GTK_OBJECT (installer->service)); + if (installer->service != NULL) { + gtk_object_unref (GTK_OBJECT (installer->service)); + } + if (installer->problem != NULL) { + gtk_object_unref (GTK_OBJECT (installer->problem)); + } g_free (installer->tmpdir); /* Call parents destroy */ @@ -1719,7 +1742,8 @@ eazel_installer_set_default_texts (EazelInstaller *installer) text_labels [ERROR_UNTESTED_RPM_BASED_SYSTEM_TEXT] = g_strdup (D_ERROR_UNTESTED_RPM_BASED_SYSTEM_TEXT); text_labels [ERROR_NON_RPM_BASED_SYSTEM] = g_strdup (D_ERROR_NON_RPM_BASED_SYSTEM); text_labels [ERROR_RPM_4_NOT_SUPPORTED] = g_strdup (D_ERROR_RPM_4_NOT_SUPPORTED); - text_labels [ERROR_RED_HAT_7_NOT_SUPPORTED] = g_strdup (D_ERROR_RED_HAT_7_NOT_SUPPORTED); + text_labels [ERROR_REDHAT_6_ONLY] = g_strdup (D_ERROR_REDHAT_6_ONLY); + text_labels [ERROR_REDHAT_7_ONLY] = g_strdup (D_ERROR_REDHAT_7_ONLY); text_labels [WAIT_LABEL] = g_strdup (D_WAIT_LABEL); text_labels [WAIT_LABEL_2] = g_strdup (D_WAIT_LABEL_2); text_labels [ERROR_LABEL] = g_strdup (D_ERROR_LABEL); @@ -2092,6 +2116,7 @@ eazel_installer_initialize (EazelInstaller *object) installer->uninstalling = FALSE; installer->packages_possible_broken = NULL; package_destination = g_strdup_printf ("%s/%s", installer->tmpdir, PACKAGE_LIST); + installer->downloaded_anything = FALSE; eazel_installer_setup_texts (installer, tmpdir); installer->window = create_window (installer); diff --git a/nautilus-installer/src/installer.h b/nautilus-installer/src/installer.h index b8ac1ed51..93a90477c 100644 --- a/nautilus-installer/src/installer.h +++ b/nautilus-installer/src/installer.h @@ -78,6 +78,7 @@ struct _EazelInstaller gboolean debug, output; gboolean test; gboolean uninstalling; + gboolean downloaded_anything; unsigned long total_bytes_downloaded; unsigned long last_KB; diff --git a/nautilus-installer/src/link.sh b/nautilus-installer/src/link.sh index b98b7ba1e..f503d9194 100755 --- a/nautilus-installer/src/link.sh +++ b/nautilus-installer/src/link.sh @@ -110,7 +110,7 @@ if test "x$FULL" = "xyes"; then fi make clean && \ -make CFLAGS="$OG_FLAG $WARN_FLAG -DNO_TEXT_BOX -DBUILD_DATE=\\\"${BUILD_DATE}\\\"" LDFLAGS="-static" && \ +make CFLAGS="$OG_FLAG $WARN_FLAG -DBUILD_DATE=\\\"${BUILD_DATE}\\\" -DRPM_MAJOR=${RPM_MAJOR}" LDFLAGS="-static" && \ gcc -static $OG_FLAG $WARN_FLAG -o eazel-installer \ main.o callbacks.o installer.o proxy.o package-tree.o gtk-hackery.o \ ../../components/services/install/lib/libeazelinstall_minimal.a \ @@ -153,11 +153,11 @@ if test "$1" = "push" -a $? = 0; then if test "$USER" = "robey"; then cp eazel-installer.sh /h/public/bin/ # make it so anyone can write a new one in - chmod 777 /h/public/bin/eazel-installer.sh + chmod 777 /h/public/bin/eazel-installer-rpm${RPM_MAJOR}.sh else echo "You are not Robey, therefore you are lame. Enter your password." chmod 777 ./eazel-installer.sh - scp ./eazel-installer.sh odin.eazel.com:/h/public/bin/ + scp ./eazel-installer.sh odin.eazel.com:/h/public/bin/eazel-installer-rpm${RPM_MAJOR}.sh fi fi diff --git a/nautilus-installer/src/main.c b/nautilus-installer/src/main.c index 27bc166e2..4d3c98e47 100644 --- a/nautilus-installer/src/main.c +++ b/nautilus-installer/src/main.c @@ -152,6 +152,9 @@ main (int argc, char *argv[]) exit (0); } + /* Disable session manager connection */ + gnome_client_disable_master_connection (); + gnome_init_with_popt_table ("eazel-installer", VERSION, argc, argv, options, 0, NULL); signal (SIGSEGV, segv_handler); @@ -198,10 +201,7 @@ main (int argc, char *argv[]) gtk_main (); - gtk_object_unref (GTK_OBJECT (installer->service)); - gtk_object_unref (GTK_OBJECT (installer->problem)); - - printf ("Exiting\n"); + gtk_object_unref (GTK_OBJECT (installer)); g_mem_profile (); return 0; } |