def check_trusted_projects(apiurl, projects): trusted = config['api_host_options'][apiurl]['trusted_prj'] tlen = len(trusted) for prj in projects: if not prj in trusted: print("\nThe build root needs packages from project '%s'." % prj) print("Note that malicious packages can compromise the build result or even your system.") r = raw_input(trustprompt % { 'project': prj }) if r == '1': print("adding '%s' to ~/.oscrc: ['%s']['trusted_prj']" % (prj, apiurl)) trusted.append(prj) elif r != '2': print("Well, good good bye then :-)") raise oscerr.UserAbort() if tlen != len(trusted): config['api_host_options'][apiurl]['trusted_prj'] = trusted conf.config_set_option(apiurl, 'trusted_prj', ' '.join(trusted))
def check_trusted_projects(apiurl, projects): trusted = config['api_host_options'][apiurl]['trusted_prj'] tlen = len(trusted) for prj in projects: if not prj in trusted: print("\nThe build root needs packages from project '%s'." % prj) print("Note that malicious packages can compromise the build result or even your system.") r = raw_input(trustprompt % { 'project': prj }) if r == '1': print("adding '%s' to ~/.oscrc: ['%s']['trusted_prj']" % (prj, apiurl)) trusted.append(prj) elif r != '2': print("Well, good good bye then :-)") raise oscerr.UserAbort() if tlen != len(trusted): config['api_host_options'][apiurl]['trusted_prj'] = trusted conf.config_set_option(apiurl, 'trusted_prj', ' '.join(trusted))