common/buildpackage: use GitRepository for submodules
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>
Thu, 12 Sep 2013 10:30:36 +0000 (13:30 +0300)
committerMarkus Lehtonen <markus.lehtonen@linux.intel.com>
Fri, 14 Nov 2014 12:22:01 +0000 (14:22 +0200)
Initialize a GitRepository object for each submodule in
git_archive_submodules().

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
gbp/scripts/common/buildpackage.py

index 41c50ca..56e4cb0 100644 (file)
@@ -74,10 +74,11 @@ def git_archive_submodules(repo, treeish, output, prefix, comp_type, comp_level,
         # generate each submodule's arhive and append it to the main archive
         for (subdir, commit) in repo.get_submodules(treeish):
             tarpath = [subdir, subdir[2:]][subdir.startswith("./")]
+            subrepo = GitRepository(os.path.join(repo.path, subdir))
 
             gbp.log.debug("Processing submodule %s (%s)" % (subdir, commit[0:8]))
-            repo.archive(format=format, prefix='%s%s/' % (prefix, tarpath),
-                         output=submodule_archive, treeish=commit, cwd=subdir)
+            subrepo.archive(format=format, prefix='%s%s/' % (prefix, tarpath),
+                            output=submodule_archive, treeish=commit)
             if format == 'tar':
                 CatenateTarArchive(main_archive)(submodule_archive)
             elif format == 'zip':