diff options
author | Christopher Larson <chris_larson@mentor.com> | 2015-12-15 16:45:27 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-12-22 16:08:50 +0000 |
commit | 647e0e44cee05866bfdbba0625b772a5dfffcd6d (patch) | |
tree | 0ce53481dc221c49b891a1fa1c241a78753d056c /scripts/buildhistory-collect-srcrevs | |
parent | d4b5a1f171e5f76c5f9d376317d1f5b931f2d66e (diff) | |
download | poky-647e0e44cee05866bfdbba0625b772a5dfffcd6d.tar.gz |
buildhistory-collect-srcrevs: hide empty sections
Cc: Paul Eggleton <paul.eggleton@linux.intel.com>
(From OE-Core rev: 3c4de5430aff2d7443f064d698014615e867c58c)
Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/buildhistory-collect-srcrevs')
-rwxr-xr-x | scripts/buildhistory-collect-srcrevs | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/scripts/buildhistory-collect-srcrevs b/scripts/buildhistory-collect-srcrevs index 58a2708032..f3eb76bd0d 100755 --- a/scripts/buildhistory-collect-srcrevs +++ b/scripts/buildhistory-collect-srcrevs | |||
@@ -18,7 +18,9 @@ | |||
18 | # with this program; if not, write to the Free Software Foundation, Inc., | 18 | # with this program; if not, write to the Free Software Foundation, Inc., |
19 | # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | 19 | # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
20 | 20 | ||
21 | import os, sys | 21 | import collections |
22 | import os | ||
23 | import sys | ||
22 | import optparse | 24 | import optparse |
23 | import logging | 25 | import logging |
24 | 26 | ||
@@ -65,16 +67,13 @@ def main(): | |||
65 | else: | 67 | else: |
66 | forcevariable = '' | 68 | forcevariable = '' |
67 | 69 | ||
68 | lastdir = '' | 70 | all_srcrevs = collections.defaultdict(list) |
69 | for root, dirs, files in os.walk(options.buildhistory_dir): | 71 | for root, dirs, files in os.walk(options.buildhistory_dir): |
70 | if '.git' in dirs: | 72 | if '.git' in dirs: |
71 | dirs.remove('.git') | 73 | dirs.remove('.git') |
72 | for fn in files: | 74 | for fn in files: |
73 | if fn == 'latest_srcrev': | 75 | if fn == 'latest_srcrev': |
74 | curdir = os.path.basename(os.path.dirname(root)) | 76 | curdir = os.path.basename(os.path.dirname(root)) |
75 | if lastdir != curdir: | ||
76 | print('# %s' % curdir) | ||
77 | lastdir = curdir | ||
78 | fullpath = os.path.join(root, fn) | 77 | fullpath = os.path.join(root, fn) |
79 | pn = os.path.basename(root) | 78 | pn = os.path.basename(root) |
80 | srcrev = None | 79 | srcrev = None |
@@ -98,11 +97,20 @@ def main(): | |||
98 | name = splitval[0].split('_')[1].strip() | 97 | name = splitval[0].split('_')[1].strip() |
99 | srcrevs[name] = value | 98 | srcrevs[name] = value |
100 | if srcrev and (options.reportall or srcrev != orig_srcrev): | 99 | if srcrev and (options.reportall or srcrev != orig_srcrev): |
101 | print('SRCREV_pn-%s%s = "%s"' % (pn, forcevariable, srcrev)) | 100 | all_srcrevs[curdir].append((pn, None, srcrev)) |
102 | for name, value in srcrevs.items(): | 101 | for name, value in srcrevs.items(): |
103 | orig = orig_srcrevs.get(name, orig_srcrev) | 102 | orig = orig_srcrevs.get(name, orig_srcrev) |
104 | if options.reportall or value != orig: | 103 | if options.reportall or value != orig: |
105 | print('SRCREV_%s_pn-%s%s = "%s"' % (name, pn, forcevariable, value)) | 104 | all_srcrevs[curdir].append((pn, name, srcrev)) |
105 | |||
106 | for curdir, srcrevs in sorted(all_srcrevs.iteritems()): | ||
107 | if srcrevs: | ||
108 | print('# %s' % curdir) | ||
109 | for pn, name, srcrev in srcrevs: | ||
110 | if name: | ||
111 | print('SRCREV_%s_pn-%s%s = "%s"' % (name, pn, forcevariable, srcrev)) | ||
112 | else: | ||
113 | print('SRCREV_pn-%s%s = "%s"' % (pn, forcevariable, srcrev)) | ||
106 | 114 | ||
107 | 115 | ||
108 | if __name__ == "__main__": | 116 | if __name__ == "__main__": |