Skip to content

Commit

Permalink
chore(lint): fix pylint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
abn committed Nov 8, 2024
1 parent b356581 commit 81f3765
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/tito/builder/submodule_aware_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,12 @@ def create_tgz(self, git_root, prefix, commit, relative_dir, dest_tgz):
timestamp = get_commit_timestamp(commit)

# Accommodate standalone projects with specfile in root of git repo:
relative_git_dir = "%s" % relative_dir
relative_git_dir = str(relative_dir)
if relative_git_dir in ["/", "./"]:
relative_git_dir = ""

basename = os.path.splitext(dest_tgz)[0]
initial_tar = "%s.initial" % basename
initial_tar = "{0}.initial".format(basename)

# We need to tar up the following:
# 1. the current repo
Expand All @@ -166,11 +166,11 @@ def create_tgz(self, git_root, prefix, commit, relative_dir, dest_tgz):
# 2. all of the submodules
# then combine those into a single archive.
for submodule_tar_file in self._submodule_archives(
relative_git_dir, prefix, commit, initial_tar
relative_git_dir, prefix, initial_tar
):
run_command("tar -Af %s %s" % (initial_tar, submodule_tar_file))
run_command("tar -Af {0} {1}".format(initial_tar, submodule_tar_file))

fixed_tar = "%s.tar" % basename
fixed_tar = "{0}.tar".format(basename)
fixed_tar_fh = open(fixed_tar, "wb")
try:
tarfixer = TarFixer(
Expand All @@ -181,4 +181,4 @@ def create_tgz(self, git_root, prefix, commit, relative_dir, dest_tgz):
fixed_tar_fh.close()

# It's a pity we can't use Python's gzip, but it doesn't offer an equivalent of -n
return run_command("gzip -n -c < %s > %s" % (fixed_tar, dest_tgz))
return run_command("gzip -n -c < {0} > {1}".format(fixed_tar, dest_tgz))

0 comments on commit 81f3765

Please sign in to comment.