mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-05 15:00:30 +03:00
Merge branch 'hopefully-uncontroversial-fixes' into 'master'
hopefully uncontroversial fixes See merge request fdroid/fdroidserver!746
This commit is contained in:
commit
90f3e1ab70
7 changed files with 23 additions and 21 deletions
|
|
@ -92,8 +92,10 @@ ubuntu_lts_ppa:
|
||||||
- echo "deb http://ppa.launchpad.net/fdroid/fdroidserver/ubuntu $RELEASE main" >> /etc/apt/sources.list
|
- echo "deb http://ppa.launchpad.net/fdroid/fdroidserver/ubuntu $RELEASE main" >> /etc/apt/sources.list
|
||||||
- apt-get update
|
- apt-get update
|
||||||
- apt-get dist-upgrade
|
- apt-get dist-upgrade
|
||||||
|
- mount | grep binfmt_misc || mount -t binfmt_misc binfmt_misc /proc/sys/fs/binfmt_misc
|
||||||
- apt-get install --install-recommends binfmt-support fdroidserver git python3-defusedxml python3-setuptools
|
- apt-get install --install-recommends binfmt-support fdroidserver git python3-defusedxml python3-setuptools
|
||||||
- grep binfmt /proc/modules || apt -qy purge apksigner
|
- ls -l /proc/sys/fs/binfmt_misc || true
|
||||||
|
- test -e /proc/sys/fs/binfmt_misc/jarwrapper || apt -qy purge apksigner
|
||||||
- cd tests
|
- cd tests
|
||||||
- ./run-tests
|
- ./run-tests
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1364,6 +1364,7 @@ def manifest_paths(app_dir, flavours):
|
||||||
os.path.join(app_dir, 'src', 'main', 'AndroidManifest.xml'),
|
os.path.join(app_dir, 'src', 'main', 'AndroidManifest.xml'),
|
||||||
os.path.join(app_dir, 'src', 'AndroidManifest.xml'),
|
os.path.join(app_dir, 'src', 'AndroidManifest.xml'),
|
||||||
os.path.join(app_dir, 'build.gradle'),
|
os.path.join(app_dir, 'build.gradle'),
|
||||||
|
os.path.join(app_dir, 'build-extras.gradle'),
|
||||||
os.path.join(app_dir, 'build.gradle.kts')]
|
os.path.join(app_dir, 'build.gradle.kts')]
|
||||||
|
|
||||||
for flavour in flavours:
|
for flavour in flavours:
|
||||||
|
|
|
||||||
|
|
@ -73,7 +73,7 @@ def main():
|
||||||
help=_("Comma separated list of categories."))
|
help=_("Comma separated list of categories."))
|
||||||
parser.add_argument("-l", "--license", default=None,
|
parser.add_argument("-l", "--license", default=None,
|
||||||
help=_("Overall license of the project."))
|
help=_("Overall license of the project."))
|
||||||
parser.add_argument("--omit-disable", default=False,
|
parser.add_argument("--omit-disable", action="store_true", default=False,
|
||||||
help=_("Do not add 'disable:' to the generated build entries"))
|
help=_("Do not add 'disable:' to the generated build entries"))
|
||||||
parser.add_argument("--rev", default=None,
|
parser.add_argument("--rev", default=None,
|
||||||
help=_("Allows a different revision (or git branch) to be specified for the initial import"))
|
help=_("Allows a different revision (or git branch) to be specified for the initial import"))
|
||||||
|
|
|
||||||
|
|
@ -36,11 +36,11 @@ def devices():
|
||||||
p = SdkToolsPopen(['adb', "devices"])
|
p = SdkToolsPopen(['adb', "devices"])
|
||||||
if p.returncode != 0:
|
if p.returncode != 0:
|
||||||
raise FDroidException("An error occured when finding devices: %s" % p.output)
|
raise FDroidException("An error occured when finding devices: %s" % p.output)
|
||||||
lines = [l for l in p.output.splitlines() if not l.startswith('* ')]
|
lines = [line for line in p.output.splitlines() if not line.startswith('* ')]
|
||||||
if len(lines) < 3:
|
if len(lines) < 3:
|
||||||
return []
|
return []
|
||||||
lines = lines[1:-1]
|
lines = lines[1:-1]
|
||||||
return [l.split()[0] for l in lines]
|
return [line.split()[0] for line in lines]
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|
|
||||||
|
|
@ -189,9 +189,9 @@ def check_regexes(app):
|
||||||
v = app.get(f)
|
v = app.get(f)
|
||||||
t = metadata.fieldtype(f)
|
t = metadata.fieldtype(f)
|
||||||
if t == metadata.TYPE_MULTILINE:
|
if t == metadata.TYPE_MULTILINE:
|
||||||
for l in v.splitlines():
|
for line in v.splitlines():
|
||||||
if m.match(l):
|
if m.match(line):
|
||||||
yield "%s at line '%s': %s" % (f, l, r)
|
yield "%s at line '%s': %s" % (f, line, r)
|
||||||
else:
|
else:
|
||||||
if v is None:
|
if v is None:
|
||||||
continue
|
continue
|
||||||
|
|
@ -345,12 +345,12 @@ def check_duplicates(app):
|
||||||
yield _("Description '%s' is just the app's summary") % app.Summary
|
yield _("Description '%s' is just the app's summary") % app.Summary
|
||||||
|
|
||||||
seenlines = set()
|
seenlines = set()
|
||||||
for l in app.Description.splitlines():
|
for line in app.Description.splitlines():
|
||||||
if len(l) < 1:
|
if len(line) < 1:
|
||||||
continue
|
continue
|
||||||
if l in seenlines:
|
if line in seenlines:
|
||||||
yield _("Description has a duplicate line")
|
yield _("Description has a duplicate line")
|
||||||
seenlines.add(l)
|
seenlines.add(line)
|
||||||
|
|
||||||
|
|
||||||
desc_url = re.compile(r'(^|[^[])\[([^ ]+)( |\]|$)')
|
desc_url = re.compile(r'(^|[^[])\[([^ ]+)( |\]|$)')
|
||||||
|
|
@ -369,18 +369,18 @@ def check_bulleted_lists(app):
|
||||||
validchars = ['*', '#']
|
validchars = ['*', '#']
|
||||||
lchar = ''
|
lchar = ''
|
||||||
lcount = 0
|
lcount = 0
|
||||||
for l in app.Description.splitlines():
|
for line in app.Description.splitlines():
|
||||||
if len(l) < 1:
|
if len(line) < 1:
|
||||||
lcount = 0
|
lcount = 0
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if l[0] == lchar and l[1] == ' ':
|
if line[0] == lchar and line[1] == ' ':
|
||||||
lcount += 1
|
lcount += 1
|
||||||
if lcount > 2 and lchar not in validchars:
|
if lcount > 2 and lchar not in validchars:
|
||||||
yield _("Description has a list (%s) but it isn't bulleted (*) nor numbered (#)") % lchar
|
yield _("Description has a list (%s) but it isn't bulleted (*) nor numbered (#)") % lchar
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
lchar = l[0]
|
lchar = line[0]
|
||||||
lcount = 1
|
lcount = 1
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -250,7 +250,7 @@ def scan_source(build_dir, build=metadata.Build()):
|
||||||
if is_used_by_gradle(line):
|
if is_used_by_gradle(line):
|
||||||
for name in suspects_found(line):
|
for name in suspects_found(line):
|
||||||
count += handleproblem('usual suspect \'%s\' at line %d' % (name, i + 1), path_in_build_dir, filepath)
|
count += handleproblem('usual suspect \'%s\' at line %d' % (name, i + 1), path_in_build_dir, filepath)
|
||||||
noncomment_lines = [l for l in lines if not common.gradle_comment.match(l)]
|
noncomment_lines = [line for line in lines if not common.gradle_comment.match(line)]
|
||||||
joined = re.sub(r'[\n\r\s]+', ' ', ' '.join(noncomment_lines))
|
joined = re.sub(r'[\n\r\s]+', ' ', ' '.join(noncomment_lines))
|
||||||
for m in gradle_mavenrepo.finditer(joined):
|
for m in gradle_mavenrepo.finditer(joined):
|
||||||
url = m.group(2)
|
url = m.group(2)
|
||||||
|
|
|
||||||
|
|
@ -492,12 +492,11 @@ def upload_apk_to_android_observatory(path):
|
||||||
href = m.group()
|
href = m.group()
|
||||||
|
|
||||||
page = 'https://androidobservatory.org'
|
page = 'https://androidobservatory.org'
|
||||||
message = ''
|
|
||||||
if href:
|
if href:
|
||||||
message = (_('Found {apkfilename} at {url}')
|
message = (_('Found {apkfilename} at {url}')
|
||||||
.format(apkfilename=apkfilename, url=(page + href)))
|
.format(apkfilename=apkfilename, url=(page + href)))
|
||||||
if message:
|
|
||||||
logging.debug(message)
|
logging.debug(message)
|
||||||
|
return
|
||||||
|
|
||||||
# upload the file with a post request
|
# upload the file with a post request
|
||||||
logging.info(_('Uploading {apkfilename} to androidobservatory.org')
|
logging.info(_('Uploading {apkfilename} to androidobservatory.org')
|
||||||
|
|
@ -512,9 +511,6 @@ def upload_to_virustotal(repo_section, virustotal_apikey):
|
||||||
import requests
|
import requests
|
||||||
requests # stop unused import warning
|
requests # stop unused import warning
|
||||||
|
|
||||||
logging.getLogger("urllib3").setLevel(logging.WARNING)
|
|
||||||
logging.getLogger("requests").setLevel(logging.WARNING)
|
|
||||||
|
|
||||||
if repo_section == 'repo':
|
if repo_section == 'repo':
|
||||||
if not os.path.exists('virustotal'):
|
if not os.path.exists('virustotal'):
|
||||||
os.mkdir('virustotal')
|
os.mkdir('virustotal')
|
||||||
|
|
@ -534,6 +530,9 @@ def upload_apk_to_virustotal(virustotal_apikey, packageName, apkName, hash,
|
||||||
versionCode, **kwargs):
|
versionCode, **kwargs):
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
|
logging.getLogger("urllib3").setLevel(logging.WARNING)
|
||||||
|
logging.getLogger("requests").setLevel(logging.WARNING)
|
||||||
|
|
||||||
outputfilename = os.path.join('virustotal',
|
outputfilename = os.path.join('virustotal',
|
||||||
packageName + '_' + str(versionCode)
|
packageName + '_' + str(versionCode)
|
||||||
+ '_' + hash + '.json')
|
+ '_' + hash + '.json')
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue