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

1938 Commits

Author SHA1 Message Date
Daniel Martí
ce18d1cc85 Port to python3's configparser 2016-03-10 16:43:37 +00:00
Daniel Martí
2493e705f2 lint: remove sets usage 2016-03-10 16:43:37 +00:00
Daniel Martí
ec301b8566 common: update base64 encoding of bytes 2016-03-10 16:43:37 +00:00
Daniel Martí
920ae4692f Port all imports to python3 2016-03-10 16:43:37 +00:00
Daniel Martí
11b8b1ca4f update: replace ord() with bytearray 2016-03-10 16:43:37 +00:00
Daniel Martí
ee9a296b64 Make pre-commit hook pass after python3 switch 2016-03-10 16:43:37 +00:00
Daniel Martí
099b45fcca Remove import workarounds for Python2 2016-03-10 16:43:37 +00:00
Daniel Martí
f1f5836a66 Remove code that worked around python2 unicode 2016-03-10 16:43:37 +00:00
Daniel Martí
e829b0f9e7 Get readmeta and rewritemeta running under python3 2016-03-10 16:43:37 +00:00
Daniel Martí
832b1224b9 Replace basestring with str 2016-03-10 16:43:37 +00:00
Daniel Martí
75419c1f04 Replace iteritems() with items() 2016-03-10 16:43:37 +00:00
Daniel Martí
6819c109fe Replace execfile with open+compile+exec 2016-03-10 16:43:37 +00:00
Daniel Martí
ca5ee87b16 Switch to io.StringIO 2016-03-10 16:43:37 +00:00
Daniel Martí
e3591cb7b8 Fix imports in Python 3
Since common and metadata import each other, we must import via
"fdroidserver.*".
2016-03-10 16:43:37 +00:00
Daniel Martí
99edd64372 Switch all headers to python3 2016-03-10 16:43:36 +00:00
Daniel Martí
2a73b74603 checkupdates: sort tags by date in one go
This greatly speeds up checkupdates when UCM:Tags is used on git
repositories, especially on ones with lots of tags. The old method ran a
command per tag. The new method runs a single command and doesn't
require any sorting.

Test runs show that `fdroid checkupdates org.adaway` is down from ~13s
to ~10s on my laptop.
2016-03-10 11:14:08 +00:00
Daniel Martí
261cbcd3ee build: don't remove wrapper dir gradle/
The point of removing these was to make sure that gradlew wasn't used,
and that our gradle was used instead. Removing the scripts already
accomplishes this.

Removing gradle/ should be harmless, but some apps like I2P re-use this
directory to also hold other stuff that is actually needed. So be safer
and don't remove it at all.
2016-03-08 23:50:14 +00:00
Daniel Martí
ace4834cf7 lint: Also warn about gitlab links missing /issues 2016-03-07 22:30:52 +00:00
Boris Kraut
f4ce1737d9 import: use .git suffix only for repo-url 2016-03-06 11:20:10 +01:00
Daniel Martí
920f11d047 lint: error on fdroid import disable line 2016-03-03 14:19:32 +00:00
Daniel Martí
bf32477433 Merge branch 'p1' into 'master'
Fix pubkey extraction on update

Replacement of !86.

Fix pubkey extraction in case of non-empty _JAVA_OPTIONS. Fixes #133.

I didn't actually run the test suite (it looks like there are some preparations to be done for that), but I checked the commands from `test_fdroid_popen_stderr_redirect` in ipython.

See merge request !103
2016-02-28 13:37:17 +00:00
Daniel Martí
e3f60e2b78 common: make jdk detection more strict
We weren't using ^ and $, so stuff like java-8-openjdk-i386 would match
both the Arch and the Debian regexes. A list with one regex per line in
the same format is also easier to read and maintain.

This might be why java8 isn't being detected properly on our Debian
stable buildserver.
2016-02-23 12:43:58 +00:00
Daniel Martí
3e124c8105 build: don't error on .fdroid* files in fdroiddata
This avoids the following incorrect error:

	fdroidserver.common.FDroidException: Only one local metadata file allowed! Found: .fdroid.keystorepass.txt .fdroid.keypass.txt
2016-02-23 12:03:26 +00:00
Daniel Martí
2e5c96dcfa Merge branch 'scanner-repos' into 'master'
Allow commonsware and gradle plugin repos

This is in a MR because I'm uneasy about adding a semi-random AWS url to the list. But seems like the commonsware guy only publishes jars there, which doesn't make any sense to me.

Any idea @eighthave?

