1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-11-04 14:30:11 +01:00
Commit Graph

7975 Commits

Author SHA1 Message Date
Gregor Düster
337974cbed
metadata: Make ArchivePolicy an interger internally 2023-05-30 23:02:34 +02:00
Michael Pöhn
cf887583c0 Merge branch 'metadata-sort-and-refactor' into 'master'
metadata: remove obsolete quirks; add sorting and removal of empty values

Closes #332

See merge request fdroid/fdroidserver!1365
2023-05-29 16:50:57 +00:00
Hans-Christoph Steiner
fac7ceffe3 metadata: remove non-values from Builds: entries 2023-05-29 16:50:28 +00:00
Hans-Christoph Steiner
689786eea4 metadata: refactor _builds_to_yaml to use dicts and _format functions
_builds_to_yaml does not use any features of the metadata.Build class, so
it can operate on plain dicts as well.  It also does not need to output
Build instances because those are converted to plain dicts when writing out
to YAML.
2023-05-29 16:50:28 +00:00
Hans-Christoph Steiner
b055559df7 metadata: remove STRING/INT conversion on output
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.
2023-05-29 16:50:28 +00:00
Hans-Christoph Steiner
1bc9b41a2b metadata: YAML 1.2 handles gradle: off now, "off" isn't a boolean
Before switching to YAML 1.2, there needed to be special handling of values
that YAML parsed as booleans.
2023-05-29 16:50:28 +00:00
Hans-Christoph Steiner
070dae1431 versionCode is an int everywhere since !1176 fixed #332 2023-05-29 16:50:28 +00:00
Hans-Christoph Steiner
e64f121c0c metadata: type conversion happens at parsing, not at writing
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.
2023-05-29 16:50:28 +00:00
Hans-Christoph Steiner
26b2cffdcc metadata: tests for converting Builds: entries for writing out
* 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.
2023-05-29 16:50:28 +00:00
Hans-Christoph Steiner
d3521d7374 metadata: case-insensitive sort for AntiFeatures Categories 2023-05-29 16:50:28 +00:00
Hans-Christoph Steiner
2efc9437ab gitlab-ci: purge stale removals from metadata_v0 job. 2023-05-29 16:50:28 +00:00
Hans-Christoph Steiner
65a1698ba3 Merge branch 'normalize-type-list-int' into 'master'
metadata: refactor parsing normalization

See merge request fdroid/fdroidserver!1359
2023-05-25 15:05:01 +00:00
Hans-Christoph Steiner
2aa0403208 metadata: handle SHA-256 values that parse as decimal ints
https://gitlab.com/fdroid/fdroidserver/-/merge_requests/1350#note_1370665635
2023-05-25 16:53:02 +02:00
Hans-Christoph Steiner
642e444cfa metadata: _normalize_type_list for TYPE_LIST quirks and errors
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.
2023-05-25 16:53:02 +02:00
Hans-Christoph Steiner
4711b632b8 metadata: _normalize_type_int to handle exceptions 2023-05-25 16:53:02 +02:00
Hans-Christoph Steiner
9f606d0fbb metadata: auto-convert YAML special float values: .nan .inf -.inf
Even for people who know what the special floats not-a-number, infinity,
and negative infinity, they don't necessarily know the YAML 1.2 syntax for
these.  I didn't.  And I've spent some quality time fighting things with
those values.  They are also easy to reliably convert to string values.
2023-05-25 16:53:02 +02:00
Hans-Christoph Steiner
8374842faa metadata: normalize TYPE_BOOL to YAML 1.2 booleans
This makes the internal representation always be a boolean, and that also
means that YAML 1.2 booleans will be written out, e.g. rewritemeta.
2023-05-25 16:53:02 +02:00
Hans-Christoph Steiner
aa98d67c86 metadata: test None in post_metadata_parse 2023-05-25 15:10:05 +02:00
Hans-Christoph Steiner
d9b1d845e7 Merge branch 'linsui-master-patch-37288' into 'master'
Fix Chinese example in doc string

See merge request fdroid/fdroidserver!1364
2023-05-25 13:06:55 +00:00
linsui
982ecb45ab Fix Chinese example in doc string 2023-05-25 13:06:45 +00:00
Michael Pöhn
7e1c63b407 Merge branch 'test-build-Prepare-only-in-VM' into 'master'
build: add test to ensure Prepare: is only run in VM

See merge request fdroid/fdroidserver!1361
2023-05-25 13:06:21 +00:00
Hans-Christoph Steiner
df7c909884 build: add test to ensure Prepare: is only run in VM 2023-05-25 13:03:25 +00:00
Michael Pöhn
65e1c81f20 Merge branch 'scanner_argument_order' into 'master'
scanner: Print all short options before long options

See merge request fdroid/fdroidserver!1363
2023-05-25 12:54:18 +00:00
Gregor Düster
fde880d780
scanner: Print all short options before long options
This is the default throughout the code base.
2023-05-25 12:33:39 +02:00
Hans-Christoph Steiner
6d8c1fb885 Merge branch 'weblate' into 'master'
weblate

