diff options
| author | Tom Rini <[email protected]> | 2015-02-16 08:37:22 -0500 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2015-02-16 08:37:22 -0500 |
| commit | 95776391852147ea5c2e8ac01613a20c6583bc33 (patch) | |
| tree | cb12cf255025fc8261cc751731621f6ba0bf1711 /tools | |
| parent | eca99c02566534940b95ee77b6ea1f098da93adc (diff) | |
| parent | e50ab22984ce90ffcc47bc620ed2caac0bcc02f7 (diff) | |
Merge branch 'sandbox' of git://git.denx.de/u-boot-x86
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/buildman/toolchain.py | 9 | ||||
| -rw-r--r-- | tools/patman/gitutil.py | 2 | ||||
| -rw-r--r-- | tools/patman/settings.py | 27 |
3 files changed, 33 insertions, 5 deletions
diff --git a/tools/buildman/toolchain.py b/tools/buildman/toolchain.py index d4c5d4a11eb..537797ad53e 100644 --- a/tools/buildman/toolchain.py +++ b/tools/buildman/toolchain.py @@ -197,13 +197,14 @@ class Toolchains: Returns: Filename of C compiler if found, else None """ + fnames = [] for subdir in ['.', 'bin', 'usr/bin']: dirname = os.path.join(path, subdir) if verbose: print " - looking in '%s'" % dirname for fname in glob.glob(dirname + '/*gcc'): if verbose: print " - found '%s'" % fname - return fname - return None + fnames.append(fname) + return fnames def Scan(self, verbose): @@ -219,8 +220,8 @@ class Toolchains: if verbose: print 'Scanning for tool chains' for path in self.paths: if verbose: print " - scanning path '%s'" % path - fname = self.ScanPath(path, verbose) - if fname: + fnames = self.ScanPath(path, verbose) + for fname in fnames: self.Add(fname, True, verbose) def List(self): diff --git a/tools/patman/gitutil.py b/tools/patman/gitutil.py index c593070d67e..4c2c35bf9ac 100644 --- a/tools/patman/gitutil.py +++ b/tools/patman/gitutil.py @@ -129,7 +129,7 @@ def GetUpstream(git_dir, branch): return upstream, msg if remote == '.': - return merge + return merge, None elif remote and merge: leaf = merge.split('/')[-1] return '%s/%s' % (remote, leaf), None diff --git a/tools/patman/settings.py b/tools/patman/settings.py index 122e8fd9811..ba2a68ff63f 100644 --- a/tools/patman/settings.py +++ b/tools/patman/settings.py @@ -235,6 +235,31 @@ def _UpdateDefaults(parser, config): else: print "WARNING: Unknown setting %s" % name +def _ReadAliasFile(fname): + """Read in the U-Boot git alias file if it exists. + + Args: + fname: Filename to read. + """ + if os.path.exists(fname): + bad_line = None + with open(fname) as fd: + linenum = 0 + for line in fd: + linenum += 1 + line = line.strip() + if not line or line.startswith('#'): + continue + words = line.split(' ', 2) + if len(words) < 3 or words[0] != 'alias': + if not bad_line: + bad_line = "%s:%d:Invalid line '%s'" % (fname, linenum, + line) + continue + alias[words[1]] = [s.strip() for s in words[2].split(',')] + if bad_line: + print bad_line + def Setup(parser, project_name, config_fname=''): """Set up the settings module by reading config files. @@ -244,6 +269,8 @@ def Setup(parser, project_name, config_fname=''): for sections named "project_section" as well. config_fname: Config filename to read ('' for default) """ + # First read the git alias file if available + _ReadAliasFile('doc/git-mailrc') config = _ProjectConfigParser(project_name) if config_fname == '': config_fname = '%s/.patman' % os.getenv('HOME') |
