[gnome-ostree] build: Some cleanups for yocto build



commit 9472097e804d15ce28af5d43cb6df9443f9e7488
Author: Colin Walters <walters verbum org>
Date:   Sun Feb 24 03:18:00 2013 -0500

    build: Some cleanups for yocto build
    
    Don't check out the git repo until we need to, and clean it up after
    we're done.

 src/js/tasks/task-build.js |   34 ++++++++++++++++++----------------
 1 files changed, 18 insertions(+), 16 deletions(-)
---
diff --git a/src/js/tasks/task-build.js b/src/js/tasks/task-build.js
index d36da3e..44c14b5 100644
--- a/src/js/tasks/task-build.js
+++ b/src/js/tasks/task-build.js
@@ -665,22 +665,6 @@ const TaskBuild = new Lang.Class({
        let basename = basemeta['name'];
        let buildWorkdir = this.subworkdir.get_child('build-' + basemeta['name'] + '-' + architecture);
         let checkoutdir = buildWorkdir.get_child(basemeta['name']);
-       GSystem.file_ensure_directory(checkoutdir.get_parent(), true, cancellable);
-
-       let ftype = checkoutdir.query_file_type(Gio.FileQueryInfoFlags.NOFOLLOW_SYMLINKS, cancellable);
-        if (ftype == Gio.FileType.SYMBOLIC_LINK)
-           GSystem.file_unlink(checkoutdir, cancellable);
-
-        let [keytype, uri] = Vcs.parseSrcKey(basemeta['src']);
-        if (keytype == 'local') {
-           GSystem.shutil_rm_rf(checkoutdir, cancellable);
-           checkoutdir.make_symbolic_link(uri, cancellable);
-        } else {
-            Vcs.getVcsCheckout(this.mirrordir, keytype, uri, checkoutdir,
-                               basemeta['revision'], cancellable,
-                               {overwrite:false});
-       }
-
         let builddirName = Format.vprintf('build-%s-%s', [basemeta['name'], architecture]);
         let builddir = this.workdir.get_child(builddirName);
 
@@ -701,6 +685,23 @@ const TaskBuild = new Lang.Class({
            }
        } 
 
+       let ftype = checkoutdir.query_file_type(Gio.FileQueryInfoFlags.NOFOLLOW_SYMLINKS, cancellable);
+        if (ftype == Gio.FileType.SYMBOLIC_LINK)
+           GSystem.file_unlink(checkoutdir, cancellable);
+
+       GSystem.file_ensure_directory(checkoutdir.get_parent(), true, cancellable);
+
+        let [keytype, uri] = Vcs.parseSrcKey(basemeta['src']);
+        if (keytype == 'local') {
+           GSystem.shutil_rm_rf(checkoutdir, cancellable);
+           checkoutdir.make_symbolic_link(uri, cancellable);
+        } else {
+            Vcs.getVcsCheckout(this.mirrordir, keytype, uri, checkoutdir,
+                               basemeta['revision'], cancellable,
+                               {overwrite:false});
+       }
+
+
         // Just keep reusing the old working directory downloads and sstate
         let oldBuilddir = this.workdir.get_child('build-' + basemeta['name']);
         let sstateDir = oldBuilddir.get_child('sstate-cache');
@@ -732,6 +733,7 @@ const TaskBuild = new Lang.Class({
        }
 
        builtRevisionPath.replace_contents(basemeta['revision'], null, false, 
Gio.FileCreateFlags.REPLACE_DESTINATION, cancellable);
+       GSystem.shutil_rm_rf(checkoutdir, cancellable);
     },
 
     execute: function(cancellable) {


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