Mailinglist Archive: zypp-commit (325 mails)

< Previous Next >
[zypp-commit] r7097 - in /trunk/updater-gnome/src: updater-applet-support.c updater-applet-support.h updater-backend.c updater-backend.h zypp/updater-zypp.c
  • From: joshkress@xxxxxxxxxxxxxxxx
  • Date: Mon, 03 Sep 2007 15:13:15 -0000
  • Message-id: <20070903151316.0C80125081@xxxxxxxxxxxxxxxx>
Author: joshkress
Date: Mon Sep  3 17:13:15 2007
New Revision: 7097

URL: http://svn.opensuse.org/viewcvs/zypp?rev=7097&view=rev
Log:
- affects-package-management patches now handled properly
- fix some memory propblems

Modified:
    trunk/updater-gnome/src/updater-applet-support.c
    trunk/updater-gnome/src/updater-applet-support.h
    trunk/updater-gnome/src/updater-backend.c
    trunk/updater-gnome/src/updater-backend.h
    trunk/updater-gnome/src/zypp/updater-zypp.c

Modified: trunk/updater-gnome/src/updater-applet-support.c
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/updater-gnome/src/updater-applet-support.c?rev=7097&r1=7096&r2=7097&view=diff
==============================================================================
--- trunk/updater-gnome/src/updater-applet-support.c (original)
+++ trunk/updater-gnome/src/updater-applet-support.c Mon Sep  3 17:13:15 2007
@@ -7,9 +7,20 @@
 
 #include <gtk/gtk.h>
 
+
 #include "updater-applet-support.h"
 
 void updater_applet_set_icon(UpdaterApplet *applet, const char *icon_stock_id)
 {
   gtk_status_icon_set_from_stock (GTK_STATUS_ICON (applet->applet_icon), icon_stock_id);
 }
+
+void updater_applet_restart(UpdaterApplet *applet)
+{
+  g_print ("updater_applet_restart: calling updater_destroy!\n");
+  updater_destroy(applet->updater); 
+  g_print ("updater_applet_restart: calling applet in 2 sec.\n");
+  system("(sleep 2; opensuse-updater-gnome-applet ) &");
+  g_print ("updater_applet_restart: calling gtk_main_quit!\n");
+  gtk_main_quit ();
+}

Modified: trunk/updater-gnome/src/updater-applet-support.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/updater-gnome/src/updater-applet-support.h?rev=7097&r1=7096&r2=7097&view=diff
==============================================================================
--- trunk/updater-gnome/src/updater-applet-support.h (original)
+++ trunk/updater-gnome/src/updater-applet-support.h Mon Sep  3 17:13:15 2007
@@ -36,4 +36,6 @@
 /** Sets applet icon to \a icon_stock_id. See ICON_* stock IDs definitions. */
 void updater_applet_set_icon(UpdaterApplet *applet, const char *icon_stock_id);
 
+void updater_applet_restart(UpdaterApplet *applet);
+
 #endif /*UPDATERAPPLET_H_*/

Modified: trunk/updater-gnome/src/updater-backend.c
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/updater-gnome/src/updater-backend.c?rev=7097&r1=7096&r2=7097&view=diff
==============================================================================
--- trunk/updater-gnome/src/updater-backend.c (original)
+++ trunk/updater-gnome/src/updater-backend.c Mon Sep  3 17:13:15 2007
@@ -206,17 +206,19 @@
 
 void backend_install_watch (GPid pid,
                             gint status,
-                            gpointer updater)
+                            gpointer updater_ptr)
 {
+  SUSEUpdater *updater = updater_ptr;
+  
   g_print ("child process %d (you) exited with status %d.\n",pid,status);
   
   updater_ui_set_for_active_operation(updater,FALSE);
   
-  
-  /* This doesn't work. It never worked. I could kill this code!
-  verb_check_now (updater, 0, NULL);
-  */
-  updater_check_now(updater);
+  g_print ("Includes pkgmanager updates: %d.\n", updater->backend->includes_package_management_update);
+  if(updater->backend->includes_package_management_update)
+    updater_applet_restart(updater->applet);
+  else
+    updater_check_now(updater);
 }
 
 

Modified: trunk/updater-gnome/src/updater-backend.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/updater-gnome/src/updater-backend.h?rev=7097&r1=7096&r2=7097&view=diff
==============================================================================
--- trunk/updater-gnome/src/updater-backend.h (original)
+++ trunk/updater-gnome/src/updater-backend.h Mon Sep  3 17:13:15 2007
@@ -54,6 +54,8 @@
   gboolean   recommended_are_mandatory;
   gboolean   include_optional_patches;
   gboolean   include_third_party_packages;
+  
+  gboolean   includes_package_management_update;
 
   // process' output buffers
   guint8 *poutbuf;
@@ -103,7 +105,7 @@
 
 void backend_install_watch (GPid pid,
                             gint status,
-                            gpointer backend);
+                            gpointer backend_ptr);
 
 GIOChannel *
 set_up_io_channel (gint fd, GIOCondition cond, GIOFunc func, gpointer data);

Modified: trunk/updater-gnome/src/zypp/updater-zypp.c
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/updater-gnome/src/zypp/updater-zypp.c?rev=7097&r1=7096&r2=7097&view=diff
==============================================================================
--- trunk/updater-gnome/src/zypp/updater-zypp.c (original)
+++ trunk/updater-gnome/src/zypp/updater-zypp.c Mon Sep  3 17:13:15 2007
@@ -93,6 +93,8 @@
   backend->third_party_packages_count = 0;
   backend->needrestart_updates_count = 0;
   
+  backend->includes_package_management_update = FALSE;
+  
   backend->updates_list_security = g_string_new(NULL);
   backend->updates_list_security_needrestart = g_string_new(NULL);
   backend->updates_list_recommended_patches = g_string_new(NULL);
@@ -141,6 +143,8 @@
       if ((!xmlStrcmp(item->resolvabletype, (const xmlChar *)"patch")))
       {
         /* We have a patch */
+        if ((!xmlStrcmp(item->pkgmanager, (const xmlChar *)"true"))) /* A very special patch */
+          backend->includes_package_management_update = TRUE;
         
         if (patch_source == "") /* Setting the patch source to exclude packages from this source */
         {
@@ -148,7 +152,7 @@
           g_print("Patch Source: %s\n", patch_source);
         }
         
-        if ((!xmlStrcmp(item->type, (const xmlChar *)"security")))
+        if ((!xmlStrcmp(item->type, (const xmlChar *)"security")) || (!xmlStrcmp(item->pkgmanager, (const xmlChar *)"true")))
         {
           /* It's a security patch! */
           if ((!xmlStrcmp(item->restart, (const xmlChar *)"true")))
@@ -468,7 +472,7 @@
     return 0;
   
   g_string_free(zypper_gui_cmd, TRUE);
-  g_free(install_argv);
+  // g_free(install_argv);
   return pid;
 }
 

--
To unsubscribe, e-mail: zypp-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: zypp-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages