Package: gitpkg
Version: 0.23
Severity: normal
Tags: patch

When a git repository has submodules, the content of the submodules won't be
included in the source tarball. That's because git archive does not include
the submodules. You need to call git archive for every submodules. A patch
that does this is attached and tested with git repositories with and without
submodules.
diff --git a/gitpkg b/gitpkg
index ee04876..f7e41f0 100755
--- a/gitpkg
+++ b/gitpkg
@@ -470,6 +470,10 @@ export_debian_tree()
 	tar xf -
     ) || exit 1
 
+    # export git submodules if they exists
+    FULL_DEB_DIR="$(readlink -fm "$DEB_DIR")"
+    git submodule --quiet foreach --recursive "git archive --format=tar \$sha1 | tar xf - -C $FULL_DEB_DIR/gitpkg-${1}/\$path"
+
     # We don't do this from the subshell so that it's still visible to EXIT_HOOK
     [ -n "$PRE_EXPORT_HOOK" ] || get_deb_version "$DEB_DIR/gitpkg-$1"
 

Reply via email to