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

8639 Commits

Author SHA1 Message Date
Daniel Martí
b07e6c343c checkupdates: log vercode operation activity 2015-09-09 10:26:33 -07:00
Daniel Martí
2fe0327beb checkupdates: don't auto update to older versions
If for whatever reason the update check results in an older version that we
didn't package, don't "update" to that version if we already packaged newer
versions.
2015-09-09 09:27:18 -07:00
Ciaran Gultnieks
803a3ebbac Make builds work after 04e6f2eb and 120be433 2015-09-09 11:50:32 +00:00
Daniel Martí
664f6e4adb manual: Don't reuse scanignore doc in scandelete 2015-09-08 15:36:18 -07:00
Daniel Martí
a782a615c6 manual: be explicit about what scandelete does 2015-09-08 15:23:45 -07:00
Ciaran Gultnieks
0f4d26c2ed Merge branch 'master' of https://gitlab.com/fdroid/fdroidserver 2015-09-08 21:00:31 +00:00
Daniel Martí
29dea4aad5 lint: Warn about links left off from old sites 2015-09-08 13:33:43 -07:00
Daniel Martí
03deda914f checkupdates improvements for gradle projects
* Let the package name override the one found in AndroidManifest.xml
* Support the newer applicationId
2015-09-08 13:12:28 -07:00
Ciaran Gultnieks
131487f214 Add python-yaml to buildserver 2015-09-08 09:54:21 +00:00
nero-tux
d23ecf1b35 replace deprecated optparse with argparse
following guidelines from:
https://docs.python.org/2/library/argparse.html#upgrading-optparse-code
except, still using option = parse.parse_args() instead of args = ...

- using the following script in folder fdroidserver:
	for i in *.py; do
		sed -i -e 's/optparse/argparse/' \
			-e 's/OptionParser/ArgumentParser/' \
			-e 's/OptionError/ArgumentError/' \
			-e 's/add_option/add_argument/' \
			-e 's/(options, args) = parser/options = parser/' \
			-e 's/options, args = parser/options = parser/' \
			-e 's/Usage: %prog/%(prog)s/' $i;
	done
- use ArgumentParser argument to replace (option, args) = parser.parse()
  call
- use parser.error(msg) instead of raise ArgumentException as suggested
  in https://docs.python.org/2/library/argparse.html#exiting-methods
- in fdroid catch ArgumentError instead of OptionError
2015-09-06 10:34:50 +02:00
Daniel Martí
41443edd55 Bump build-tools 2015-09-05 23:02:03 -04:00
Daniel Martí
f4e96cfd7a Specify that disabled builds aren't failing builds 2015-09-05 10:10:48 -04:00
Daniel Martí
de1c599127 Fix regression introduced in 2831b3e93
An empty list of antifeatures should not be written.
2015-09-05 10:10:37 -04:00
Daniel Martí
f70d74e3e8 End sentence spacing madness in sample config 2015-09-03 22:06:43 -07:00
Daniel Martí
60aea2ca1e Simplify markdown code blocks 2015-09-03 21:51:37 -07:00
Daniel Martí
9eef437bca completion: set up _fdroid_* funcs at load time
This fixes an issue where these functions would not be created until fdroid
was completed at least once.
2015-09-02 21:23:08 -07:00
Daniel Martí
f23011f408 CI: set up all SDK components in PATH 2015-09-01 21:12:41 -07:00
Daniel Martí
0b0197dba3 Merge branch 'ci-split-packages' into 'master'
CI: Split up package installing

Advantages:
* Easier to tell why we need each package
* apt-get install output is less scary/huge
* CI job is split in more, smaller steps easier to debug

See merge request !72
2015-09-01 22:42:10 +00:00
Daniel Martí
91f36acaa6 Even examples/config.py with default_config 2015-09-01 15:30:41 -07:00
Daniel Martí
c633b21f6c CI: Split up package installing
Advantages:
* Easier to tell why we need each package
* apt-get install output is less scary/huge
* CI job is split in more, smaller steps easier to debug
2015-09-01 15:23:06 -07:00
Daniel Martí
96bcd1c77d Merge branch 'fix-pillow-gitlab-ci' into 'master'
install build dependencies for Pillow

When Pillow is installed with pip, it needs to compile the C code against a few libraries, like libjpeg.  Pillow is included in Debian/Ubuntu as 'python-imaging', so just install the build
dependencies of that, and it should all be golden.

