Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=fc39f9300227559a3d99bbad8043bc8f20677a06

commit fc39f9300227559a3d99bbad8043bc8f20677a06
Author: Priyank <priy...@frugalware.org>
Date:   Sat May 30 17:23:37 2009 +0530

gfpm-1.2.3-2-i686
* backport a patch from git to fix #2738

diff --git a/source/xapps/gfpm/FrugalBuild b/source/xapps/gfpm/FrugalBuild
index 7398b0c..1010dba 100644
--- a/source/xapps/gfpm/FrugalBuild
+++ b/source/xapps/gfpm/FrugalBuild
@@ -3,7 +3,7 @@

pkgname=gfpm
pkgver=1.2.3
-pkgrel=1
+pkgrel=2
pkgdesc="Graphical Frugalware Package Manager"
url="http://ftp.frugalware.org/pub/other/gfpm";
depends=('glib2' 'gtk+2>=2.14.7' 'libglade' 'pacman-g2>=3.7.3' 
'frugalwareutils>=0.8.7')
@@ -14,8 +14,8 @@ archs=('i686' 'x86_64' 'ppc')
_F_gnome_iconcache="y"
Finclude gnome-scriptlet
up2date="lynx -dump $url | Flasttar"
-source=($url/$pkgname-$pkgver.tar.gz)
-signatures=(${source[0]}.asc)
+source=($url/$pkgname-$pkgver.tar.gz gfpm-bug2738.patch)
+signatures=(${source[0]}.asc '')

