[OE-core] [PATCH 3/3] bitbake-prserv-tool: check file name
Robert Yang
liezhi.yang at windriver.com
Tue Oct 20 09:25:52 UTC 2015
Fixed:
$ bitbake-prserv-tool import /tmp/1
File "/path/to/lib/bb/parse/__init__.py", line 114, in handle(fn='/tmp/1', data=<bb.data_smart.DataSmart object at 0x2369bd0>, include=True):
return h['handle'](fn, data, include)
> raise ParseError("not a BitBake file", fn)
ParseError: ParseError in /tmp/1: not a BitBake file
But 1.conf works well, its help also shows "<file.conf>", so check the
filename and print proper error message.
Signed-off-by: Robert Yang <liezhi.yang at windriver.com>
---
scripts/bitbake-prserv-tool | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/scripts/bitbake-prserv-tool b/scripts/bitbake-prserv-tool
index 28c2416..dcfd7f2 100755
--- a/scripts/bitbake-prserv-tool
+++ b/scripts/bitbake-prserv-tool
@@ -86,6 +86,15 @@ do_migrate_localcount ()
[ $# -eq 0 ] && help && exit 1
+case $2 in
+*.conf)
+ ;;
+*)
+ echo ERROR: $2 must end with .conf!
+ exit 1
+ ;;
+esac
+
case $1 in
export)
do_export $2
--
1.7.9.5
More information about the Openembedded-core
mailing list