This moves all of the serverwebroot: logic into a function, and adds tests.
I did this because I ran into issues in the logic in main():
Traceback (most recent call last):
File "/builds/eighthave/fdroidserver/fdroid", line 22, in <module>
fdroidserver.__main__.main()
File "/builds/eighthave/fdroidserver/fdroidserver/__main__.py", line 230, in main
raise e
File "/builds/eighthave/fdroidserver/fdroidserver/__main__.py", line 211, in main
mod.main()
File "/builds/eighthave/fdroidserver/fdroidserver/deploy.py", line 753, in main
s = serverwebroot.rstrip('/').split(':')
AttributeError: 'dict' object has no attribute 'rstrip'
Since update_serverwebroot() is part of the public API, this function should
work without setting `fdroidserver.deploy.options` or
`fdroidserver.deploy.config`.
FreeBSD, macOS, and others come with BSD sed, which does not support all
the things that GNU sed does. Also, BSD rmdir does not have any extended
options like --ignore-fail-on-non-empty.
Python 3.12 completely removed the builtin `distutils` module. This
commit replaces its use with the `packaging` package, which is an
external dependency, but maintained by the Python developers.
Signed-off-by: Andrew Gunnerson <accounts+gitlab@chiller3.com>
The mirrors: entry in config.yml is great for quick access and shorter
mirror lists. Now that we are adding a lot more metadata to the mirrors,
including potentially the full text of the privacy policy, having this
in its own file should make these cases easier to manage.
Before, lots of pieces of the Android SDK were required for fdroidserver to
operate, like aapt, zipalign, etc. Now, apksigner is the only requirement.
%"support APK Signature v2+"
!889
https://gitlab.com/fdroid/fdroidclient/-/issues/2619#note_1421280589
The test needed to change because the test index files contained category
definitions that were not ever used in the "copy tests/repo, generate java/gpg
keys, update, and gpgsign" test in tests/run-tests.
!1366 makes it so categories are now defined by the repo. Categories can be
defined in the config so that lint has a list of categories to enforce. This
also provides a place for localization and icons for the categories. The old
way of defining categories was just listing them in app metadata files. This
restores that way of functioning when using index-v2.
closes#1137
The bug fixed in !1370 was due to a reuse of the per app anti features
dictionary in the per version one and adding the per version anti
features into it. This was not caught by the test suite as the app
versions are processed from newest to oldest and the test data had only
anti features in the oldest version. This patch adds an anti feature to
a newest version so only those in between should not have it.
The type conversion should all happen in post_parse_yaml_metadata whenever
possible. Also, when `if` blocks end in `return`, it is clearer if no
`elif` or `else` is used.
These test cases were writing assuming they had to transform the data
format. That is no longer the case. Going forward, the parsing process
converts everything to a standardized format. That will hopefully be
enforceable by the JSON Schema in the future.
* The metadata.Builds() class initializes all possible flags, then the
flags with init values are filtered out when writing out YAML.
* TYPE_SCRIPT flags with one entry will be converted to a string.
This should reduce surprises when dealing with filenames in things like
`rm:`. So any float/int/bool value can be used directly, without quoting.
* A plain str/int/float value is interpreted as a list of one string.
* Dictionaries as values throws error.
* A set is treated like a list.