build()
{
diff --git a/source/xapps/gfpm/gfpm-bug2738.patch 
b/source/xapps/gfpm/gfpm-bug2738.patch
new file mode 100644
index 0000000..d385be5
--- /dev/null
+++ b/source/xapps/gfpm/gfpm-bug2738.patch
@@ -0,0 +1,193 @@
+diff -Naur gfpm-1.2.3/src/gfpm-interface.c gfpm-1.2.3.new/src/gfpm-interface.c
+--- gfpm-1.2.3/src/gfpm-interface.c    2009-05-30 15:59:59.000000000 +0530
++++ gfpm-1.2.3.new/src/gfpm-interface.c        2009-05-30 17:18:15.000000000 
+0530
+@@ -494,8 +494,11 @@
+                                       gfpm_progress_install) == -1)
+               {
+                       gchar *str;
+-                      str = g_strdup_printf (_("Failed to init transaction 
(%s)\n"), pacman_strerror(pm_errno));
++                      gchar *p_error_utf8 = gfpm_convert_to_utf8 
(pacman_strerror(pm_errno));
++                      str = g_strdup_printf (_("Failed to init transaction 
(%s)\n"), p_error_utf8);
+                       errorstr = g_string_append (errorstr, str);
++                      if (p_error_utf8)
++                              g_free (p_error_utf8);
+                       if (pm_errno == PM_ERR_HANDLE_LOCK)
+                               g_string_printf (errorstr, "%s", lck_error);
+                       if (gfpm_question (_("Error"), errorstr->str) == 
GTK_RESPONSE_YES)
+@@ -562,8 +565,11 @@
+ itry: if (pacman_trans_init(PM_TRANS_TYPE_SYNC, flags, gfpm_progress_event, 
cb_gfpm_trans_conv, gfpm_progress_install) == -1)
+               {
+                       gchar *str;
+-                      str = g_strdup_printf (_("Failed to init transaction 
(%s)\n"), pacman_strerror(pm_errno));
++                      gchar *p_error_utf8 = gfpm_convert_to_utf8 
(pacman_strerror(pm_errno));
++                      str = g_strdup_printf (_("Failed to init transaction 
(%s)\n"), p_error_utf8);
+                       errorstr = g_string_append (errorstr, str);
++                      if (p_error_utf8)
++                              g_free (p_error_utf8);
+                       if (pm_errno == PM_ERR_HANDLE_LOCK)
+                               g_string_printf (errorstr, "%s", lck_error);
+                       if (gfpm_question (_("Error"), errorstr->str) == 
GTK_RESPONSE_YES)
+@@ -1215,9 +1221,11 @@
+               PM_LIST *i;
+               GList   *pkgs = NULL;
+               gchar   *str = NULL;
+-              str = g_strdup_printf (_("Failed to prepare transaction 
(%s)\n"), pacman_strerror (pm_errno));
++              gchar   *p_error_utf8 = gfpm_convert_to_utf8 
(pacman_strerror(pm_errno));
++              str = g_strdup_printf (_("Failed to prepare transaction 
(%s)\n"), p_error_utf8);
+               gfpm_error (_("Error"), str);
+               g_free (str);
++              g_free (p_error_utf8);
+               int t = (long)pacman_trans_getinfo (PM_TRANS_TYPE);
+               switch ((long)pm_errno)
+               {
+@@ -1230,9 +1238,9 @@
+                                       if (t == PM_TRANS_TYPE_REMOVE)
+                                       {
+                                               val = g_strdup_printf ("%s : %s 
%s",
+-                                                                              
                (char*)pacman_dep_getinfo (m, PM_DEP_TARGET),
+-                                                                              
                _("is required by"),
+-                                                                              
                (char*)pacman_dep_getinfo (m, PM_DEP_NAME));
++                                                                      
(char*)pacman_dep_getinfo (m, PM_DEP_TARGET),
++                                                                      _("is 
required by"),
++                                                                      
(char*)pacman_dep_getinfo (m, PM_DEP_NAME));
+                                               depstring = g_string_append 
(depstring, val);
+                                       }
+                                       else
+@@ -1298,9 +1306,11 @@
+               PM_LIST *i;
+               GList   *pkgs = NULL;
+               gchar   *str = NULL;
+-              str = g_strdup_printf (_("Failed to commit transaction 
(%s)\n"), pacman_strerror (pm_errno));
++              gchar   *p_error_utf8 = gfpm_convert_to_utf8 
(pacman_strerror(pm_errno));
++              str = g_strdup_printf (_("Failed to commit transaction 
(%s)\n"), p_error_utf8);
+               gfpm_error (_("Error"), str);
+               g_free (str);
++              g_free (p_error_utf8);
+
+               switch ((long)pm_errno)
+               {
+@@ -1378,7 +1388,7 @@
+       while (dbs != NULL)
+       {
+               PM_DB *tdb = dbs->data;
+-              ret = pacman_db_update (0, tdb);
++              ret = pacman_db_update (1, tdb);
+               dbs = g_list_next (dbs);
+       }
+       gfpm_progress_show (FALSE);
+@@ -1411,17 +1421,21 @@
+       {
+               gchar *str;
+               GString *errorstr = g_string_new ("");
+-              str = g_strdup_printf (_("Failed to init transaction (%s)\n"), 
pacman_strerror(pm_errno));
++              gchar *p_error_utf8 = gfpm_convert_to_utf8 
(pacman_strerror(pm_errno));
++              str = g_strdup_printf (_("Failed to init transaction (%s)\n"), 
p_error_utf8);
+               errorstr = g_string_append (errorstr, str);
+               if (pm_errno == PM_ERR_HANDLE_LOCK)
+                       errorstr = g_string_append (errorstr,
+                                               _("If you're sure a package 
manager is not already running, you can delete /tmp/pacman-g2.lck"));
+               gfpm_error (_("Error"), errorstr->str);
++              g_free (p_error_utf8);
+               return;
+       }
+       if (pacman_trans_sysupgrade()==-1)
+       {
+-              g_print ("error %s", pacman_strerror(pm_errno));
++              gchar *p_error_utf8 = gfpm_convert_to_utf8 
(pacman_strerror(pm_errno));
++              g_print ("Error: %s\n", p_error_utf8);
++              g_free (p_error_utf8);
+       }
+       packages = pacman_trans_getinfo (PM_TRANS_PACKAGES);
+
+@@ -2089,9 +2103,11 @@
+                               gfpm_message ("Gfpm", _("Finished clearing the 
cache"));
+                       else
+                       {
+-                              errstr = g_strdup_printf (_("Failed to clean 
the cache (%s)"), pacman_strerror(pm_errno));
++                              gchar *p_error_utf8 = gfpm_convert_to_utf8 
(pacman_strerror(pm_errno));
++                              errstr = g_strdup_printf (_("Failed to clean 
the cache (%s)"), p_error_utf8);
+                               gfpm_error (_("Error clearing cache"), errstr);
+                               g_free (errstr);
++                              g_free (p_error_utf8);
+                       }
+               }
+               return;
+@@ -2107,9 +2123,11 @@
+                               gfpm_message ("Gfpm", _("Finished clearing the 
cache"));
+                       else
+                       {
+-                              errstr = g_strdup_printf (_("Failed to clean 
the cache (%s)"), pacman_strerror(pm_errno));
+-                              gfpm_message (_("Error clearing cache"), 
errstr);
++                              gchar *p_error_utf8 = gfpm_convert_to_utf8 
(pacman_strerror(pm_errno));
++                              errstr = g_strdup_printf (_("Failed to clean 
the cache (%s)"), p_error_utf8);
++                              gfpm_error (_("Error clearing cache"), errstr);
+                               g_free (errstr);
++                              g_free (p_error_utf8);
+                       }
+               }
+               return;
+@@ -2145,12 +2163,14 @@
+               flags |= PM_TRANS_FLAG_FORCE;
+       if (pacman_trans_init(type, flags, gfpm_progress_event, 
cb_gfpm_trans_conv, gfpm_progress_install) == -1)
+       {
+-                      str = g_strdup_printf (_("Failed to init transaction 
(%s)\n"), pacman_strerror(pm_errno));
++                      gchar *p_error_utf8 = gfpm_convert_to_utf8 
(pacman_strerror(pm_errno));
++                      str = g_strdup_printf (_("Failed to init transaction 
(%s)\n"), p_error_utf8);
+                       errorstr = g_string_append (errorstr, str);
+                       if (pm_errno == PM_ERR_HANDLE_LOCK)
+                       {       errorstr = g_string_append (errorstr,
+                                                       _("If you're sure a 
package manager is not already running, you can delete /tmp/pacman-g2.lck"));
+                               gfpm_error (_("Error"), errorstr->str);
++                              g_free (p_error_utf8);
+                       }
+                       return;
+       }
+@@ -2164,9 +2184,11 @@
+       }
+       if (pacman_trans_commit(&trans_data) == -1)
+       {
+-              str = g_strdup_printf (_("Failed to commit transaction 
(%s)\n"), pacman_strerror (pm_errno));
++              gchar *p_error_utf8 = gfpm_convert_to_utf8 
(pacman_strerror(pm_errno));
++              str = g_strdup_printf (_("Failed to commit transaction 
(%s)\n"), p_error_utf8);
+               gfpm_error (_("Error"), str);
+               g_free (str);
++              g_free (p_error_utf8);
+               goto cleanup;
+       }
+       else
+diff -Naur gfpm-1.2.3/src/gfpm-util.c gfpm-1.2.3.new/src/gfpm-util.c
+--- gfpm-1.2.3/src/gfpm-util.c 2009-05-30 15:59:59.000000000 +0530
++++ gfpm-1.2.3.new/src/gfpm-util.c     2009-05-30 17:18:21.000000000 +0530
+@@ -100,3 +100,21 @@
+       return;
+ }
+
++gchar *
++gfpm_convert_to_utf8 (const char *str)
++{
++      gchar   *ret = NULL;
++      GError  *error = NULL;
++      if (str)
++      {
++              ret = g_convert (str, strlen(str), "UTF-8", "", NULL, NULL, 
&error);
++              if (ret == NULL)
++              {
++                      g_print ("Error converting string to utf-8: %s\n", 
error->message);
++              }
++      }
++
++      return ret;
++}
++
++
+diff -Naur gfpm-1.2.3/src/gfpm-util.h gfpm-1.2.3.new/src/gfpm-util.h
+--- gfpm-1.2.3/src/gfpm-util.h 2009-05-30 15:59:59.000000000 +0530
++++ gfpm-1.2.3.new/src/gfpm-util.h     2009-05-30 17:18:26.000000000 +0530
+@@ -22,4 +22,7 @@
+
+ void gfpm_update_iconcache (void);
+
++/* Converts a string to UTF-8. Returned string must be freed */
++gchar * gfpm_convert_to_utf8 (const char *str);
++
+ #endif
_______________________________________________
Frugalware-git mailing list
Frugalware-git@frugalware.org
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to