[gnome-continuous] libqa: Try even harder to unload sysroot



commit 2461e0daea68d4595d32f624b71301303115c18a
Author: Colin Walters <walters verbum org>
Date:   Thu Aug 13 12:28:37 2015 -0400

    libqa: Try even harder to unload sysroot

 src/js/libqa.js |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/src/js/libqa.js b/src/js/libqa.js
index 8b09045..b173435 100644
--- a/src/js/libqa.js
+++ b/src/js/libqa.js
@@ -150,7 +150,7 @@ function copyDisk(srcpath, destpath, cancellable) {
                      destpath.get_path()], cancellable);
 }
 
-function getCurrentDeploymentDirectory(mntdir, osname) {
+function _internalGetCurrentDeploymentDirectory(mntdir, osname) {
     let sysroot = OSTree.Sysroot.new(mntdir);
     sysroot.load(null);
     let deployments = sysroot.get_deployments().filter(function (deployment) {
@@ -160,6 +160,15 @@ function getCurrentDeploymentDirectory(mntdir, osname) {
        throw new Error("No deployments for " + osname + " in " + mntdir.get_path());
     let current = deployments[0];
     let deployDir = sysroot.get_deployment_directory(current);
+    // Try using the new unload API
+    if (sysroot.unload)
+       sysroot.unload();
+    sysroot.unload();
+    return deployDir;
+}
+
+function getCurrentDeploymentDirectory(mntdir, osname) {
+    let deployDir = _internalGetCurrentDeploymentDirectory(mntdir, osname);
     // Clean up the reference to the sysroot object, since it holds a fd open,
     // and doing so may cause unmounts to fail
     imports.system.gc();


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