mirror of
				https://github.com/f-droid/fdroidserver.git
				synced 2025-11-04 06:30:27 +03:00 
			
		
		
		
	Merge branch 'scanner-allow-non-zero-exit' into 'master'
feat(scanner): Allow non-zero-exit code if problems were found See merge request fdroid/fdroidserver!1342
This commit is contained in:
		
						commit
						6e62ea3614
					
				
					 1 changed files with 9 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -32,6 +32,7 @@ from tempfile import TemporaryDirectory
 | 
			
		|||
from pathlib import Path
 | 
			
		||||
from datetime import datetime, timedelta
 | 
			
		||||
from dataclasses import dataclass, field, fields
 | 
			
		||||
from enum import IntEnum
 | 
			
		||||
 | 
			
		||||
from . import _
 | 
			
		||||
from . import common
 | 
			
		||||
| 
						 | 
				
			
			@ -56,6 +57,10 @@ MAVEN_URL_REGEX = re.compile(r"""\smaven\s*(?:{.*?(?:setUrl|url)|\((?:url)?)\s*=
 | 
			
		|||
SCANNER_CACHE_VERSION = 1
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class ExitCode(IntEnum):
 | 
			
		||||
    NONFREE_CODE = 1
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def get_gradle_compile_commands(build):
 | 
			
		||||
    compileCommands = ['compile',
 | 
			
		||||
                       'provided',
 | 
			
		||||
| 
						 | 
				
			
			@ -781,6 +786,8 @@ def main():
 | 
			
		|||
                        help=_("Output JSON to stdout."))
 | 
			
		||||
    parser.add_argument("--refresh", "-r", action="store_true", default=False,
 | 
			
		||||
                        help=_("fetch the latest version of signatures from the web"))
 | 
			
		||||
    parser.add_argument("--exit-code", "-e", action="store_true", default=False,
 | 
			
		||||
                        help=_("Exit with a non-zero code if problems were found"))
 | 
			
		||||
    metadata.add_metadata_arguments(parser)
 | 
			
		||||
    options = parser.parse_args()
 | 
			
		||||
    metadata.warnings_action = options.W
 | 
			
		||||
| 
						 | 
				
			
			@ -815,6 +822,8 @@ def main():
 | 
			
		|||
            appids.append(apk)
 | 
			
		||||
 | 
			
		||||
    if not appids:
 | 
			
		||||
        if options.exit_code and probcount > 0:
 | 
			
		||||
            sys.exit(ExitCode.NONFREE_CODE)
 | 
			
		||||
        return
 | 
			
		||||
 | 
			
		||||
    # Read all app and srclib metadata
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue