[Goodies-commits] r3252 - xfce4-smartpm-plugin/trunk/src

Anders F Bjorklund afb at xfce.org
Thu Sep 27 20:57:40 CEST 2007


Author: afb
Date: 2007-09-27 18:57:40 +0000 (Thu, 27 Sep 2007)
New Revision: 3252

Modified:
   xfce4-smartpm-plugin/trunk/src/xfcesmart.c
Log:
ignore harmless apt error

Modified: xfce4-smartpm-plugin/trunk/src/xfcesmart.c
===================================================================
--- xfce4-smartpm-plugin/trunk/src/xfcesmart.c	2007-09-26 07:10:34 UTC (rev 3251)
+++ xfce4-smartpm-plugin/trunk/src/xfcesmart.c	2007-09-27 18:57:40 UTC (rev 3252)
@@ -478,10 +478,19 @@
   {
     while ( (p = fgets(buf, sizeof(buf), file)) != NULL )
     {
+      if (strstr(p, "Failed to write temporary StateFile") != NULL &&
+          smart->package_manager == PACKAGE_MANAGER_APT)
+      {
+        /* skip this error, we don't want to write anything anyway */
+        continue;
+      }
       if (strstr(p, "error: ") != NULL ||
           smart->package_manager != PACKAGE_MANAGER_SMART)
       {
-        p += strlen("error: ");
+        if (strstr(p, "error: ") == 0)
+          p += strlen("error: ");
+        if (strstr(p, "E: ") == 0)
+          p += strlen("E: ");
         msg = g_strdup(p);
         p = msg + strlen(msg) - 1;
         if (*p == '\n') *p = '\0';




More information about the Goodies-commits mailing list