@@ -152,12 +152,12 @@ def create_tgz(self, git_root, prefix, commit, relative_dir, dest_tgz):
152
152
timestamp = get_commit_timestamp (commit )
153
153
154
154
# Accommodate standalone projects with specfile in root of git repo:
155
- relative_git_dir = "%s" % relative_dir
155
+ relative_git_dir = str ( relative_dir )
156
156
if relative_git_dir in ["/" , "./" ]:
157
157
relative_git_dir = ""
158
158
159
159
basename = os .path .splitext (dest_tgz )[0 ]
160
- initial_tar = "%s .initial" % basename
160
+ initial_tar = f" { basename } .initial"
161
161
162
162
# We need to tar up the following:
163
163
# 1. the current repo
@@ -166,11 +166,11 @@ def create_tgz(self, git_root, prefix, commit, relative_dir, dest_tgz):
166
166
# 2. all of the submodules
167
167
# then combine those into a single archive.
168
168
for submodule_tar_file in self ._submodule_archives (
169
- relative_git_dir , prefix , commit , initial_tar
169
+ relative_git_dir , prefix , initial_tar
170
170
):
171
- run_command ("tar -Af %s %s" % ( initial_tar , submodule_tar_file ) )
171
+ run_command (f "tar -Af { initial_tar } { submodule_tar_file } " )
172
172
173
- fixed_tar = "%s .tar" % basename
173
+ fixed_tar = f" { basename } .tar"
174
174
fixed_tar_fh = open (fixed_tar , "wb" )
175
175
try :
176
176
tarfixer = TarFixer (
@@ -181,4 +181,4 @@ def create_tgz(self, git_root, prefix, commit, relative_dir, dest_tgz):
181
181
fixed_tar_fh .close ()
182
182
183
183
# It's a pity we can't use Python's gzip, but it doesn't offer an equivalent of -n
184
- return run_command ("gzip -n -c < %s > %s" % ( fixed_tar , dest_tgz ) )
184
+ return run_command (f "gzip -n -c < { fixed_tar } > { dest_tgz } " )
0 commit comments