See merge request fdroid/fdroidserver!1360
2023-05-24 21:10:26 +00:00
Hans-Christoph Steiner
544fa1bb4d
make -C locale update 2023-05-24 23:01:08 +02:00
Hosted Weblate
c5ef3d19cd
Update translation files
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Co-authored-by: Hosted Weblate <hosted@weblate.org>
Translate-URL: https://hosted.weblate.org/projects/f-droid/fdroidserver/
Translation: F-Droid/F-Droid Server
2023-05-24 23:01:06 +02:00
Hans-Christoph Steiner
5d85f7ad95 Merge branch 'ci-metadata_v0-RequiresRoot' into 'master'
gitlab-ci: update metadata_v0 job for RequiresRoot: as TYPE_BOOL

See merge request fdroid/fdroidserver!1362
2023-05-24 20:45:08 +00:00
Hans-Christoph Steiner
fc9afc83b8 gitlab-ci: update metadata_v0 job for RequiresRoot: as TYPE_BOOL
b0c05842d8
!1350
2023-05-24 22:36:11 +02:00
Michael Pöhn
86343cbf18 Merge branch 'antiFeatures-from-config' into 'master'
allow Anti-Features to include localized descriptions about why they were added

Closes #683

See merge request fdroid/fdroidserver!1350
2023-05-23 19:08:35 +00:00
Hans-Christoph Steiner
dbf163e03f test to check that the right Builds flag values get removed 2023-05-23 12:11:09 +02:00
Hans-Christoph Steiner
f68b77a933 use pathlib's read_text() to avoid confusin intended blocks 2023-05-23 12:06:21 +02:00
Hans-Christoph Steiner
895e0553a0 error if a YAML Anti-Feature conflicts with a localized file
https://gitlab.com/fdroid/fdroidserver/-/issues/683#note_1383597734
2023-05-23 10:47:03 +02:00
Hans-Christoph Steiner
b0c05842d8 metadata: RequiresRoot is boolean, according to docs
"Set this optional field to ‘True’ if the application requires root
privileges to be usable."
https://f-droid.org/docs/Build_Metadata_Reference/#RequiresRoot
2023-05-23 10:47:03 +02:00
Hans-Christoph Steiner
0393e46af9 metadata: handle TYPE_STRINGMAP when writing out YAML 2023-05-23 10:47:03 +02:00
Hans-Christoph Steiner
e8ab84b583 metadata: simplify _app_to_yaml()
There are some redundant checks and odd construct:
* cm.update({a: b}) --> cm[a] = b
* getattr(app, field) --> app.get(field)
2023-05-23 10:47:03 +02:00
Hans-Christoph Steiner
2cb12f9594 metadata: break out write_yaml to standalone function and add unit tests 2023-05-23 10:47:03 +02:00
Hans-Christoph Steiner
784bebfee9 metadata: keep manually added NoSourceSince in AntiFeatures
If the metadata file contains NoSourceSince:, it is added to the collection
of Anti-Features.  When rewriting the .yml file, NoSourceSince should only
be written into the AntiFeatures: collection if there are manual changes,
e.g. the user had provided translations.
2023-05-23 10:47:03 +02:00
Hans-Christoph Steiner
7c1d7fb4b3 metadata: check error messages are printed for more cases 2023-05-23 10:47:03 +02:00
Hans-Christoph Steiner
b2fc59ef9a gitlab-ci: bump version to compare in metadata_v0 job
The previous commit changes the internal representation of
antiFeatures from a list to dict.
https://gitlab.com/eighthave/fdroidserver/-/jobs/4260622978
2023-05-23 10:47:03 +02:00
Hans-Christoph Steiner
061ca38afd define "string map" type for new Anti-Features explanations
closes #683
2023-05-23 10:47:03 +02:00
Hans-Christoph Steiner
6e62ea3614 Merge branch 'scanner-allow-non-zero-exit' into 'master'
feat(scanner): Allow non-zero-exit code if problems were found

See merge request fdroid/fdroidserver!1342
2023-05-23 08:35:18 +00:00
Georg krause
9af2efda2e feat(scanner): Allow non-zero-exit code if problems were found 2023-05-23 09:54:24 +02:00
Hans-Christoph Steiner
44513c23fd Merge branch 'readme-and-contributing' into 'master'
update README and add CONTRIBUTING.md

See merge request fdroid/fdroidserver!1353
2023-05-22 14:16:43 +00:00
Hans-Christoph Steiner
a08d4a74e8 update CONTRIBUTING.md 2023-05-22 14:16:31 +00:00
Hans-Christoph Steiner
a02ed98c7e update README to fix out of date things 2023-05-22 14:16:31 +00:00
Hans-Christoph Steiner
84b45abb03 Merge branch 'last-prop' into 'master'
gradlew-fdroid: use last duplicate key like java.util.Properties

Closes #1131

See merge request fdroid/fdroidserver!1356
2023-05-22 11:35:54 +00:00
FC Stegerman
f160ae55cb
gradlew-fdroid: use last duplicate key like java.util.Properties 2023-05-19 18:12:23 +02:00
Michael Pöhn
a9b2f624e5 Merge branch 'scanner_dataclass' into 'master'
scanner: replace global dict by dataclass

See merge request fdroid/fdroidserver!1208
2023-05-12 17:58:26 +00:00
Jochen Sprickerhof
2488cb5710 scanner: replace global dict by dataclass 2023-05-12 17:58:04 +00:00