Package linda :: Package parser :: Module arch
[hide private]

Source Code for Module linda.parser.arch

 1  import os 
 2  from linda.funcs import run_external_cmd 
 3   
4 -class ArchParser:
5 - def __init__(self):
6 self.arches = [] 7 tmp_arches = filter(lambda x: x.startswith('Known Debian Arch'), \ 8 run_external_cmd('dpkg-architecture --help 2>&1', 1).split('\n')) 9 if tmp_arches: 10 self.arches = tmp_arches[0].split(' are ')[1].split(', ') 11 else: 12 self.arches = run_external_cmd('dpkg-architecture -L').split('\n') 13 self.arches.append('all')
14
15 - def check(self, arch):
16 if arch in self.arches: 17 return 1 18 return 0
19