See merge request !102
2016-02-20 07:29:12 +00:00
Dmitriy Bogdanov
0fdeade4d4 Add an option to use dates from APK 2016-02-18 16:41:43 +04:00
Dmitriy Bogdanov
a8b1472a43 Fix update crash in case of unset dates in APK 2016-02-18 16:40:51 +04:00
Dmitriy Bogdanov
7fc55a3847 Fix pubkey extraction on update
Fix pubkey extraction in case of non-empty _JAVA_OPTIONS
2016-02-17 22:22:57 +04:00
Ciaran Gultnieks
8135760554 Change can't update category name - closes #80 2016-02-17 14:38:44 +00:00
Daniel Martí
163044648c Allow commonsware and gradle plugin repos 2016-02-17 13:00:05 +00:00
Hans-Christoph Steiner
e0312897c7 make "Current Version Code" default to most recent APK
closes #36 https://gitlab.com/fdroid/fdroidserver/issues/36
2016-02-17 10:40:07 +01:00
Hans-Christoph Steiner
3967a0068b added 'mirrors' option to config for giving official mirror URLs
serverwebroot has long supported uploading to multiple servers, this bit of
metadata communicates those official mirrors to the client so that it can
automatically do something useful with that information.

closes #14 https://gitlab.com/fdroid/fdroidserver/issues/14
2016-02-17 10:40:07 +01:00
Hans-Christoph Steiner
a28ede2b67 PEP8 fix E225 missing whitespace around operator 2016-02-15 23:06:31 +01:00
Hans-Christoph Steiner
0bdbadabff init: check if examples/ exists in layout before using the path
There is definitely some odd stuff that happens in all these paths, so
let's just check that examples/ exists, and move on from there.
2016-02-15 23:06:31 +01:00
Daniel Martí
f06afe7884 Forgot to remove the output= debug prints 2016-02-15 13:49:12 +00:00
Daniel Martí
9800ed1a1a output= is now a glob path and can do gradle 2016-02-15 12:02:45 +00:00
Hans-Christoph Steiner
5780c14df2 fix PEP9 E713 test for membership should be 'not in' 2016-02-12 08:33:22 +01:00
Hans-Christoph Steiner
8489047bcf build: check that metadata is present before creating tmp dirs
Before, `fdroid build` would create some subdirs, then fail when it could
not read the metadata via metadata.read_metadata().  This checks before
whether there is any metadata available, and warns the user accordingly.
2016-02-12 08:33:22 +01:00
Hans-Christoph Steiner
751fd3fb0a common: do not crash if the java_paths are not what is expected
Many commands work without the JDK installed, and it is also possible that
someone is using only JDK 8 or 9.
2016-02-12 08:33:21 +01:00
Daniel Martí
7feeaad095 common: add regexp for arch oracle paths 2016-02-11 21:48:51 +00:00
Daniel Martí
28db5b82c2 common: fix JDK detection on latest arch 2016-02-11 21:34:44 +00:00
Hans-Christoph Steiner
69c81c3817 use jarsigner and keytool from same JDK as is being set in JAVA7_HOME
Using the same JDK throughout should prevent weird bugs where a setup might
use Java8's jarsigner and Java7's keytool.  This also allows the user to
set java_paths and have jarsigner and keytool used from that specified JDK.

This incorporates almost all of the patch that is in the Debian package
that forces fdroidserver to use the default JDK on that Debian release.

closes #93 https://gitlab.com/fdroid/fdroidserver/issues/93
2016-02-11 21:17:23 +01:00
Hans-Christoph Steiner
fdf17e809c automatically detect various installed JDKs and set JAVA[6-9]_HOME
This checks for which JDKs are installed in common locations, then sets the
JAVA[6-9]_HOME env vars needed by some build environments.
2016-02-11 21:17:23 +01:00
Julian Strobl
dd0b38a7e5 use tag if version name is unknown
If we don't find the version name neither in the AndroidManifest.xml nor
in the build.grade file, we fallback to the tag the user specified to
search for.

That way we have a better version name than 'Unknown'.
2016-02-11 19:50:16 +01:00
Daniel Martí
f586161361 lint: also check for trailing spaces in names
I was wrong - we don't check for trailing whitespaces on lines. That
would have to happen at parse time, not in the linter, so it would slow
things down and would become an error, not a warning. Not really worth
it.
2016-01-31 21:29:31 +00:00
Daniel Martí
8f36adfd7b Merge branch 'authorregex' into 'master'
lint: check whitespaces in "Author Name"



