[gnome-ostree] vcs: Make submodule processing on checkout fully recursive



commit 1aa880730de0af88e7e3ae2f58ce9ab651b3fbc5
Author: Colin Walters <walters verbum org>
Date:   Thu Mar 21 19:00:52 2013 -0400

    vcs: Make submodule processing on checkout fully recursive
    
    Since spice -> spice-common -> spice-protocol.

 src/js/vcs.js |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)
---
diff --git a/src/js/vcs.js b/src/js/vcs.js
index bb13e86..702dc4d 100644
--- a/src/js/vcs.js
+++ b/src/js/vcs.js
@@ -43,7 +43,7 @@ function getMirrordir(mirrordir, keytype, uri, params) {
     return mirrordir.resolve_relative_path(relpath);
 }
 
-function _fixupSubmoduleReferences(mirrordir, parentUri, cwd, cancellable) {
+function _processCheckoutSubmodules(mirrordir, parentUri, cwd, cancellable) {
     let lines = ProcUtil.runSyncGetOutputLines(['git', 'submodule', 'status'],
                                               cancellable, {cwd: cwd}); 
     let haveSubmodules = false;
@@ -63,8 +63,9 @@ function _fixupSubmoduleReferences(mirrordir, parentUri, cwd, cancellable) {
         let localMirror = getMirrordir(mirrordir, 'git', subUrl);
        ProcUtil.runSync(['git', 'config', configKey, 'file://' + localMirror.get_path()],
                         cancellable, {cwd:cwd});
+        ProcUtil.runSync(['git', 'submodule', 'update', '--init', subName], cancellable, {cwd: cwd});
+       _processCheckoutSubmodules(mirrordir, subUrl, cwd.get_child(subName), cancellable);
     }
-    return haveSubmodules;
 }
 
 function getVcsCheckout(mirrordir, component, dest, cancellable, params) {
@@ -110,10 +111,7 @@ function getVcsCheckout(mirrordir, component, dest, cancellable, params) {
         ProcUtil.runSync(['git', 'fetch', 'localmirror'], cancellable, {cwd: tmpDest});
     }
     ProcUtil.runSync(['git', 'checkout', '-q', revision], cancellable, {cwd: tmpDest});
-    let haveSubmodules = _fixupSubmoduleReferences(mirrordir, uri, tmpDest, cancellable);
-    if (haveSubmodules) {
-        ProcUtil.runSync(['git', 'submodule', 'update', '--init'], cancellable, {cwd: tmpDest});
-    }
+    _processCheckoutSubmodules(mirrordir, uri, tmpDest, cancellable);
     if (!tmpDest.equal(dest)) {
         GSystem.file_rename(tmpDest, dest, cancellable);
     }


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