summaryrefslogtreecommitdiff
path: root/scripts/buildhistory-collect-srcrevs
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2013-08-15 18:04:40 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-08-16 11:38:50 +0100
commit64aa7d0b53f6ad45ab1a2121e917d7a512097407 (patch)
treece3f81a754cd408c57e575c04b240c28b1bddd3f /scripts/buildhistory-collect-srcrevs
parent5e2be70e89820ffc74208d225fe4414fe5182050 (diff)
downloadopenembedded-core-64aa7d0b53f6ad45ab1a2121e917d7a512097407.tar.gz
openembedded-core-64aa7d0b53f6ad45ab1a2121e917d7a512097407.tar.bz2
openembedded-core-64aa7d0b53f6ad45ab1a2121e917d7a512097407.zip
buildhistory-collect-srcrevs: match new buildhistory-diff command line parsing
* Default buildhistory directory to buildhistory/ under the current directory and require an option to set it * Show a description in the help output Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/buildhistory-collect-srcrevs')
-rwxr-xr-xscripts/buildhistory-collect-srcrevs17
1 files changed, 11 insertions, 6 deletions
diff --git a/scripts/buildhistory-collect-srcrevs b/scripts/buildhistory-collect-srcrevs
index 7f65c90376..58a2708032 100755
--- a/scripts/buildhistory-collect-srcrevs
+++ b/scripts/buildhistory-collect-srcrevs
@@ -34,8 +34,9 @@ logger = logger_create()
def main():
parser = optparse.OptionParser(
+ description = "Collects the recorded SRCREV values from buildhistory and reports on them.",
usage = """
- %prog [options] <buildhistory-dir>""")
+ %prog [options]""")
parser.add_option("-a", "--report-all",
help = "Report all SRCREV values, not just ones where AUTOREV has been used",
@@ -43,16 +44,20 @@ def main():
parser.add_option("-f", "--forcevariable",
help = "Use forcevariable override for all output lines",
action="store_true", dest="forcevariable")
+ parser.add_option("-p", "--buildhistory-dir",
+ help = "Specify path to buildhistory directory (defaults to buildhistory/ under cwd)",
+ action="store", dest="buildhistory_dir", default='buildhistory/')
options, args = parser.parse_args(sys.argv)
- if len(args) != 2:
+ if len(args) > 1:
+ sys.stderr.write('Invalid argument(s) specified: %s\n\n' % ' '.join(args[1:]))
parser.print_help()
sys.exit(1)
- buildhistory_dir = args[1]
- if not os.path.exists(buildhistory_dir):
- logger.error('specified buildhistory path %s could not be found' % buildhistory_dir)
+ if not os.path.exists(options.buildhistory_dir):
+ sys.stderr.write('Buildhistory directory "%s" does not exist\n\n' % options.buildhistory_dir)
+ parser.print_help()
sys.exit(1)
if options.forcevariable:
@@ -61,7 +66,7 @@ def main():
forcevariable = ''
lastdir = ''
- for root, dirs, files in os.walk(buildhistory_dir):
+ for root, dirs, files in os.walk(options.buildhistory_dir):
if '.git' in dirs:
dirs.remove('.git')
for fn in files: