mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-06 07:20:29 +03:00
get_release_filename() to handle any file type, not just APKs
In order to support non-APK files that are built by `fdroid build`, this function that names the file releases needs to be generic.
This commit is contained in:
parent
ab8d51012d
commit
8ecff5bd61
2 changed files with 11 additions and 8 deletions
|
|
@ -412,7 +412,7 @@ def build_server(app, build, vcs, build_dir, output_dir, force):
|
||||||
ftp.chdir(homedir + '/tmp')
|
ftp.chdir(homedir + '/tmp')
|
||||||
else:
|
else:
|
||||||
ftp.chdir(homedir + '/unsigned')
|
ftp.chdir(homedir + '/unsigned')
|
||||||
apkfile = common.getapkname(app, build)
|
apkfile = common.get_release_filename(app, build)
|
||||||
tarball = common.getsrcname(app, build)
|
tarball = common.getsrcname(app, build)
|
||||||
try:
|
try:
|
||||||
ftp.get(apkfile, os.path.join(output_dir, apkfile))
|
ftp.get(apkfile, os.path.join(output_dir, apkfile))
|
||||||
|
|
@ -884,7 +884,7 @@ def build_local(app, build, vcs, build_dir, output_dir, srclib_dir, extlib_dir,
|
||||||
|
|
||||||
# Copy the unsigned apk to our destination directory for further
|
# Copy the unsigned apk to our destination directory for further
|
||||||
# processing (by publish.py)...
|
# processing (by publish.py)...
|
||||||
dest = os.path.join(output_dir, common.getapkname(app, build))
|
dest = os.path.join(output_dir, common.get_release_filename(app, build))
|
||||||
shutil.copyfile(src, dest)
|
shutil.copyfile(src, dest)
|
||||||
|
|
||||||
# Move the source tarball into the output directory...
|
# Move the source tarball into the output directory...
|
||||||
|
|
@ -912,17 +912,17 @@ def trybuild(app, build, build_dir, output_dir, also_check_dir, srclib_dir, extl
|
||||||
:returns: True if the build was done, False if it wasn't necessary.
|
:returns: True if the build was done, False if it wasn't necessary.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
dest_apk = common.getapkname(app, build)
|
dest_file = common.get_release_filename(app, build)
|
||||||
|
|
||||||
dest = os.path.join(output_dir, dest_apk)
|
dest = os.path.join(output_dir, dest_file)
|
||||||
dest_repo = os.path.join(repo_dir, dest_apk)
|
dest_repo = os.path.join(repo_dir, dest_file)
|
||||||
|
|
||||||
if not test:
|
if not test:
|
||||||
if os.path.exists(dest) or os.path.exists(dest_repo):
|
if os.path.exists(dest) or os.path.exists(dest_repo):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
if also_check_dir:
|
if also_check_dir:
|
||||||
dest_also = os.path.join(also_check_dir, dest_apk)
|
dest_also = os.path.join(also_check_dir, dest_file)
|
||||||
if os.path.exists(dest_also):
|
if os.path.exists(dest_also):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -459,8 +459,11 @@ def apknameinfo(filename):
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
||||||
def getapkname(app, build):
|
def get_release_filename(app, build):
|
||||||
return "%s_%s.apk" % (app.id, build.vercode)
|
if build.output:
|
||||||
|
return "%s_%s.%s" % (app.id, build.vercode, get_file_extension(build.output))
|
||||||
|
else:
|
||||||
|
return "%s_%s.apk" % (app.id, build.vercode)
|
||||||
|
|
||||||
|
|
||||||
def getsrcname(app, build):
|
def getsrcname(app, build):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue