mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-11-14 02:50:12 +01:00
Merge branch 'pre-indexv1-fixes' into 'master'
pre index-v1 fixes See merge request !220
This commit is contained in:
commit
19b3d7f00d
@ -1,8 +1,8 @@
|
||||
#!/bin/bash
|
||||
# fdroid(1) completion -*- shell-script -*-
|
||||
#
|
||||
# bash-completion - part of the FDroid server tools
|
||||
# Bash completion for the fdroid main tools
|
||||
#
|
||||
# Copyright (C) 2013-2017 Hans-Christoph Steiner <hans@eds.org>
|
||||
# Copyright (C) 2013, 2014 Daniel Martí <mvdan@mvdan.cc>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
@ -18,17 +18,6 @@
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# 'fdroid' is completed automatically, but aliases to it are not.
|
||||
# For instance, to alias 'fd' to 'fdroid' and have competion available:
|
||||
#
|
||||
# alias fd='fdroid'
|
||||
# complete -F _fdroid fd
|
||||
#
|
||||
# One can use completion on aliased subcommands as follows:
|
||||
#
|
||||
# alias fbuild='fdroid build'
|
||||
# complete -F _fdroid_build fbuild
|
||||
|
||||
__fdroid_init() {
|
||||
COMPREPLY=()
|
||||
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||
|
@ -2163,8 +2163,11 @@ def get_per_app_repos():
|
||||
def is_repo_file(filename):
|
||||
'''Whether the file in a repo is a build product to be delivered to users'''
|
||||
return os.path.isfile(filename) \
|
||||
and not filename.endswith('.asc') \
|
||||
and not filename.endswith('.sig') \
|
||||
and os.path.basename(filename) not in [
|
||||
'index.jar',
|
||||
'index_unsigned.jar',
|
||||
'index.xml',
|
||||
'index.html',
|
||||
'categories.txt',
|
||||
|
@ -737,7 +737,8 @@ def scan_apks(apkcache, repodir, knownapks, use_date_from_apk=False):
|
||||
apk['nativecode'].append(arch[1:-1])
|
||||
elif line.startswith('uses-permission:'):
|
||||
perm_match = re.match(permission_pat, line).groupdict()
|
||||
|
||||
if perm_match['maxSdkVersion']:
|
||||
perm_match['maxSdkVersion'] = int(perm_match['maxSdkVersion'])
|
||||
permission = UsesPermission(
|
||||
perm_match['name'],
|
||||
perm_match['maxSdkVersion']
|
||||
@ -746,7 +747,8 @@ def scan_apks(apkcache, repodir, knownapks, use_date_from_apk=False):
|
||||
apk['uses-permission'].add(permission)
|
||||
elif line.startswith('uses-permission-sdk-23:'):
|
||||
perm_match = re.match(permission_pat, line).groupdict()
|
||||
|
||||
if perm_match['maxSdkVersion']:
|
||||
perm_match['maxSdkVersion'] = int(perm_match['maxSdkVersion'])
|
||||
permission_sdk_23 = UsesPermissionSdk23(
|
||||
perm_match['name'],
|
||||
perm_match['maxSdkVersion']
|
||||
@ -1217,7 +1219,8 @@ def make_index(apps, sortedids, apks, repodir, archive):
|
||||
hashel.appendChild(doc.createTextNode(apk[hash_type]))
|
||||
apkel.appendChild(hashel)
|
||||
addElement('size', str(apk['size']), doc, apkel)
|
||||
addElement('sdkver', str(apk['minSdkVersion']), doc, apkel)
|
||||
addElementIfInApk('sdkver', apk,
|
||||
'minSdkVersion', doc, apkel)
|
||||
addElementIfInApk('targetSdkVersion', apk,
|
||||
'targetSdkVersion', doc, apkel)
|
||||
addElementIfInApk('maxsdkver', apk,
|
||||
@ -1249,13 +1252,13 @@ def make_index(apps, sortedids, apks, repodir, archive):
|
||||
permel = doc.createElement('uses-permission')
|
||||
permel.setAttribute('name', permission.name)
|
||||
if permission.maxSdkVersion is not None:
|
||||
permel.setAttribute('maxSdkVersion', permission.maxSdkVersion)
|
||||
permel.setAttribute('maxSdkVersion', '%d' % permission.maxSdkVersion)
|
||||
apkel.appendChild(permel)
|
||||
for permission_sdk_23 in sorted(apk['uses-permission-sdk-23']):
|
||||
permel = doc.createElement('uses-permission-sdk-23')
|
||||
permel.setAttribute('name', permission_sdk_23.name)
|
||||
if permission_sdk_23.maxSdkVersion is not None:
|
||||
permel.setAttribute('maxSdkVersion', permission_sdk_23.maxSdkVersion)
|
||||
permel.setAttribute('maxSdkVersion', '%d' % permission_sdk_23.maxSdkVersion)
|
||||
apkel.appendChild(permel)
|
||||
if 'nativecode' in apk:
|
||||
addElement('nativecode', ','.join(sorted(apk['nativecode'])), doc, apkel)
|
||||
|
Loading…
Reference in New Issue
Block a user