chiark / gitweb /
fdroidserver.git
8 years agoMerge branch 'fix_licence_setup' into 'master'
Daniel Martí [Wed, 16 Sep 2015 21:29:41 +0000 (21:29 +0000)]
Merge branch 'fix_licence_setup' into 'master'

Update Licence in setup.py to AGPLv3

See merge request !79

8 years agoUpdate Licence in setup.py to AGPLv3
NeroBurner [Wed, 16 Sep 2015 20:55:22 +0000 (22:55 +0200)]
Update Licence in setup.py to AGPLv3

8 years agoimport: fix import -u from fdroiddata
Daniel Martí [Tue, 15 Sep 2015 21:06:31 +0000 (14:06 -0700)]
import: fix import -u from fdroiddata

Have -u take precedence over .git checking to fix import -u being run from
fdroiddata.

8 years agoDeduplicate statsdir
Daniel Martí [Tue, 15 Sep 2015 01:13:03 +0000 (18:13 -0700)]
Deduplicate statsdir

8 years agoReplace some hard-coded paths with os.path.join
Daniel Martí [Tue, 15 Sep 2015 01:12:15 +0000 (18:12 -0700)]
Replace some hard-coded paths with os.path.join

8 years agoimport: do set root_dir if running from a repo
Daniel Martí [Tue, 15 Sep 2015 00:40:44 +0000 (17:40 -0700)]
import: do set root_dir if running from a repo

8 years agoMerge branch 'dont-use-sudo-brew' into 'master'
Daniel Martí [Mon, 14 Sep 2015 16:40:41 +0000 (16:40 +0000)]
Merge branch 'dont-use-sudo-brew' into 'master'

Don't recommend using sudo with Homebrew