See merge request !71
2015-09-01 22:02:54 +00:00
Hans-Christoph Steiner
9855d4089c install build dependencies for Pillow
When Pillow is installed with pip, it needs to compile the C code
against a few libraries, like libjpeg.  This also adds python-git
as a dep.
2015-09-01 23:48:28 +02:00
Daniel Martí
88dcc9d272 CI: add missing python-virtualenv package 2015-09-01 11:34:04 -07:00
Daniel Martí
6f05529dac Merge branch 'fdroid-version' into 'master'
fdroid --version and shared tests between gitlab and jenkins

This adds a `fdroid --version` flag for people to easily see the exact version of fdroidserver in use.  It'll also report the version using `git describe` when running from git.

The other moves the extended tests out of `./jenkins-build` into a common script for both gitlab-ci and jenkins.

See merge request !70
2015-09-01 18:27:55 +00:00
Hans-Christoph Steiner
f87b17139b pep8: on *.TestCase, skip "E402 module level import not at top of file"
The tests use a little hack in order to cleanly import the fdroidserver
package locally like a regular package.  pep8 doesn't see that, so this
changes the pep8 to skip E402 on *.TestCase
2015-09-01 20:10:01 +02:00
Hans-Christoph Steiner
242e9d2fb9 gitlab-ci: install all android packages at once
the `android` utility is pretty stupid, it doesn't really cache the
package index info.  So each time it is run, it tries to fetch the
indexes from the network.  This combines all android package installs
to a single command to make things run quicker.
2015-09-01 19:57:40 +02:00
Hans-Christoph Steiner
e6c0be8898 move tests into common script for jenkins and gitlab-ci 2015-09-01 19:52:37 +02:00
Hans-Christoph Steiner
3fc2a99d71 fdroid --version for installed releases and running from git
This will report the version embedded in the module if it is installed, and
will report `git describe` if being run from git.  If someone installs from
git using pip, this will probably report the version in setup.py, which
will be wrong.  But that is not a documented install method, and I haven't
heard of anyone using it.  The recommended way is to run straight from git.
2015-09-01 19:45:00 +02:00
Daniel Martí
4a4bb3e7a5 CI: Add missing yaml dependency 2015-09-01 10:42:16 -07:00
Daniel Martí
ca8ab7675d Merge branch 'support-xml-json-yaml-for-metadata' into 'master'
Support XML, JSON, and YAML for metadata

