Skip to content

Commit

Permalink
Fixed issue #414
Browse files Browse the repository at this point in the history
  • Loading branch information
t0fik authored and FrostyX committed Oct 4, 2022
1 parent f5d6159 commit 4f2037a
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/tito/builder/submodule_aware_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,13 @@ def _setup_sources(self):
self.spec_file = os.path.join(
self.rpmbuild_gitcopy, self.spec_file_name)

def run_git_archive(self, relative_git_dir, prefix, commit, dest_tar, subdir):
def run_git_archive(self, relative_git_dir, prefix, commit, dest_tar, subdir=None):
# command to generate a git-archive
git_archive_cmd = 'git archive --format=tar --prefix=%s/ %s:%s --output=%s' % (
prefix, commit, relative_git_dir, dest_tar)

if subdir is None:
run_command(git_archive_cmd)
return
return run_command(git_archive_cmd)

with chdir(subdir) as p:
run_command(git_archive_cmd)
Expand Down Expand Up @@ -132,7 +131,7 @@ def create_tgz(self, git_root, prefix, commit, relative_dir,
# git rev-parse <commit>:./<submodule>
rev_parse_cmd = 'git rev-parse %s:./%s' % (commit, submodule)
submodule_commit = run_command(rev_parse_cmd)
submodule_tar_file = '%s.%s' % (initial_tar, submodule)
submodule_tar_file = '%s.%s' % (initial_tar, submodule.replace("/","_"))
# prefix should be <prefix>/<submodule>
submodule_prefix = '%s/%s' % (prefix, submodule)

Expand Down

0 comments on commit 4f2037a

Please sign in to comment.