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

2
README
View file

@ -27,4 +27,4 @@ install:
virtualenv env/ virtualenv env/
. env/bin/activate . env/bin/activate
pip install -e . pip install -e .
python setup.py install python2 setup.py install

View file

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

View file

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

View file

@ -933,6 +933,13 @@ def main():
resize_all_icons(repodirs) resize_all_icons(repodirs)
sys.exit(0) 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... # Get all apps...
apps = metadata.read_metadata() apps = metadata.read_metadata()

View file

@ -53,17 +53,17 @@ cd $WORKSPACE/tests
#------------------------------------------------------------------------------# #------------------------------------------------------------------------------#
# test building the source tarball # test building the source tarball
cd $WORKSPACE cd $WORKSPACE
python setup.py sdist python2 setup.py sdist
#------------------------------------------------------------------------------# #------------------------------------------------------------------------------#
# test install using site packages # test install using site packages
cd $WORKSPACE cd $WORKSPACE
rm -rf $WORKSPACE/env rm -rf $WORKSPACE/env
virtualenv --system-site-packages $WORKSPACE/env virtualenv --python=python2 --system-site-packages $WORKSPACE/env
. $WORKSPACE/env/bin/activate . $WORKSPACE/env/bin/activate
pip install -e $WORKSPACE pip install -e $WORKSPACE
python setup.py install python2 setup.py install
# run tests in new pip+virtualenv install # run tests in new pip+virtualenv install
. $WORKSPACE/env/bin/activate . $WORKSPACE/env/bin/activate
@ -81,7 +81,7 @@ sh hooks/pre-commit
cd $WORKSPACE cd $WORKSPACE
set +e set +e
# use the virtualenv python so pylint checks against its installed libs # use the virtualenv python so pylint checks against its installed libs
PYTHONPATH=$WORKSPACE/.pylint-plugins python /usr/bin/pylint \ PYTHONPATH=$WORKSPACE/.pylint-plugins python2 /usr/bin/pylint \
--output-format=parseable --reports=n \ --output-format=parseable --reports=n \
--load-plugins astng_hashlib \ --load-plugins astng_hashlib \
fdroidserver/*.py fdroid makebuildserver setup.py > $WORKSPACE/pylint.parseable fdroidserver/*.py fdroid makebuildserver setup.py > $WORKSPACE/pylint.parseable

View file

@ -23,10 +23,12 @@ copy_apks_into_repo() {
set -x set -x
} }
# keep this as an old version to test the automatic parsing of build-tools
# verion numbers in `fdroid init`
create_fake_android_home() { create_fake_android_home() {
mkdir $1/build-tools mkdir $1/build-tools
mkdir $1/build-tools/20.0.0 mkdir $1/build-tools/19.0.2
touch $1/build-tools/20.0.0/aapt touch $1/build-tools/19.0.2/aapt
} }
create_test_dir() { create_test_dir() {
@ -75,12 +77,24 @@ if [ -z $aapt ]; then
aapt=`ls -1 $ANDROID_HOME/build-tools/*/aapt | sort | tail -1` aapt=`ls -1 $ANDROID_HOME/build-tools/*/aapt | sort | tail -1`
fi fi
# allow the location of python to be overridden
if [ -z $python ]; then
python=python2
fi
#------------------------------------------------------------------------------#
echo_header "run commit hooks"
cd $WORKSPACE
./hooks/pre-commit
#------------------------------------------------------------------------------# #------------------------------------------------------------------------------#
echo_header "create a source tarball and use that to build a repo" echo_header "create a source tarball and use that to build a repo"
cd $WORKSPACE cd $WORKSPACE
python setup.py sdist $python setup.py sdist
REPOROOT=`create_test_dir` REPOROOT=`create_test_dir`
cd $REPOROOT cd $REPOROOT
@ -172,7 +186,7 @@ set -e
#------------------------------------------------------------------------------# #------------------------------------------------------------------------------#
echo_header "check that fake android home passes `fdroid init`" echo_header "check that fake android home passes 'fdroid init'"
REPOROOT=`create_test_dir` REPOROOT=`create_test_dir`
FAKE_ANDROID_HOME=`create_test_dir` FAKE_ANDROID_HOME=`create_test_dir`