[gnome-ostree/wip/new-model: 9/12] build: Remove subworkdir



commit 352261e19009675f573c7fbbcf561432062e7b55
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Wed Jun 19 18:05:43 2013 -0400

    build: Remove subworkdir
    
    It's just the cwd.

 src/js/tasks/task-bdiff.js      |    2 --
 src/js/tasks/task-build.js      |    8 +++-----
 src/js/tasks/task-builddisks.js |    8 +++-----
 3 files changed, 6 insertions(+), 12 deletions(-)
---
diff --git a/src/js/tasks/task-bdiff.js b/src/js/tasks/task-bdiff.js
index a30e341..d1cffff 100644
--- a/src/js/tasks/task-bdiff.js
+++ b/src/js/tasks/task-bdiff.js
@@ -83,8 +83,6 @@ const TaskBdiff = new Lang.Class({
     },
 
     execute: function(cancellable) {
-       this.subworkdir = Gio.File.new_for_path('.');
-
        let builddb = this._getResultDb('build');
         let latestPath = builddb.getLatestPath();
        if (!latestPath)
diff --git a/src/js/tasks/task-build.js b/src/js/tasks/task-build.js
index eec636c..48aa1ff 100644
--- a/src/js/tasks/task-build.js
+++ b/src/js/tasks/task-build.js
@@ -701,7 +701,7 @@ const TaskBuild = new Lang.Class({
     },
     
     _checkoutOneTreeCoreAsync: function(name, composeContents, cancellable, callback) {
-        let composeRootdir = this.subworkdir.get_child(name);
+        let composeRootdir = Gio.File.new_for_path(name);
        print("Checking out " + composeRootdir.get_path());
        GSystem.shutil_rm_rf(composeRootdir, cancellable);
         GSystem.file_ensure_directory(composeRootdir, true, cancellable);
@@ -931,7 +931,7 @@ const TaskBuild = new Lang.Class({
     _buildBase: function(architecture, cancellable) {
         let basemeta = this._snapshot.getExpanded(this._snapshot.data['base']['name']);
        let basename = basemeta['name'];
-       let buildWorkdir = this.subworkdir.get_child('build-' + basemeta['name'] + '-' + architecture);
+       let buildWorkdir = Gio.File.new_for_path('build-' + basemeta['name'] + '-' + architecture);
         let checkoutdir = buildWorkdir.get_child(basemeta['name']);
         let builddirName = Format.vprintf('build-%s-%s', [basename, architecture]);
         let builddir = this.workdir.get_child(builddirName);
@@ -1015,8 +1015,6 @@ const TaskBuild = new Lang.Class({
     },
 
     execute: function(cancellable) {
-       this.subworkdir = Gio.File.new_for_path('.');
-
         this.forceBuildComponents = {};
        for (let i = 0; i < this.parameters.forceComponents.length; i++)
            this.forceBuildComponents[this.parameters.forceComponents[i]] = true;
@@ -1025,7 +1023,7 @@ const TaskBuild = new Lang.Class({
        let snapshotDir = this.workdir.get_child('snapshots');
        let srcdb = new JsonDB.JsonDB(snapshotDir);
        let snapshotPath = srcdb.getLatestPath();
-       let workingSnapshotPath = this.subworkdir.get_child(snapshotPath.get_basename());
+       let workingSnapshotPath = Gio.File.new_for_path(snapshotPath.get_basename());
        GSystem.file_linkcopy(snapshotPath, workingSnapshotPath, Gio.FileCopyFlags.OVERWRITE,
                              cancellable);
        let data = srcdb.loadFromPath(workingSnapshotPath, cancellable);
diff --git a/src/js/tasks/task-builddisks.js b/src/js/tasks/task-builddisks.js
index beab37d..937162f 100644
--- a/src/js/tasks/task-builddisks.js
+++ b/src/js/tasks/task-builddisks.js
@@ -52,8 +52,6 @@ const TaskBuildDisks = new Lang.Class({
     _onlyTreeSuffixes: ['-runtime'],
 
     execute: function(cancellable) {
-        let subworkdir = Gio.File.new_for_path('.');
-
              let baseImageDir = this.workdir.resolve_relative_path(this._imageSubdir);
         let baseImageVersionedDir = new VersionedDir.VersionedDir(baseImageDir, this._VERSION_RE);
         GSystem.file_ensure_directory(baseImageDir, true, cancellable);
@@ -73,7 +71,7 @@ const TaskBuildDisks = new Lang.Class({
             return;
         }
 
-        let workImageDir = subworkdir.get_child('images');
+        let workImageDir = Gio.File.new_for_path('images');
         GSystem.file_ensure_directory(workImageDir, true, cancellable);
 
         let destPath = workImageDir.get_child('build-' + buildVersion + '.json');
@@ -105,7 +103,7 @@ const TaskBuildDisks = new Lang.Class({
             } else {
                 LibQA.createDisk(diskPath, cancellable);
             }
-            let mntdir = subworkdir.get_child('mnt-' + squashedName);
+            let mntdir = Gio.File.new_for_path('mnt-' + squashedName);
             GSystem.file_ensure_directory(mntdir, true, cancellable);
             let gfmnt = new GuestFish.GuestMount(diskPath, { partitionOpts: LibQA.DEFAULT_GF_PARTITION_OPTS,
                                                              readWrite: true });
@@ -121,7 +119,7 @@ const TaskBuildDisks = new Lang.Class({
             } finally {
                 gfmnt.umount(cancellable);
             }
-            LibQA.bootloaderInstall(diskPath, subworkdir, osname, cancellable);
+            LibQA.bootloaderInstall(diskPath, Gio.File.new_for_path, osname, cancellable);
             print("Bootloader installation complete");
 
             this._postDiskCreation(diskPath, cancellable);


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