Merge branch 'bug-fixes-for-v0.2.1' of https://gitlab.com/eighthave/fdroidserver

This commit is contained in:
Daniel Martí 2014-07-01 18:13:00 +02:00
commit 1a1bdfc3d9
6 changed files with 45 additions and 24 deletions

View file

@ -61,11 +61,11 @@ def get_default_config():
'repo_url': "https://MyFirstFDroidRepo.org/fdroid/repo",
'repo_name': "My First FDroid Repo Demo",
'repo_icon': "fdroid-icon.png",
'repo_description':
'repo_description': (
"This is a repository of apps to be used with FDroid. Applications in this "
"repository are either official binaries built by the original application "
"developers, or are binaries built from source by the admin of f-droid.org "
"using the tools on https://gitlab.com/u/fdroid.",
+ "repository are either official binaries built by the original application "
+ "developers, or are binaries built from source by the admin of f-droid.org "
+ "using the tools on https://gitlab.com/u/fdroid."),
'archive_older': 0,
}
@ -121,6 +121,9 @@ def read_config(opts, config_file='config.py'):
if not test_sdk_exists(config):
sys.exit(3)
if not test_build_tools_exists(config):
sys.exit(3)
for k in ["keystorepass", "keypass"]:
if k in config:
write_password_file(k)
@ -151,9 +154,6 @@ def test_sdk_exists(c):
if not os.path.isdir(os.path.join(c['sdk_path'], 'build-tools')):
logging.critical('Android SDK path "' + c['sdk_path'] + '" does not contain "build-tools/"!')
return False
if not os.path.isdir(os.path.join(c['sdk_path'], 'build-tools', c['build_tools'])):
logging.critical('Configured build-tools version "' + c['build_tools'] + '" not found in the SDK!')
return False
return True

View file

@ -157,9 +157,9 @@ def _local_sync(fromdir, todir):
def sync_from_localcopy(repo_section, local_copy_dir):
logging.info('Syncing from local_copy_dir to this repo.')
# trailing slashes have a meaning in rsync which is not needed here, so
# remove them all
_local_sync(os.path.join(local_copy_dir, repo_section).rstrip('/'),
repo_section.rstrip('/'))
# make sure both paths have exactly one trailing slash
_local_sync(os.path.join(local_copy_dir, repo_section).rstrip('/') + '/',
repo_section.rstrip('/') + '/')
def update_localcopy(repo_section, local_copy_dir):

View file

@ -876,11 +876,11 @@ def archive_old_apks(apps, apks, archapks, repodir, archivedir, defaultkeepversi
if 'srcname' in apk:
shutil.move(os.path.join(repodir, apk['srcname']),
os.path.join(archivedir, apk['srcname']))
# Move GPG signature too...
sigfile = apk['srcname'] + '.asc'
sigsrc = os.path.join(repodir, sigfile)
if os.path.exists(sigsrc):
shutil.move(sigsrc, os.path.join(archivedir, sigfile))
# Move GPG signature too...
sigfile = apk['srcname'] + '.asc'
sigsrc = os.path.join(repodir, sigfile)
if os.path.exists(sigsrc):
shutil.move(sigsrc, os.path.join(archivedir, sigfile))
archapks.append(apk)
apks.remove(apk)
@ -933,6 +933,13 @@ def main():
resize_all_icons(repodirs)
sys.exit(0)
# check that icons exist now, rather than fail at the end of `fdroid update`
for k in ['repo_icon', 'archive_icon']:
if k in config:
if not os.path.exists(config[k]):
logging.error(k + ' "' + config[k] + '" does not exist! Correct it in config.py.')
sys.exit(1)
# Get all apps...
apps = metadata.read_metadata()