Add support for app metadata files in JSON, XML, and YAML data formats.  All of the formats use the exact same metadata tags, so there is no translation layer needed.  They all just parse the data into the same internal data format: Python dicts.  Supporting these standard formats will make it much easier for people to write recipes since they can choose a data format that they are familiar with.  It also makes it much easier to generate metadata programmatically, since there are good libraries for working with all three formats in basically every language (unlike FDroid's .txt format).

Here are the same tags in .txt, JSON, XML, and YAML:

    Source Code:https://github.com/SMSSecure/SMSSecure
    "Source Code": "https://github.com/SMSSecure/SMSSecure",
    <string name="Source Code">https://github.com/SMSSecure/SMSSecure</string>
    Source Code: https://github.com/SMSSecure/SMSSecure

Looking for comments, suggestions, flames, etc. from @CiaranG, @mvdan, and everyone else.

See merge request !57
2015-09-01 17:29:11 +00:00
Daniel Martí
64baa558bf Merge branch 'liblzma' into 'master'
Add liblzma-dev to buildserver

Ref:https://gitlab.com/fdroid/fdroiddata/merge_requests/954/

See merge request !69
2015-09-01 17:28:06 +00:00
Hans-Christoph Steiner
325db90918 set "accepted formats" for metadata in config.py
For a bit repo like f-droid.org, it makes sense to standardize on a single
format for metadata files.  This adds support for enforcing a single data
format, or a reduced set of data formats.  So f-droid.org would run like
this if it changed to YAML:

  accepted_formats = ['txt', 'yaml']

Then once everything was converted to YAML, it could look like this:

  accepted_formats = ['yaml']
2015-09-01 11:53:37 +02:00
Hans-Christoph Steiner
19ac44c189 rewritemeta only applies to the original .txt metadata format 2015-09-01 11:53:37 +02:00
Hans-Christoph Steiner
6c44bff78b make note of JSON, XML, and YAML in the manual 2015-09-01 11:53:37 +02:00
Hans-Christoph Steiner
beb217b6ae add 'gradleprops' to .pickle files for the metadata tests 2015-09-01 11:53:37 +02:00
Hans-Christoph Steiner
8d6e0aebb9 exit with error if duplicate metadata file is found
In order to prevent confusion caused by multiple metadata files for a given
app, fdroid will exit with an error if it finds any app metadata file with
the same package ID as one that has already been parsed.
2015-09-01 11:39:51 +02:00
Hans-Christoph Steiner
6f334558df metadata: rename metafile to metadatapath when it is a path
To keep the code clear, change the code to use separate variables for the
path to the metadata file, and for the file object of the opened metadata.
2015-09-01 11:39:51 +02:00
Hans-Christoph Steiner
285c06d156 metadata: use unified method for getting default app metadata dict
This puts process of setting up the defaults for the internal dict
that represents a parsed app into a single method that is reused for all
metadata formats.
2015-09-01 11:39:51 +02:00
Hans-Christoph Steiner
32e257d742 support app metadata in YAML format
YAML is a format that is quite similar to the .txt format, but is a
widespread standard that has editing modes in popular editors.  It is also
easily parsable in python.

The .pickle for testing is a lightly edited version of the real metadata
for org.videolan.vlc:

 * comments were removed
2015-09-01 11:39:51 +02:00
Hans-Christoph Steiner
0b62e7f22a set appid in get_default_app_info_list() 2015-09-01 11:39:51 +02:00
Hans-Christoph Steiner
0425788b7d consolidate all post-parse metadata checks
This puts all of the needed post parsing checks on the metadata into a
single method that is used by all parsing methods (.txt, JSON, XML, YAML).
This provides the single place to normalize the internal representation of
the metadata.

It would be good to also change the internal representation to use more Python
bool/int types so that less post parsing is needed for JSON, XML, and YAML.

The SMSSecure test .pickle was changed to account for the use of lstrip()
and rstrip() on all 'script' types.

This also changes the example JSON to use ints for versionCodes
2015-09-01 11:39:51 +02:00
Hans-Christoph Steiner
014df8426f eliminate Boolean metadata type, only 'bool' is needed
No need for a specific metadata type for 'Requires Root'.  Just use 'bool',
then convert on output.  This keeps the internal representation consistent
since all boolean-ish values will be Python bools.  This in turn makes
parsing metadata in various formats easier.  This also makes setting
booleans more tolerant since all these values are valid:

 Yes yes No no True true False false
2015-09-01 11:39:51 +02:00
Hans-Christoph Steiner
ab145de6bc support app metadata in XML format
While the current text metadata format is good for human readability and
editability, it is difficult to produce and parse using code.  XML is a
widespread standard format for easy automatic parsing and creating, while
having decent human readability.

The .pickle for testing is a lightly edited version of the real metadata
for net.osmand.plus:

* comments were removed
* "NonFreeNet" was added as an AntiFeature
2015-09-01 11:39:51 +02:00
Hans-Christoph Steiner
2831b3e93f convert internal representation of AntiFeatures to list
The AntiFeatures metadata is a comma-separated list of tags, like
Categories, so it should also be stored internally as a list.  This makes
parsing XML and JSON easier.

The test cases' .pickle files look like they change a lot, but they really
don't, its only the change of default AntiFeatures value from None to []
2015-09-01 11:39:51 +02:00
Hans-Christoph Steiner
cc29d39f0a metadata: store comments in lists since lists are used everywhere else
The only data produced by parsing metadata that was stored as a tuple was
the comments' key/values.  Everywhere else, lists are used.  This changes
the comments to also only use lists to keep the data consistent internally.
That makes it vastly easier to produce the exact same metadata dict when
parsing .txt, JSON, XML, etc.
2015-09-01 11:39:51 +02:00
Hans-Christoph Steiner
dabb7e42b7 add test case for JSON parsing, based on parsed .txt metadata
The .pickle was created by dumping the output from parsing the current .txt
metadata for org.adaway.  The JSON started from that pickle dump, but was
then hand edited to be more proper JSON, e.g. using boolean values.
2015-09-01 11:39:51 +02:00
Hans-Christoph Steiner
61f6be1a7b in JSON metadata, convert unicode to str to match the internal format
fdroidserver currently uses plain python 2.x strings rather than unicode
strings, so the parsed JSON should produce the same format as the parsed
.txt metadata.
2015-09-01 11:39:51 +02:00
Hans-Christoph Steiner
1bbae4cd9e add test for metadata parsing based on a parse output to a pickle
This is a test to cover future modifications of the .txt metadata parsing.
The pickle file was generated by just dumping the current parsed metadata,
so this test will always succeed if the parsing is not changed.
2015-09-01 11:39:50 +02:00
Hans-Christoph Steiner
eeb8ba02b0 move metadata post-parse processing to reusable function 2015-09-01 11:39:50 +02:00
Hans-Christoph Steiner
9e5dd19fc8 add test files to pre-commit hook and fix pep8 errors 2015-09-01 11:39:50 +02:00