diff options
author | Guido Günther <agx@sigxcpu.org> | 2011-03-26 07:47:06 +0100 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2011-04-06 20:24:07 +0200 |
commit | 82e5f4d5e0c87d587bc13323ee49e70c3d03cbcd (patch) | |
tree | 3f39276082520e9a3bce26368b4ebd7c774bd599 | |
parent | ebc19c71c72c814565c35edf0099091b0527a6a1 (diff) |
git-buildpackage: Call gbp.update_submodules
before exporting a tarball or creating a separate build tree. We invoke
git-submodule with --no-fetch to not break offline operation.
-rw-r--r-- | gbp/git.py | 5 | ||||
-rwxr-xr-x | git-buildpackage | 3 |
2 files changed, 7 insertions, 1 deletions
@@ -503,7 +503,7 @@ class GitRepository(object): GitCommand("submodule", [ "add", repo_path ])() - def update_submodules(self, init=True, recursive=True): + def update_submodules(self, init=True, recursive=True, fetch=False): """Update all submodules""" if not self.has_submodules(): return @@ -512,6 +512,9 @@ class GitRepository(object): args.append("--recursive") if init: args.append("--init") + if not fetch: + args.append("--no-fetch") + GitCommand("submodule", args)() diff --git a/git-buildpackage b/git-buildpackage index 181405f1..48e3fc1e 100755 --- a/git-buildpackage +++ b/git-buildpackage @@ -106,6 +106,7 @@ def git_archive(repo, cp, output_dir, treeish, comp_type, comp_level): try: if repo.has_submodules(): + repo.update_submodules() git_archive_submodules(repo, treeish, output, prefix, comp_type, comp_level, comp_opts) @@ -140,6 +141,8 @@ def dump_tree(repo, export_dir, treeish): if ret: raise GbpError, "Error in dump_tree archive pipe" + if repo.has_submodules(): + repo.update_submodules() for (subdir, commit) in repo.get_submodules(treeish): gbp.log.info("Processing submodule %s (%s)" % (subdir, commit[0:8])) tarpath = [subdir, subdir[2:]][subdir.startswith("./")] |