mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-05 15:00:30 +03:00
Generate gpg signatures for apks in archive repo also
This commit is contained in:
parent
b1192f7b66
commit
693cb7ce70
1 changed files with 22 additions and 18 deletions
|
|
@ -44,28 +44,32 @@ def main():
|
||||||
|
|
||||||
config = common.read_config(options)
|
config = common.read_config(options)
|
||||||
|
|
||||||
output_dir = 'repo'
|
repodirs = ['repo']
|
||||||
if not os.path.isdir(output_dir):
|
if config['archive_older'] != 0:
|
||||||
logging.error("Missing output directory")
|
repodirs.append('archive')
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
# Process any apks that are waiting to be signed...
|
for output_dir in repodirs:
|
||||||
for apkfile in sorted(glob.glob(os.path.join(output_dir, '*.apk'))):
|
if not os.path.isdir(output_dir):
|
||||||
|
logging.error("Missing output directory '" + output_dir + "'")
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
apkfilename = os.path.basename(apkfile)
|
# Process any apks that are waiting to be signed...
|
||||||
sigfilename = apkfilename + ".asc"
|
for apkfile in sorted(glob.glob(os.path.join(output_dir, '*.apk'))):
|
||||||
sigpath = os.path.join(output_dir, sigfilename)
|
|
||||||
|
|
||||||
if not os.path.exists(sigpath):
|
apkfilename = os.path.basename(apkfile)
|
||||||
p = FDroidPopen(['gpg', '-a',
|
sigfilename = apkfilename + ".asc"
|
||||||
'--output', sigpath,
|
sigpath = os.path.join(output_dir, sigfilename)
|
||||||
'--detach-sig',
|
|
||||||
os.path.join(output_dir, apkfilename)])
|
|
||||||
if p.returncode != 0:
|
|
||||||
logging.error("Signing failed.")
|
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
logging.info('Signed ' + apkfilename)
|
if not os.path.exists(sigpath):
|
||||||
|
p = FDroidPopen(['gpg', '-a',
|
||||||
|
'--output', sigpath,
|
||||||
|
'--detach-sig',
|
||||||
|
os.path.join(output_dir, apkfilename)])
|
||||||
|
if p.returncode != 0:
|
||||||
|
logging.error("Signing failed.")
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
logging.info('Signed ' + apkfilename)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue