Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=gfpm.git;a=commitdiff;h=1081b30fb3f3b6c6c6094ed0743933552c00a10c

commit 1081b30fb3f3b6c6c6094ed0743933552c00a10c
Author: Priyank <priy...@frugalware.org>
Date:   Mon Jun 8 22:07:38 2009 +0530

Bugfix in cb_gfpm_install_file_clicked()
* When adding a package with pacman_trans_addtarget(), it should check
if the function caused any error by checking pm_errno and only then
proceed with pacman_trans_prepare(). Otherwise, a bogus error
message will be displayed.

diff --git a/src/gfpm-interface.c b/src/gfpm-interface.c
index 730e147..978f72e 100644
--- a/src/gfpm-interface.c
+++ b/src/gfpm-interface.c
@@ -2306,7 +2306,16 @@ cb_gfpm_install_file_clicked (GtkButton *button, 
gpointer data)
}
gfpm_progress_show (TRUE);
/* add the target */
-       pacman_trans_addtarget ((char*)fpm);
+       if (pacman_trans_addtarget((char*)fpm)==-1)
+       {
+               gfpm_progress_show (FALSE);
+               gchar *p_error_utf8 = gfpm_convert_to_utf8 
(pacman_strerror(pm_errno));
+               str = g_strdup_printf (_("Failed to add target (%s)\n"), 
p_error_utf8);
+               gfpm_error (_("Error"), str);
+               g_free (str);
+               g_free (p_error_utf8);
+               goto cleanup;
+       }
if (gfpm_trans_prepare(trans_data) == -1)
{
gfpm_progress_show (FALSE);
_______________________________________________
Frugalware-git mailing list
Frugalware-git@frugalware.org
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to