9 def call_program(args):
10 ''' Calls program with specified parameters and returns stdout '''
11 subp = subprocess.Popen(args, stdout=subprocess.PIPE, \
12 stderr=subprocess.PIPE)
13 stdout, stderr = subp.communicate()
17 def scan(params, files, max_args):
18 ''' Calls scanelf with given params and files to scan.
19 @param params is list of parameters that should be passed into scanelf app.
20 @param files list of files to scan.
21 @param max_args number of files to process at once
23 When files count is greater CMD_MAX_ARGS, it'll be divided
26 @return scanelf output (joined if was called several times)
29 for i in range(0, len(files), max_args):
30 out += call_program(['scanelf'] + params + files[i:i+max_args]).strip().split('\n')
34 def exithandler(signum, frame):
38 def get_masking_status(ebuild):
40 status = portage.getmaskingstatus(ebuild)
42 status = ['unavailable']
46 def _match_str_in_list(lst, stri):
54 if __name__ == '__main__':
55 print("There is nothing to run here.")