Homebrew [doesn't recommend using `sudo`][1], so update the README to reflect that.

 [1]: https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/FAQ.md#why-does-homebrew-say-sudo-is-bad-

See merge request !78

8 years agoscanner: avoid checking if usual files are binary
Daniel Martí [Mon, 14 Sep 2015 05:22:03 +0000 (22:22 -0700)]
scanner: avoid checking if usual files are binary

8 years agoRewrite scanner logic
Daniel Martí [Mon, 14 Sep 2015 05:11:53 +0000 (22:11 -0700)]
Rewrite scanner logic

Initially, the scanner used libmagic which used magic numbers in the file's
content to detect what kind of file it appears to be. Since that library isn't
available on all systems, we added support for two other libraries, mimetypes
amongst them.

The issue with mimetypes is that it only uses the file's extension, not its
actual content. So this ends in variable behaviour depending on what system
you're using fdroidserver on. For example, an executable binary without
extension would be ignored if mimetypes was being used.

We now drop all libraries - mimetypes too as it depends on the system's
mime.types file - and instead check extensions ourselves. On top of that, do
a simple binary content check to find binary executables that don't have an
extension.

The new in-house code without any dependencies doesn't add any new checks, so
no builds should break. The current checks still work:

 % fdroid scanner app.openconnect:1029
[...]
Found executable binary at assets/raw/armeabi/curl
Found executable binary at assets/raw/mips/curl
Found executable binary at assets/raw/x86/curl
Found JAR file at lib/XposedBridgeApi-54.jar
Found JAR file at libs/acra-4.5.0.jar
Found JAR file at libs/openconnect-wrapper.jar
Found JAR file at libs/stoken-wrapper.jar
Found shared library at libs/armeabi/libopenconnect.so
Found shared library at libs/armeabi/libstoken.so
Found shared library at libs/mips/libopenconnect.so
Found shared library at libs/mips/libstoken.so
Found shared library at libs/x86/libopenconnect.so
Found shared library at libs/x86/libstoken.so

8 years agoscanner: support apps using srclib repo type
Daniel Martí [Mon, 14 Sep 2015 05:05:41 +0000 (22:05 -0700)]
scanner: support apps using srclib repo type

8 years agoDon't recommend using sudo with Homebrew
Alex Jordan [Sun, 13 Sep 2015 21:53:34 +0000 (14:53 -0700)]
Don't recommend using sudo with Homebrew

8 years agoall: deduplicate -v/-q setup
Daniel Martí [Sat, 12 Sep 2015 06:42:50 +0000 (23:42 -0700)]
all: deduplicate -v/-q setup

8 years agolint: small cleanup
Daniel Martí [Sat, 12 Sep 2015 06:35:32 +0000 (23:35 -0700)]
lint: small cleanup

8 years agolint: catch more duplicate links
Daniel Martí [Sat, 12 Sep 2015 06:30:59 +0000 (23:30 -0700)]
lint: catch more duplicate links

8 years agocheckupdates: Avoid variable/string names as CV
Daniel Martí [Sat, 12 Sep 2015 06:17:46 +0000 (23:17 -0700)]
checkupdates: Avoid variable/string names as CV

8 years agoAllow slashes in tags
Daniel Martí [Sat, 12 Sep 2015 06:17:14 +0000 (23:17 -0700)]
Allow slashes in tags

The wikipedia app uses them, for example.

8 years agometadata: don't break words nor on hyphens
Daniel Martí [Sat, 12 Sep 2015 05:52:50 +0000 (22:52 -0700)]
metadata: don't break words nor on hyphens

8 years agolint: add dumb support for multiline links
Daniel Martí [Sat, 12 Sep 2015 05:40:16 +0000 (22:40 -0700)]
lint: add dumb support for multiline links

8 years agolint: move regex closer to usage
Daniel Martí [Sat, 12 Sep 2015 05:07:51 +0000 (22:07 -0700)]
lint: move regex closer to usage

8 years agometadata: allow links spanning multiple lines
Daniel Martí [Sat, 12 Sep 2015 05:07:20 +0000 (22:07 -0700)]
metadata: allow links spanning multiple lines

This allows for nicer text wrapping.

8 years agolint: remove now obsolete description checks
Daniel Martí [Sat, 12 Sep 2015 04:53:27 +0000 (21:53 -0700)]
lint: remove now obsolete description checks

8 years agoWrap descriptions to 80 chars
Daniel Martí [Sat, 12 Sep 2015 04:36:18 +0000 (21:36 -0700)]
Wrap descriptions to 80 chars

8 years agometadata: rewrite multiline field writing
Daniel Martí [Sat, 12 Sep 2015 02:12:51 +0000 (19:12 -0700)]
metadata: rewrite multiline field writing

Now description text wrapping can be added.

8 years agoEnsure that builds are always sorted when writing
Daniel Martí [Sat, 12 Sep 2015 01:19:51 +0000 (18:19 -0700)]
Ensure that builds are always sorted when writing

This might not be true if builds are appended by e.g. checkupdates --auto.
This ensures that we sort them again before writing.

8 years agolint: overhaul, cleaner and saner output
Daniel Martí [Fri, 11 Sep 2015 01:41:10 +0000 (18:41 -0700)]
lint: overhaul, cleaner and saner output

8 years agolint: move lastbuild into separate function
Daniel Martí [Fri, 11 Sep 2015 00:55:09 +0000 (17:55 -0700)]
lint: move lastbuild into separate function

8 years agolint: remove "no recommended build" check
Daniel Martí [Fri, 11 Sep 2015 00:54:27 +0000 (17:54 -0700)]
lint: remove "no recommended build" check

In some cases we do want to not recommend any version. The client should more
or less gracefully handle this.

8 years agoMerge branch 'import-tweaks-and-tests' into 'master'
Daniel Martí [Fri, 11 Sep 2015 00:23:42 +0000 (00:23 +0000)]
Merge branch 'import-tweaks-and-tests' into 'master'

Import tweaks and tests

This makes the code for `fdroid import` a bit more flexible and adds tests for the first time.  It also comments out options in `examples/config.py` that just mirror the defaults to make it clear that they are defaults, and help illustrate other options (this is standard procedure in default config files).

More details in the commit messages.

See merge request !76

8 years agolint: cleanup, remove stale sites
Daniel Martí [Thu, 10 Sep 2015 23:34:26 +0000 (16:34 -0700)]
lint: cleanup, remove stale sites

8 years agocomment out things that are default values in examples/config.py
Hans-Christoph Steiner [Thu, 27 Aug 2015 17:34:37 +0000 (19:34 +0200)]
comment out things that are default values in examples/config.py

Since these are already defaults, there is no need to set them as defaults
in the default config.

8 years agoadd a basic test of `fdroid import`
Hans-Christoph Steiner [Wed, 5 Aug 2015 22:55:16 +0000 (00:55 +0200)]
add a basic test of `fdroid import`

8 years agoimport: append .git to gitlab URLs, git sometimes freaks out otherwise
Hans-Christoph Steiner [Wed, 5 Aug 2015 19:54:25 +0000 (21:54 +0200)]
import: append .git to gitlab URLs, git sometimes freaks out otherwise

From my experience, gitlab URLs need to end in .git for git to always be
happy using them.

8 years agoimport: split out URL handling into its own function
Hans-Christoph Steiner [Wed, 5 Aug 2015 18:42:58 +0000 (20:42 +0200)]
import: split out URL handling into its own function

This is preparation to add other import methods, like checking if the
command was run in a currently checked out git repo.

8 years agoMerge branch 'replace_optparse_with_argparse' into 'master'
Daniel Martí [Thu, 10 Sep 2015 02:08:24 +0000 (02:08 +0000)]
Merge branch 'replace_optparse_with_argparse' into 'master'

replace deprecated optparse with argparse

squashed and rebased merge request fdroid/fdroidserver!74

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

See merge request !75

8 years agorewritemeta: move debug logs to logging.debug
Daniel Martí [Wed, 9 Sep 2015 20:24:18 +0000 (13:24 -0700)]
rewritemeta: move debug logs to logging.debug

8 years agocheckupdates: log vercode operation activity
Daniel Martí [Wed, 9 Sep 2015 17:26:33 +0000 (10:26 -0700)]
checkupdates: log vercode operation activity

8 years agocheckupdates: don't auto update to older versions
Daniel Martí [Wed, 9 Sep 2015 16:27:18 +0000 (09:27 -0700)]
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.

8 years agoMake builds work after 04e6f2eb and 120be433
Ciaran Gultnieks [Wed, 9 Sep 2015 11:43:17 +0000 (11:43 +0000)]
Make builds work after 04e6f2eb and 120be433

8 years agomanual: Don't reuse scanignore doc in scandelete
Daniel Martí [Tue, 8 Sep 2015 22:36:18 +0000 (15:36 -0700)]
manual: Don't reuse scanignore doc in scandelete

8 years agomanual: be explicit about what scandelete does
Daniel Martí [Tue, 8 Sep 2015 22:22:56 +0000 (15:22 -0700)]
manual: be explicit about what scandelete does

8 years agoMerge branch 'master' of https://gitlab.com/fdroid/fdroidserver
Ciaran Gultnieks [Tue, 8 Sep 2015 21:00:31 +0000 (21:00 +0000)]
Merge branch 'master' of https://gitlab.com/fdroid/fdroidserver

8 years agolint: Warn about links left off from old sites
Daniel Martí [Tue, 8 Sep 2015 20:33:43 +0000 (13:33 -0700)]
lint: Warn about links left off from old sites

8 years agocheckupdates improvements for gradle projects
Daniel Martí [Tue, 8 Sep 2015 20:12:28 +0000 (13:12 -0700)]
checkupdates improvements for gradle projects

* Let the package name override the one found in AndroidManifest.xml
* Support the newer applicationId

8 years agoAdd python-yaml to buildserver
Ciaran Gultnieks [Tue, 8 Sep 2015 09:54:21 +0000 (09:54 +0000)]
Add python-yaml to buildserver

8 years agoreplace deprecated optparse with argparse
nero-tux [Fri, 4 Sep 2015 09:37:05 +0000 (11:37 +0200)]
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

8 years agoBump build-tools
Daniel Martí [Sun, 6 Sep 2015 02:59:35 +0000 (22:59 -0400)]
Bump build-tools

8 years agoSpecify that disabled builds aren't failing builds
Daniel Martí [Sat, 5 Sep 2015 14:09:25 +0000 (10:09 -0400)]
Specify that disabled builds aren't failing builds

8 years agoFix regression introduced in 2831b3e93
Daniel Martí [Sat, 5 Sep 2015 06:39:53 +0000 (23:39 -0700)]
Fix regression introduced in 2831b3e93

An empty list of antifeatures should not be written.

8 years agoEnd sentence spacing madness in sample config
Daniel Martí [Fri, 4 Sep 2015 05:06:43 +0000 (22:06 -0700)]
End sentence spacing madness in sample config

8 years agoSimplify markdown code blocks
Daniel Martí [Fri, 4 Sep 2015 04:51:37 +0000 (21:51 -0700)]
Simplify markdown code blocks

8 years agocompletion: set up _fdroid_* funcs at load time
Daniel Martí [Thu, 3 Sep 2015 04:23:08 +0000 (21:23 -0700)]
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.

8 years agoCI: set up all SDK components in PATH
Daniel Martí [Wed, 2 Sep 2015 03:48:58 +0000 (20:48 -0700)]
CI: set up all SDK components in PATH

8 years agoMerge branch 'ci-split-packages' into 'master'
Daniel Martí [Tue, 1 Sep 2015 22:42:10 +0000 (22:42 +0000)]
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

8 years agoEven examples/config.py with default_config
Daniel Martí [Tue, 1 Sep 2015 22:30:41 +0000 (15:30 -0700)]
Even examples/config.py with default_config

8 years agoCI: Split up package installing
Daniel Martí [Tue, 1 Sep 2015 22:20:24 +0000 (15:20 -0700)]
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

8 years agoMerge branch 'fix-pillow-gitlab-ci' into 'master'
Daniel Martí [Tue, 1 Sep 2015 22:02:54 +0000 (22:02 +0000)]
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

8 years agoinstall build dependencies for Pillow
Hans-Christoph Steiner [Tue, 1 Sep 2015 21:48:28 +0000 (23:48 +0200)]
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.

8 years agoCI: add missing python-virtualenv package
Daniel Martí [Tue, 1 Sep 2015 18:34:04 +0000 (11:34 -0700)]
CI: add missing python-virtualenv package

8 years agoMerge branch 'fdroid-version' into 'master'
Daniel Martí [Tue, 1 Sep 2015 18:27:55 +0000 (18:27 +0000)]
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

8 years agopep8: on *.TestCase, skip "E402 module level import not at top of file"
Hans-Christoph Steiner [Tue, 1 Sep 2015 18:10:01 +0000 (20:10 +0200)]
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

8 years agogitlab-ci: install all android packages at once
Hans-Christoph Steiner [Tue, 1 Sep 2015 17:57:40 +0000 (19:57 +0200)]
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.

8 years agomove tests into common script for jenkins and gitlab-ci
Hans-Christoph Steiner [Tue, 1 Sep 2015 10:28:58 +0000 (12:28 +0200)]
move tests into common script for jenkins and gitlab-ci

8 years ago`fdroid --version` for installed releases and running from git
Hans-Christoph Steiner [Tue, 1 Sep 2015 09:23:23 +0000 (11:23 +0200)]
`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.

8 years agoCI: Add missing yaml dependency
Daniel Martí [Tue, 1 Sep 2015 17:42:16 +0000 (10:42 -0700)]
CI: Add missing yaml dependency

8 years agoMerge branch 'support-xml-json-yaml-for-metadata' into 'master'
Daniel Martí [Tue, 1 Sep 2015 17:29:11 +0000 (17:29 +0000)]
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

8 years agoMerge branch 'liblzma' into 'master'
Daniel Martí [Tue, 1 Sep 2015 17:28:06 +0000 (17:28 +0000)]
Merge branch 'liblzma' into 'master'

Add liblzma-dev to buildserver

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

See merge request !69

8 years agoset "accepted formats" for metadata in config.py
Hans-Christoph Steiner [Thu, 27 Aug 2015 09:43:17 +0000 (11:43 +0200)]
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']

8 years agorewritemeta only applies to the original .txt metadata format
Hans-Christoph Steiner [Wed, 5 Aug 2015 12:03:24 +0000 (14:03 +0200)]
rewritemeta only applies to the original .txt metadata format

8 years agomake note of JSON, XML, and YAML in the manual
Hans-Christoph Steiner [Wed, 5 Aug 2015 11:49:57 +0000 (13:49 +0200)]
make note of JSON, XML, and YAML in the manual

8 years agoadd 'gradleprops' to .pickle files for the metadata tests
Hans-Christoph Steiner [Tue, 1 Sep 2015 09:52:56 +0000 (11:52 +0200)]
add 'gradleprops' to .pickle files for the metadata tests

8 years agoexit with error if duplicate metadata file is found
Hans-Christoph Steiner [Wed, 5 Aug 2015 10:53:17 +0000 (12:53 +0200)]
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.

8 years agometadata: rename metafile to metadatapath when it is a path
Hans-Christoph Steiner [Wed, 5 Aug 2015 09:37:30 +0000 (11:37 +0200)]
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.

8 years agometadata: use unified method for getting default app metadata dict
Hans-Christoph Steiner [Wed, 5 Aug 2015 08:50:01 +0000 (10:50 +0200)]
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.

8 years agosupport app metadata in YAML format
Hans-Christoph Steiner [Fri, 24 Jul 2015 07:42:47 +0000 (00:42 -0700)]
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

8 years agoset appid in get_default_app_info_list()
Hans-Christoph Steiner [Fri, 24 Jul 2015 07:38:31 +0000 (00:38 -0700)]
set appid in get_default_app_info_list()

8 years agoconsolidate all post-parse metadata checks
Hans-Christoph Steiner [Thu, 23 Jul 2015 22:09:57 +0000 (15:09 -0700)]
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

8 years agoeliminate Boolean metadata type, only 'bool' is needed
Hans-Christoph Steiner [Thu, 23 Jul 2015 23:33:08 +0000 (16:33 -0700)]
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

8 years agosupport app metadata in XML format
Hans-Christoph Steiner [Thu, 23 Jul 2015 01:40:31 +0000 (18:40 -0700)]
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

8 years agoconvert internal representation of AntiFeatures to list
Hans-Christoph Steiner [Thu, 23 Jul 2015 00:41:03 +0000 (17:41 -0700)]
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 []

8 years agometadata: store comments in lists since lists are used everywhere else
Hans-Christoph Steiner [Wed, 22 Jul 2015 18:10:52 +0000 (11:10 -0700)]
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.

8 years agoadd test case for JSON parsing, based on parsed .txt metadata
Hans-Christoph Steiner [Wed, 22 Jul 2015 18:08:35 +0000 (11:08 -0700)]
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.

8 years agoin JSON metadata, convert unicode to str to match the internal format
Hans-Christoph Steiner [Wed, 22 Jul 2015 16:59:50 +0000 (09:59 -0700)]
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.

8 years agoadd test for metadata parsing based on a parse output to a pickle
Hans-Christoph Steiner [Wed, 22 Jul 2015 08:16:43 +0000 (01:16 -0700)]
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.

8 years agomove metadata post-parse processing to reusable function
Hans-Christoph Steiner [Wed, 22 Jul 2015 08:12:21 +0000 (01:12 -0700)]
move metadata post-parse processing to reusable function

8 years agoadd test files to pre-commit hook and fix pep8 errors
Hans-Christoph Steiner [Wed, 22 Jul 2015 06:19:56 +0000 (23:19 -0700)]
add test files to pre-commit hook and fix pep8 errors

8 years agosupport app metadata in JSON format
Hans-Christoph Steiner [Tue, 21 Jul 2015 18:50:49 +0000 (11:50 -0700)]
support app metadata in JSON format

While the current text metadata format is good for human readability and
editability, it is difficult to produce and parse using code.  JSON is a
widespread standard format for easy automatic parsing and creating, while
having decent human readability.

8 years agouse common method to set up defaults in metadata dict
Hans-Christoph Steiner [Tue, 21 Jul 2015 18:46:01 +0000 (11:46 -0700)]
use common method to set up defaults in metadata dict

This is needed for the upcoming metadata formats: JSON, XML, etc.

8 years agometadata: rename parse_metadata() to parse_txt_metadata()
Hans-Christoph Steiner [Mon, 20 Jul 2015 23:55:15 +0000 (16:55 -0700)]
metadata: rename parse_metadata() to parse_txt_metadata()

This makes the code clear as support for other metadata formats is added.

8 years agoMove requests code out of common.py, closes #114
Daniel Martí [Tue, 1 Sep 2015 00:05:08 +0000 (17:05 -0700)]
Move requests code out of common.py, closes #114

8 years agolint: fixed list false positives, no need for utf
Daniel Martí [Mon, 31 Aug 2015 22:39:07 +0000 (15:39 -0700)]
lint: fixed list false positives, no need for utf

8 years agolint: warn about duplicate lines
Daniel Martí [Mon, 31 Aug 2015 22:32:52 +0000 (15:32 -0700)]
lint: warn about duplicate lines

8 years agolint: catch more incorrect lists
Daniel Martí [Mon, 31 Aug 2015 22:25:41 +0000 (15:25 -0700)]
lint: catch more incorrect lists

8 years agolint: stop accepting Office as valid category
Daniel Martí [Sun, 30 Aug 2015 23:29:03 +0000 (16:29 -0700)]
lint: stop accepting Office as valid category

8 years agolint: accept new category Sports & Health
Daniel Martí [Sun, 30 Aug 2015 23:08:22 +0000 (16:08 -0700)]
lint: accept new category Sports & Health

8 years agoAdd liblzma-dev to buildserver
Boris Kraut [Sun, 30 Aug 2015 10:50:30 +0000 (12:50 +0200)]
Add liblzma-dev to buildserver

8 years agoFollow-up to 5a0129d8: also replace file mentions
Daniel Martí [Sun, 30 Aug 2015 03:19:32 +0000 (20:19 -0700)]
Follow-up to 5a0129d8: also replace file mentions

8 years agolint: accept all new categories
Daniel Martí [Sun, 30 Aug 2015 01:37:08 +0000 (18:37 -0700)]
lint: accept all new categories

8 years agolint: new category
Daniel Martí [Sun, 30 Aug 2015 01:24:18 +0000 (18:24 -0700)]
lint: new category

8 years agolint: Wallpaper is now called Theming
Daniel Martí [Sun, 30 Aug 2015 00:56:45 +0000 (17:56 -0700)]
lint: Wallpaper is now called Theming

8 years agolint: remove Children as valid category
Daniel Martí [Sun, 30 Aug 2015 00:52:15 +0000 (17:52 -0700)]
lint: remove Children as valid category