1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-11-04 22:40:12 +01:00

Merge commit 'refs/merge-requests/138' of gitorious.org:f-droid/fdroidserver

This commit is contained in:
Daniel Martí 2014-04-02 01:03:36 +02:00
commit fa37c3b2f8
5 changed files with 12 additions and 7 deletions

View File

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

@ -56,8 +56,8 @@ def genpassword():
def genkey(keystore, repo_keyalias, password, keydname):
'''generate a new keystore with a new key in it for signing repos'''
logging.info('Generating a new key in "' + keystore + '"...')
write_password_file("keystorepass", password)
write_password_file("keypass", password)
common.write_password_file("keystorepass", password)
common.write_password_file("keypass", password)
p = FDroidPopen(['keytool', '-genkey',
'-keystore', keystore, '-alias', repo_keyalias,
'-keyalg', 'RSA', '-keysize', '4096',
@ -66,12 +66,13 @@ def genkey(keystore, repo_keyalias, password, keydname):
'-storepass:file', config['keystorepassfile'],
'-keypass:file', config['keypassfile'],
'-dname', keydname])
# TODO keypass should be sent via stdin
if p.returncode != 0:
raise BuildException("Failed to generate key", p.stdout)
# now show the lovely key that was just generated
p = FDroidPopen(['keytool', '-list', '-v',
'-keystore', keystore, '-alias', repo_keyalias])
output = p.communicate(password)[0]
'-keystore', keystore, '-alias', repo_keyalias],
'-storepass:file', config['keystorepassfile'])
logging.info(output.lstrip().strip() + '\n\n')
@ -101,7 +102,7 @@ def main():
else:
# we're running straight out of the git repo
prefix = tmp
examplesdir = prefix
examplesdir = prefix + '/examples'
fdroiddir = os.getcwd()
@ -112,7 +113,8 @@ def main():
shutil.copyfile(os.path.join(examplesdir, 'config.py'), 'config.py')
os.chmod('config.py', 0o0600)
else:
logging.info('Looks like this is already an F-Droid repo, cowardly refusing to overwrite it...')
logging.warn('Looks like this is already an F-Droid repo, cowardly refusing to overwrite it...')
logging.info('Try running `fdroid init` in an empty directory.')
sys.exit()
# now that we have a local config.py, read configuration...

View File

@ -132,6 +132,7 @@ def main():
'-storepass:file', config['keystorepassfile'],
'-keypass:file', config['keypassfile'],
'-dname', config['keydname']])
# TODO keypass should be sent via stdin
if p.returncode != 0:
raise BuildException("Failed to generate key")
@ -141,6 +142,7 @@ def main():
'-keypass:file', config['keypassfile'], '-sigalg',
'MD5withRSA', '-digestalg', 'SHA1',
apkfile, keyalias])
# TODO keypass should be sent via stdin
if p.returncode != 0:
raise BuildException("Failed to sign application")

View File

@ -800,6 +800,7 @@ def make_index(apps, apks, repodir, archive, categories):
'-keypass:file', config['keypassfile'],
'-digestalg', 'SHA1', '-sigalg', 'MD5withRSA',
os.path.join(repodir, 'index.jar') , config['repo_keyalias']])
# TODO keypass should be sent via stdin
if p.returncode != 0:
logging.info("Failed to sign index")
sys.exit(1)

View File

@ -16,7 +16,7 @@ setup(name='FDroidServer',
[ 'buildserver/config.buildserver.py',
'examples/config.py',
'examples/makebs.config.py',
'fdroid-icon.png']),
'examples/fdroid-icon.png']),
],
install_requires=[
'python-magic',