See merge request !94
2016-01-31 21:26:31 +00:00
Boris Kraut
5858ba5680 lint: check whitespaces in "Author Name" 2016-01-31 21:37:25 +01:00
Marvin W
6130e6eaf0 Support 'gpgkey' option as announced in sample config. 2016-01-27 15:51:03 +00:00
Ciaran Gultnieks
3629437b09 Tidy up/fix some vagrant issues
1. It is packaged in modern versions of distros, update docs accordingly
2. 1.1 is hopelessly outdated - support 1.4 onwards
3. Check the version properly, and write a better config (previously it
   wrote the 1.1 config for 1.1 and 1.3+
4. Ensure that the default share from later versions is not present when
   building, it's only required for provisioning.
2016-01-26 22:05:31 +00:00
Ciaran Gultnieks
f6b9e46246 Handle with invalid manifests better
In other words, don't blow up and kill a whole checkupdates run just
because one version of one package has some invalid xml.
2016-01-26 22:05:31 +00:00
Daniel Martí
1ff4f63de3 scanner: Allow clojars.org maven repository
See https://github.com/inorichi/tachiyomi/issues/46.
2016-01-24 18:13:45 +00:00
Daniel Martí
fff658ba19 stats: use a stable sort that doesn't randomize
Since we only sorted by count, ignoring the string, it meant that items
with the same count might be arranged in different manners. Hence the
`stats` behaviour was not predictable at all. Now it sorts first by
count, then by string.
2016-01-11 02:43:06 +01:00
Daniel Martí
68e2b46cb0 build: don't add extra clean tasks
It is a good idea in theory, especially for extra tasks specified by the
user. But in practice, tasks specified by developers often don't have a
clean counterpart. So this just breaks the build.
2016-01-11 02:05:43 +01:00
Daniel Martí
0cf2539c89 metadata: fix text wrapping on unicode characters
We were passing the utf-8 encoded string to textwrap, which took the
bytes as characters. Hence multi-byte unicode characters (in utf-8)
would count as multiple columns, which is clearly wrong.
2016-01-10 17:54:38 +01:00
Daniel Martí
e8eda55d9d metadata: Always use regex to verify values
Lists can be made into regexes very easily. Major code simplification.
Also no need to construct sets to avoid iterating over lists.
2016-01-04 13:44:00 +01:00
Daniel Martí
7ff833b948 Remove redundant AntiFeatures bool check 2016-01-04 13:26:48 +01:00
Dominik George
7f3434ea50
Add Author Name and Author Email fields. (Closes: #90) 2016-01-03 23:00:03 +01:00
Daniel Martí
622195bf16 lint: warn about spaces in summaries too 2015-12-31 11:21:47 +01:00
Daniel Martí
4482ba971d gradle: stop trying to patch outputFile
This often breaks since we're just removing a single line. Instead, use
a much more reliable way of finding output apks.
2015-12-31 09:47:14 +01:00
NeroBurner
1683df0cf8 handle Queue 2015-12-29 20:11:47 +01:00
NeroBurner
0e0767492e Octal numbers 0600 to 0o600 2015-12-29 20:10:04 +01:00
NeroBurner
5ca182a20d except named exception handling 2015-12-29 20:09:27 +01:00
NeroBurner
af38f151a2 Change print-function to have brackets 2015-12-29 20:06:46 +01:00
Daniel Martí
967472408b Add NonFreeAssets anti-feature 2015-12-29 12:39:48 +01:00
Daniel Martí
5b8d593275 gradle: Completely get rid of gradlepluginver
We can support multiple output dirs without having to detect/infer the
plugin version. Much simpler and more robust too.
2015-12-24 16:41:39 +01:00
Daniel Martí
138618937f gradle: Never add lintOptions workaround
This breaks on newer plugin versions. Instead of complicating this logic
even further to support them, upstream devs should instead use gradle
configs that actually work.

If their build fails because of lint, it's theirs to fix, not ours.
2015-12-24 16:40:36 +01:00
Daniel Martí
adff5615f5 Fix issues spotted by older pyflakes 2015-12-16 16:42:50 +01:00
Daniel Martí
013315bf10 Open metadata files in only one place
Also get rid of the useless get_default_app_info func.
2015-12-07 20:31:23 +01:00
Daniel Martí
c2304b3315 lint: optionally check format 2015-12-07 20:12:26 +01:00
Daniel Martí
fa0dcf5449 lint: fix issue found by older version of pyflakes 2015-12-07 13:58:29 +01:00
Daniel Martí
5541cb83ac checkupdates: fix --auto build copy
Also, remove origlines which hasn't been used in some time.
2015-12-07 12:39:04 +01:00
Daniel Martí
02c59a327b stats: fix a few dict accesses left over 2015-12-07 12:33:24 +01:00
Daniel Martí
ae5b8ed496 import: fix get_default_app_info usage
Closes #129
2015-12-05 19:20:41 +01:00
Daniel Martí
7a7d36feef scanner: remove jni check
buildjni=no is the default. Moreover, some apps now run ndk-build via
gradle, so this was just in the way.
2015-12-04 19:32:01 +01:00
Daniel Martí
3101ad6c39 Set all list defaults to an actual list
Iterating over the defaults will crash otherwise. Update pickle files.
2015-12-04 00:08:42 +01:00
Daniel Martí
cb8d93e443 Fix tests by not checking private attributes
All attrs starting with '_' (e.g. _foo or __bar) are used internally, so
not very relevant for the metadata test anyway.
2015-12-03 19:31:20 +01:00
Daniel Martí
2711f1c868 Also skip unmodified fields in the regex checks
Now it's close to 1s.
2015-12-03 17:02:24 +01:00
Daniel Martí
ea99add3da Keep track of what attrs were modified in apps/builds
This allows us to run checks and fix types only on those that were
really modified. On our fdroiddata repo, with 2k apps with many unset
fields and flags, this reduces readmeta runtime from ~1.3s to ~1.1s.
2015-12-03 16:46:21 +01:00
Daniel Martí
8c2e1fedfc Actually check that bools are valid
The metadata check was omitting booleans and lists, as it was only
taking strings. Fix this.
2015-12-03 16:35:46 +01:00
Daniel Martí
7b575e3fdd Remove need for rstrip() of txt description 2015-12-03 16:19:33 +01:00
Daniel Martí
a9bb5f9713 metadata: write strings directly to txt file 2015-12-03 14:00:47 +01:00
Daniel Martí
28566f6e57 Rename metafieldtype to fieldtype
For consistency with flagtype. Also less redundant.
2015-12-03 13:53:49 +01:00
Daniel Martí
2c095df947 Use dicts for field/flag types 2015-12-03 13:52:53 +01:00
Daniel Martí
cd4e43c3c2 Some more readability/performance tweaks
* Use set() instead of dict()
* No 'if foo: True else: False'
* Don't check for invalid fields twice
2015-12-03 13:02:54 +01:00
Daniel Martí
b1a9180d12 Use constants for field/flag types
Avoids typos, such as one I just found which was 'strsng' isntead of
'string'. The static analyzer can catch those if they are constants.
Comparing ints is also faster than strings, which adds up in readmeta.
2015-12-03 12:55:19 +01:00
Daniel Martí
992406de0e Avoid conflicting func/var names 2015-12-03 12:41:50 +01:00
Daniel Martí
1b43d8e33c Make text formatting faster via StringIO
Avoid concatenating strings over and over. Also, the wiki formatting
wasn't necessary at all since it was just joining lines.
2015-12-03 12:02:47 +01:00
Daniel Martí
088929711c Represent multiline fields as str, not list
Only keep lists in metadata files in the json format, since they don't
support multiline strings that are readable.

This makes the internal code easier, and a bit faster.
2015-12-03 11:36:15 +01:00
Daniel Martí
c8cc054c8b Fix tests 2015-12-03 11:16:27 +01:00
Daniel Martí
97c991c4b6 Some more txt parsing tweaks after profiling 2015-12-03 11:06:27 +01:00
Daniel Martí
490da2da22 Remove duplicate build_flags check
It's already checked in set_flag
2015-12-03 10:59:48 +01:00
Daniel Martí
1987ee7f54 Remove gradle=main
It was only supported in txt metadata, and was unused in fdroiddata
anyway.
2015-12-03 10:56:59 +01:00
Daniel Martí
5e0bc7f2c3 Properly close all metadata files once read 2015-12-03 10:51:27 +01:00
Daniel Martí
96f1fc5355 Never use exit/log in metadata 2015-12-02 22:59:58 +01:00
Daniel Martí
b9ac6fb69a Speed up metadata reading
Total time for `fdroid readmeta` went down from ~1.6s to ~1.4s on my
machine.
2015-12-02 22:38:40 +01:00
Daniel Martí
528e45d22b Simplify post_metadata_parse usage 2015-12-02 22:29:31 +01:00
Daniel Martí
c975531d87 metadata: properly store nums as strs and bools as bools 2015-12-02 20:49:42 +01:00
Daniel Martí
71a5eac494 Pre-compile more regexes 2015-12-02 20:40:30 +01:00
Daniel Martí
7e28e0ed90 lint: warn about target= in gradle builds 2015-12-02 20:28:08 +01:00
Daniel Martí
a566ee4475 Fix default update= on ant builds 2015-12-02 20:16:25 +01:00
Daniel Martí
bf8518ee8f Rework build into a class
This simplifies usage, goes from

    build['flag']
to
    build.flag

Also makes static analyzers able to detect invalid attributes as the set
is now limited in the class definition.

As a bonus, setting of the default field values is now done in the
constructor, not separately and manually.

While at it, unify "build", "thisbuild", "info", "thisinfo", etc into
just "build".
2015-12-02 20:03:11 +01:00
Daniel Martí
6e87a8c45a Add documentation to new App class 2015-11-28 17:19:59 +01:00
Daniel Martí
ab614ab442 Rework app into a class
This simplifies usage, goes from

	app['Foo']
to
	app.Foo

Also makes static analyzers able to detect invalid attributes as the set
is now limited in the class definition.

As a bonus, setting of the default field values is now done in the
constructor, not separately and manually.
2015-11-28 17:11:05 +01:00
Daniel Martí
de12cfdbe1 Handle duplicate apps in a much cleaner way
Don't log and exit in an inner metadata function. Handle it at a higher
level and do a proper exception. This also avoids unnecessary passing of
apps all around.
2015-11-28 14:04:21 +01:00
Daniel Martí
ce2f4a115c lint: more versatile /HEAD warning
Now catches many more github/gitlab/bitbucket links
2015-11-28 11:58:56 +01:00
Daniel Martí
0f06044770 lint: catch links at the beginning too 2015-11-28 11:58:55 +01:00
Daniel Martí
41690b7508 lint: also catch gitlab master links 2015-11-28 09:52:55 +01:00
Daniel Martí
301302d76e update: remove icons when removing disabled builds
They were just left there forever.
2015-11-27 00:23:59 +01:00
Daniel Martí
47812ccc24 update: move apk icons to and from archive too
They all were stuck in repo/ for this reason. This resulted in apps that
were only in the archive to seem like they didn't have icons, when in
fact they did but were in the wrong dir.
2015-11-27 00:23:57 +01:00
Daniel Martí
95ad265836 update: lower apps without apks logs to debug
If you run 'fdroid update', 6k+ warning messages are output. This is
definitely wrong. They can still be shown if one enables -v.
2015-11-26 23:47:22 +01:00
Daniel Martí
7e82b044fe Don't use paramiko with DEBUG
It outputs way, way too much info. Thousands of lines only when copying
the files over, which is not useful at all.
2015-11-20 17:35:34 -08:00
Daniel Martí
5e1b07dce3 import: don't crash due to missing id
Fixes #129
2015-11-18 15:33:30 -08:00
Daniel Martí
3a616e2d9f Don't crash if AM.xml has no application element 2015-11-16 07:21:19 -08:00
Daniel Martí
97a637b9b4 Don't crash if no auto name is found 2015-11-14 22:05:28 +01:00
Daniel Martí
ae146ff2a2 build: don't treat FDroidExceptions as unknown 2015-11-14 13:05:37 +01:00
Daniel Martí
c97b0e7ed9 common: error if any glob paths are unused
Like rm=foo and foo doesn't exist.
2015-11-14 13:05:16 +01:00
Daniel Martí
f604d845f5 checkupdates: find new subdirs for autonames too
The same method used for Tags and RepoManifest.
2015-11-14 10:24:43 +01:00
Daniel Martí
b84688af7a scanner: don't warn about ignored files 2015-11-12 20:02:40 +01:00
Daniel Martí
0d758daa22 install: filter out log messages better 2015-11-11 13:09:29 +01:00
Daniel Martí
af7178f2fe scanner: Ignore certain binary executable files
These were warnings, so the behaviour doesn't really change.
2015-11-10 21:59:54 +01:00
Daniel Martí
c94b0342ad scanner: ignore .DS_Store files
They are binary and sometimes executable, so they trigger false
positives.
2015-11-10 21:49:46 +01:00
Daniel Martí
66e82cb077 Bump build-tools to 23.0.2 2015-11-05 11:56:13 +01:00
Daniel Martí
a4d1fa22f7 Install Java 1.8 alongside 1.7 for retrolambda
Fixes #103.
2015-11-03 11:08:34 +01:00
Daniel Martí
c8627764e3 checkupdates: check packages in AM.xml files too 2015-11-01 12:35:36 +01:00
Daniel Martí
d17da074e9 scanner: allow apache.org maven repo
Since it has the same free software and source code publishing
requirements that oss.sonatype and maven.org repos have.
2015-10-31 09:59:38 +01:00
Daniel Martí
3ace102bd5 checkupdates: work around multiple package ids
If there are multiple package ids in a build.gradle file and the first
one we don't want, checkupdates would get stuck. Make it ignore any
package id that we don't want so that it can get past that.
2015-10-30 19:03:53 +01:00
Daniel Martí
2de274326a checkupdates: better "no tags" messages 2015-10-27 13:42:02 +01:00
Daniel Martí
ece3317be0 checkupdates: no need to sort tags if len()<=5 2015-10-27 13:41:09 +01:00
Daniel Martí
37b13c37d5 Also fix local.prop files before subdir
If subdir=foo/bar and there is a foo/local.properties file, it would not
get treated.
2015-10-26 16:49:11 +01:00
Daniel Martí
d141bd1be0 checkupdates: don't blindly accept subdir
This is unnecessary because dirs_with_manifest will pick it up anyway.
But the problem manifested because we weren't checking the package id
here.
2015-10-26 16:29:26 +01:00
Daniel Martí
da92845f9c checkupdates: compare CVs as ints, not strs 2015-10-26 16:13:35 +01:00
Daniel Martí
9017328698 Add an extra strip() to work around tostring issue
In cases like this xml code:

	<string name="app_name">"OpenKeychain"</string>
	<!-- title -->
	<string name="title_encrypt_text">"Encrypt"</string>

tostring() returns trailing whitespaces (including newlines). Which
aren't removed until the very end, after we try to remove enclosing
quotes. So strip right after tostring() too, since we never really care
about whitespaces anyway.
2015-10-26 00:28:29 +01:00
Daniel Martí
995afdcbfd checkupdates: never auto-update to older versions 2015-10-25 19:14:23 +01:00
Daniel Martí
6ea51abfaa common: Compile more regexes only once 2015-10-25 19:10:49 +01:00
Daniel Martí
8812e9339d Don't double check package name 2015-10-25 19:10:23 +01:00
Daniel Martí
1f42b83120 checkupdates: don't ignore root directory 2015-10-25 19:09:55 +01:00
Daniel Martí
d5ec039dec checkupdates: Make RepoManifest change subdir too 2015-10-25 12:09:01 +01:00
Daniel Martí
af947809b5 checkupdates: let Tags detect subdir changes
Up until now, this was done only if no overall version could be found. But in
tags, we would get stuck with an old version from an old tag and not see
subdir changes in new tags.
2015-10-25 12:00:02 +01:00
Daniel Martí
fa55ec0e87 Be consistent about root_dir/build_dir naming 2015-10-25 11:41:46 +01:00
Daniel Martí
7e7d67f0d7 Fix a small indentation issue 2015-10-25 11:32:18 +01:00
Daniel Martí
db31eddd7e lint: fix unlinkified links regex
It was incorrectly matching:

	foo [http://bar

and not matching:

	http://foo (start of line)
2015-10-25 00:07:33 +02:00
Daniel Martí
ab667992c7 update: fix for 0fa6aac288
For some reason, my up to date pyflakes didn't catch this.
2015-10-24 20:13:49 +02:00
Daniel Martí
2872027835 Also replace git@gitlab.com submodule urls 2015-10-24 19:42:40 +02:00
Daniel Martí
78a661fc7d Typo fix for 91daacb889 2015-10-24 18:37:57 +02:00
Daniel Martí
91daacb889 common: don't crash if an sdk binary is not found 2015-10-24 17:02:53 +02:00
Daniel Martí
0fa6aac288 Remove densities getter 2015-10-24 16:34:55 +02:00
Daniel Martí
a92f9a3a4c scanner: allow sonatype groups/public repo
See http://central.sonatype.org/pages/ossrh-guide.html
2015-10-22 12:23:57 +02:00
Daniel Martí
6dcee2924a scanner: escape urls 2015-10-22 12:23:52 +02:00
Daniel Martí
d706cfa7d8 Fix build-tools patching when it uses variables
Like:

	buildToolsVersion FOO_VERSION
2015-10-14 19:34:30 +02:00
Daniel Martí
f7e9022217 scanner: ignore gradle comment lines
Useful to detect:

	maven {
		// foo
		url "http://foo.bar"
	}
2015-10-08 12:16:45 +02:00
Daniel Martí
75b1c029ac Remove unwanted files in a more consistent way 2015-10-08 12:10:55 +02:00
Daniel Martí
21117b77d2 scanner: error on unknown maven repos
This finds maven repos of the format:

	maven {
		url 'http://foo.bar'
	}

And checks if the repository is one that we allow. As usual, scanignore can be
used, or the list modified, if there are exceptions or more repositories to
allow.
2015-10-07 18:15:33 +02:00
Ciaran Gultnieks
42e5b5cfeb Fix moving of gpg sigs between repo and archive 2015-10-06 08:32:00 +00:00
Daniel Martí
48645072ee extension simplifications 2015-10-04 18:01:32 +02:00
Daniel Martí
aa3ca80ae6 write_metadata fixes 2015-10-04 18:01:23 +02:00
Daniel Martí
53ed335d4b Final touches to yaml writing
Now it writes and reads properly.
2015-10-04 07:56:32 -07:00
Daniel Martí
ac37e3084e More improvements to yaml writing 2015-10-04 07:55:55 -07:00
Daniel Martí
9c5b5f7b60 Don't leave an empty line at the end 2015-10-04 07:55:42 -07:00
Daniel Martí
1aa891c4fd Add basic yaml metadata writing 2015-10-04 07:55:42 -07:00
Daniel Martí
082e275aa1 Rename write_metadata to specify txt 2015-10-03 23:13:44 -07:00
Daniel Martí
885a3a73f1 Simplify format parsing logic 2015-10-03 23:00:18 -07:00
Daniel Martí
d8e1f296e0 scanner: don't error on partially used globs
This meant that using something like `scanignore=*` would error if there were
ignores happening in some directories/files, but not all.

Fixes #110
2015-10-03 17:00:22 -07:00
Daniel Martí
59f5d19dfe Rework path glob expansion
Slightly simplifies the whole thing and lets us map what each resulting path
comes from. This will be useful to fix #110 later on.
2015-10-03 16:52:23 -07:00
Daniel Martí
75bde83fb8 import: fix issue tracker links 2015-10-03 16:28:48 -07:00
Daniel Martí
712deb4396 Don't use exists() on symlinks
If they are broken, exists() will return false. islink() will return true in
both cases.
2015-09-30 17:05:44 -07:00
Daniel Martí
1ed33bfa96 Smarter archive policy apk moving
* Move apks back from the archive repo (e.g. if builds are disabled thus the
  number of apks on the main repo decreases)
* Also move apk signatures back and forth
2015-09-30 17:05:44 -07:00
Daniel Martí
4ea5ce8889 checkupdates: Ignore xml tags in string content
This allows us to fetch strings like the following:

<string name="app_name">foo <xliff:g>bar</xliff:g></string>

Up until now, using .text would only return "foo ", but if we use .tostring()
with the text method, it converts everything into plain text for us resulting
in "foo bar".
2015-09-30 16:35:41 -07:00
Daniel Martí
79475d055f Fetch string contents in a safer way 2015-09-30 16:35:41 -07:00
Daniel Martí
cc017d70d2 Fix for bb2cbd527b 2015-09-29 20:39:36 -07:00
Daniel Martí
bb2cbd527b Increase wiki error detail length limit
8k is too small, e.g. when make -jN errors or when there are a lot of scanner
errors and warnings. 16k should be better. Also, use "[...]" to make it
obvious that the output is truncated.
2015-09-29 12:51:11 -07:00
Daniel Martí
811fcd320f rewritemeta: add -l option to list files 2015-09-24 22:54:52 -07:00
Daniel Martí
911994fc99 Make write_metadata take a writer
This will let rewritemeta report format issues without writing to disk.
2015-09-24 22:38:33 -07:00
Daniel Martí
d88914b466 Replace MD5withRSA with SHA1withRSA. Fixes #26.
Looks to me like we were using SHA1withRSA all along. Tested that everything
still works with a test repo.

As Hans reports, SHA1withRSA has been the default on Android tools for a long
time and it's supported on all Android versions.
2015-09-24 18:53:04 -07:00
Ciaran Gultnieks
84573e4e5c Push a more complete/standard fdroidserver layout to buildserver 2015-09-24 09:19:17 +00:00
Daniel Martí
27a5dc8429 checkupdates: ignore gradle comments 2015-09-23 18:52:59 -07:00
Daniel Martí
80a8a39f6f build: make sure .gradle/ is removed at clean 2015-09-23 13:02:22 -07:00
Daniel Martí
b589595e45 scanner: skip symlinks to avoid issues
If they resolve to a missing file, we don't care about them. If they resolve
to an existing file, we'll scan that file anyway.
2015-09-22 13:03:42 -07:00
Daniel Martí
b9b5b5d1b0 scanner: don't crash on unused gradle files 2015-09-22 13:02:26 -07:00
Daniel Martí
83daf71338 gradle: don't strip out comments
This was never intended. Comments can help sed usage, and can still be useful
in source tarballs.
2015-09-22 11:52:16 -07:00
Daniel Martí
21bdd2941c Merge branch 'asynchronous_reader' into 'master'
Add asynchronous filereader, fix python3 lockups

with the current implementation of AsynchronousFileReader with Python 3 FDroidPopen deadlocks with 100% CPU-utilization

The code is from https://github.com/soxofaan/asynchronousfilereader

I hope the MIT-Licence makes no problems




See merge request !80
2015-09-21 22:09:23 +00:00
Daniel Martí
6c5bbb2431 Merge branch 'master' into 'master'
Added support for gradle flavor specific dependencies in usual suspects check

When you have flavor specific dependencies in your project, you specify them in the build.gradle file with a prefixed *compile* command:

```
compile 'normal dependency'
myflavorCompile 'only for myflavor'
```

The usual suspects check just searches for some often used library names in the whole build.gradle file. I added another condition, so dependencies for not build flavors are not checked.

See merge request !77
2015-09-21 17:06:38 +00:00
NeroBurner
694a4ce7da Add asynchronous filereader, fix python3 lockups 2015-09-20 20:57:53 +02:00
Jan Kühle
450409ef14 Added support for gradle flavor specific dependencies in usual suspects check. 2015-09-19 14:43:42 +02:00
Daniel Martí
e285a8ac31 Remove Dogecoin donation support
Not nearly as popular as bitcoin and litecoin. To the point where it hadn't
been used yet.

Bump index version to 14 to mark its removal.
2015-09-18 19:06:10 -07:00
Daniel Martí
d07bf0754a metadata: fix html paragraph tag regression
Spotted in fdroid/fdroidclient#422
2015-09-17 14:14:54 -07:00
Daniel Martí
d7d9e38ef7 scanner: use a blacklist instead of a whitelist
This is much closer to what we did before with mimetypes. Using a whitelist
turns out to be a bad idea since repositories seem to be randomly filled with
executable images and documents, which trigger the scanner.

In an ideal world the scanner would complain about all of those. For now, just
warn about the possibility of them being hidden binaries.
2015-09-16 17:23:34 -07:00
Daniel Martí
feaf3d04e5 scanner: also ignore ttf and otf files 2015-09-16 17:14:06 -07:00
Daniel Martí
da2a4f2cf5 scanner: improve usual suspect output 2015-09-16 17:13:54 -07:00
Daniel Martí
2bf04f8054 import: fix import -u from fdroiddata
Have -u take precedence over .git checking to fix import -u being run from
fdroiddata.
2015-09-15 14:06:31 -07:00
Daniel Martí
41370a12b0 Deduplicate statsdir 2015-09-14 18:13:03 -07:00
Daniel Martí
5cb47203b3 Replace some hard-coded paths with os.path.join 2015-09-14 18:12:15 -07:00
Daniel Martí
2c0be49124 import: do set root_dir if running from a repo 2015-09-14 17:40:44 -07:00
Daniel Martí
15e14075cf scanner: avoid checking if usual files are binary 2015-09-13 22:22:03 -07:00
Daniel Martí
055759cf76 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
2015-09-13 22:17:37 -07:00
Daniel Martí
1a3816acfb scanner: support apps using srclib repo type 2015-09-13 22:05:41 -07:00
Daniel Martí
576da1d048 all: deduplicate -v/-q setup 2015-09-11 23:42:50 -07:00
Daniel Martí
b42b45f762 lint: small cleanup 2015-09-11 23:35:32 -07:00
Daniel Martí
ecad89dc05 lint: catch more duplicate links 2015-09-11 23:30:59 -07:00
Daniel Martí
3638acddc4 checkupdates: Avoid variable/string names as CV 2015-09-11 23:17:46 -07:00
Daniel Martí
7a79b000bf Allow slashes in tags
The wikipedia app uses them, for example.
2015-09-11 23:17:36 -07:00
Daniel Martí
fb23b2cff4 metadata: don't break words nor on hyphens 2015-09-11 22:52:50 -07:00