コード例 #1
0
 def _line_split(line, source_base):
     if line.count(':') < 2:
         return None
     ls = line.split(' ', 1)
     fname = ls[0].strip().split(':', 2)
     if len(fname) != 3:
         return None
     p = path.abspath(fname[0])
     p = p.replace(source_base, '')
     if path.isabspath(p):
         p = p[1:]
     if len(fname[2]) == 0:
         pos = None
     else:
         pos = fname[2]
     return p, fname[1], pos, ls[1]
コード例 #2
0
ファイル: check.py プロジェクト: vivek9191/rtems-tools
 def output(self, text):
     for l in text.splitlines():
         if ' warning:' in l:
             self.count += 1
             ws = l.split(' ')
             if len(ws) > 0:
                 ws = ws[0].split(':')
                 w = path.abspath(ws[0])
                 w = w.replace(self.rtems, '')
                 if path.isabspath(w):
                     w = w[1:]
                 w = '%s:%s:%s' % (w, ws[1], ws[2])
                 if w not in self.warnings:
                     self.warnings[w] = 0
                 self.warnings[w] += 1
     log.output(text)
コード例 #3
0
 def output(self, text):
     for l in text.splitlines():
         if ' warning:' in l:
             self.count += 1
             ws = l.split(' ')
             if len(ws) > 0:
                 ws = ws[0].split(':')
                 w = path.abspath(ws[0])
                 w = w.replace(self.rtems, '')
                 if path.isabspath(w):
                     w = w[1:]
                 #
                 # Ignore compiler option warnings.
                 #
                 if len(ws) >= 3:
                     w = '%s:%s:%s' % (w, ws[1], ws[2])
                     if w not in self.warnings:
                         self.warnings[w] = 0
                     self.warnings[w] += 1
     log.output(text)
コード例 #4
0
ファイル: check.py プロジェクト: thelunatic/rtems-tools
def _check_exe(_opts, macro, value, constraint, silent=False):

    if len(value) == 0 or constraint == 'none':
        return True

    orig_value = value

    if path.isabspath(value):
        if path.isfile(value):
            return True
        if os.name == 'nt':
            if path.isfile('%s.exe' % (value)):
                return True
        value = path.basename(value)
        absexe = True
    else:
        absexe = False

    paths = os.environ['PATH'].split(os.pathsep)

    if _check_paths(value, paths):
        if absexe:
            if not silent:
                log.notice(
                    'warning: exe: absolute exe found in path: (%s) %s' %
                    (macro, orig_value))
        return True

    if constraint == 'optional':
        if not silent:
            log.trace('warning: exe: optional exe not found: (%s) %s' %
                      (macro, orig_value))
        return True

    if not silent:
        log.notice('error: exe: not found: (%s) %s' % (macro, orig_value))
    return False