new function get_src_tarball_name; deprecates getsrcname

Some places in the code that need this, like verify.py, do not have
app and build instances, but do have appid and versionCode.  And
fdroidserver/build.py is going away.
This commit is contained in:
Hans-Christoph Steiner 2024-12-03 13:58:09 +01:00
parent 78865a7b2b
commit 56814824ee
2 changed files with 4 additions and 4 deletions

View file

@ -306,7 +306,7 @@ def build_server(app, build, vcs, build_dir, output_dir, log_dir, force):
else:
ftp.chdir(posixpath.join(homedir, 'unsigned'))
apkfile = common.get_release_filename(app, build)
tarball = common.getsrcname(app, build)
tarball = common.get_src_tarball_name(app.id, build.versionCode)
try:
ftp.get(apkfile, os.path.join(output_dir, apkfile))
if not options.notarball:
@ -619,7 +619,7 @@ def build_local(app, build, vcs, build_dir, output_dir, log_dir, srclib_dir, ext
if not options.notarball:
# Build the source tarball right before we build the release...
logging.info("Creating source tarball...")
tarname = common.getsrcname(app, build)
tarname = common.get_src_tarball_name(app.id, build.versionCode)
tarball = tarfile.open(os.path.join(tmp_dir, tarname), "w:gz")
def tarexc(t):

View file

@ -1130,8 +1130,8 @@ def get_toolsversion_logname(app, build):
return "%s_%s_toolsversion.log" % (app.id, build.versionCode)
def getsrcname(app, build):
return "%s_%s_src.tar.gz" % (app.id, build.versionCode)
def get_src_tarball_name(appid, versionCode):
return f"{appid}_{versionCode}_src.tar.gz"
def get_build_dir(app):