]> code.ossystems Code Review - openembedded-core.git/commitdiff
bitbake-prserv-tool: check file name
authorRobert Yang <liezhi.yang@windriver.com>
Thu, 12 Nov 2015 07:34:40 +0000 (23:34 -0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 25 Nov 2015 07:48:13 +0000 (07:48 +0000)
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 or 1.inc works well, check the filename and print proper
error message.

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
scripts/bitbake-prserv-tool

index 28c2416bfe0d8a68a467c8beb0db5f3ee65f24c0..fa31b52584ef20006ca222ad757c5db34412dc9e 100755 (executable)
@@ -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