[ostree] deploy: Only query bootloader if we have to make a loader change



commit ae68b8380fb83a9670aa8c05d2ad2c1bb0393092
Author: Colin Walters <walters verbum org>
Date:   Thu Sep 19 22:25:12 2013 -0400

    deploy: Only query bootloader if we have to make a loader change
    
    This will also help distinguish in the output when we're just swapping
    bootlinks versus when we need to change the loader config.

 src/libostree/ostree-sysroot-deploy.c |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/src/libostree/ostree-sysroot-deploy.c b/src/libostree/ostree-sysroot-deploy.c
index 34dbaf6..4639ead 100644
--- a/src/libostree/ostree-sysroot-deploy.c
+++ b/src/libostree/ostree-sysroot-deploy.c
@@ -1016,7 +1016,6 @@ ostree_sysroot_write_deployments (OstreeSysroot     *self,
   gboolean ret = FALSE;
   guint i;
   gboolean requires_new_bootversion = FALSE;
-  gs_unref_object OstreeBootloader *bootloader = _ostree_sysroot_query_bootloader (self);
 
   g_assert (self->loaded);
 
@@ -1051,11 +1050,6 @@ ostree_sysroot_write_deployments (OstreeSysroot     *self,
         }
     }
 
-  if (bootloader)
-    g_print ("Detected bootloader: %s\n", _ostree_bootloader_get_name (bootloader));
-  else
-    g_print ("Detected bootloader: (unknown)\n");
-
   if (!requires_new_bootversion)
     {
       if (!full_system_sync (cancellable, error))
@@ -1075,6 +1069,13 @@ ostree_sysroot_write_deployments (OstreeSysroot     *self,
   else
     {
       int new_bootversion = self->bootversion ? 0 : 1;
+      gs_unref_object OstreeBootloader *bootloader = _ostree_sysroot_query_bootloader (self);
+
+      if (bootloader)
+        g_print ("Detected bootloader: %s\n", _ostree_bootloader_get_name (bootloader));
+      else
+        g_print ("Detected bootloader: (unknown)\n");
+      
       for (i = 0; i < new_deployments->len; i++)
         {
           OstreeDeployment *deployment = new_deployments->pdata[i];


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]