From 273eee7a3614caea17c5bc93b720353641293cf7 Mon Sep 17 00:00:00 2001 From: Robert Yang Date: Wed, 11 Nov 2015 23:34:40 -0800 Subject: bitbake-prserv-tool: check file name Fixed: $ bitbake-prserv-tool import /tmp/1 File "/path/to/lib/bb/parse/__init__.py", line 114, in handle(fn='/tmp/1', data=, 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 or 1.inc works well, check the filename and print proper error message. Signed-off-by: Robert Yang Signed-off-by: Ross Burton --- scripts/bitbake-prserv-tool | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'scripts/bitbake-prserv-tool') diff --git a/scripts/bitbake-prserv-tool b/scripts/bitbake-prserv-tool index 28c2416bfe..fa31b52584 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|*.inc) + ;; +*) + echo ERROR: $2 must end with .conf or .inc! + exit 1 + ;; +esac + case $1 in export) do_export $2 -- cgit v1.2.3