1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-09-20 03:50:16 +02:00
Commit Graph

282 Commits

Author SHA1 Message Date
Hans-Christoph Steiner
0ae257db15 rename maxSdkVersion variables to match Android
Since this variable is already different than the XML name ('maxsdkver'),
this eliminates one more name for the same thing.
2016-06-14 10:06:02 +02:00
Hans-Christoph Steiner
afd528731a read/write F-Droid files always as UTF-8
This makes UTF-8 the sole supported encoding for F-Droid's files. This is
mostly codifying the already existing practice for config.py and index.xml.
The other files where always just ASCII before.

* config.py
* metadata/*.txt
* known_apks.txt
* categories.txt
* latestapps.txt
* latestapps.dat
* index.xml

Note: this does not change the read/write encoding of stats files.  That is
still ASCII.
2016-06-07 14:10:04 +02:00
Ciaran Gultnieks
401649e036 Add extra debug logging for move to/from archive 2016-05-29 15:36:58 +01:00
Dmitriy Bogdanov
3f75c95e5f Add an encoding parameter to open apkcache created with Py2 2016-04-12 12:42:41 +04:00
Daniel Martí
a1703f1204 update: fix encoding issues with the xml index 2016-03-11 13:27:00 +00:00
Daniel Martí
24266d48e1 update: get output bytes, not str, from keytool 2016-03-11 13:27:00 +00:00
Daniel Martí
63f8718cf5 Replace iterkeys() with keys() 2016-03-10 16:43:37 +00:00
Daniel Martí
8b3c27cb47 update: replace encode('hex') with hexlify 2016-03-10 16:43:37 +00:00
Daniel Martí
da258dad57 Replace md5 with hashlib.md5 2016-03-10 16:43:37 +00:00
Daniel Martí
d39bf37ce8 Port urllib and HTMLParser imports to python3 2016-03-10 16:43:37 +00:00
Daniel Martí
b73cc8e0b3 Replace itervalues() with values() 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í
75419c1f04 Replace iteritems() with items() 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í
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
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
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
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
Dominik George
7f3434ea50
Add Author Name and Author Email fields. (Closes: #90) 2016-01-03 23:00:03 +01:00
NeroBurner
5ca182a20d except named exception handling 2015-12-29 20:09:27 +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í
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í
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í
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í
0fa6aac288 Remove densities getter 2015-10-24 16:34:55 +02:00
Ciaran Gultnieks
42e5b5cfeb Fix moving of gpg sigs between repo and archive 2015-10-06 08:32:00 +00: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í
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
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í
576da1d048 all: deduplicate -v/-q setup 2015-09-11 23:42:50 -07: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í
f4e96cfd7a Specify that disabled builds aren't failing builds 2015-09-05 10:10:48 -04: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
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
Daniel Martí
6fe8d96e85 Simplify some file logic with "with" 2015-08-28 18:37:23 -07:00
Hans-Christoph Steiner
b5cbb4382f new config option: per-app repos to support nightly build repos
For devs that want to build and distribute nightly builds of their apps
using the fdroid tools.  The core idea here is to make the fdroidserver
tool suite the single set of tools for all types of builds and releases.
That will hopefully drive more free software developers to make f-droid.org
an core channel for official releases.
2015-08-25 16:55:52 +02:00
Hans-Christoph Steiner
e614863c69 scan_apks() sets cachechanged, so no tricks needed 2015-08-25 16:49:52 +02:00
Hans-Christoph Steiner
cef7553873 update: warn if APK has a date that is newer than the system clock
If the date in an APK is in the future, that could cause confusion.  If the
system clock is wrong, then the APK will also have a date in the future.
This is most likely on offline signing machines, since they do not have a
time source to sync to.
2015-07-23 10:39:30 -07:00
Ciaran Gultnieks
0bd5be2ea3 Fix update fail when icons are missing
Introduced yesterday, I believe.
2015-06-29 11:17:59 +02:00
Daniel Martí
3492ec6eff Hotfix: Client 0.92 breaks if web/source/tracker are missing
Revert this commit after a few stable releases
2015-06-28 11:45:06 -07:00
Daniel Martí
af692dd3bd Stable clients understand UpstreamNonFree now 2015-06-26 18:00:34 +02:00