summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2013-10-18 12:23:30 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-10-29 10:41:34 +0000
commit4ec1f8c0181b7f50214e64c39f0f69e991b49194 (patch)
tree9429591430cda0366082f28c143184051433cfca
parent8b42409dca729b7abbbdac04f533e161de86a3ef (diff)
downloadpoky-4ec1f8c0181b7f50214e64c39f0f69e991b49194.tar.gz
scripts/oe-pkgdata-util: check path arguments to ensure they exist
Show an error if the specified paths don't exist. (From OE-Core rev: eff2690f7976664e6257c1c19c89feea9152eb9e) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rwxr-xr-xscripts/oe-pkgdata-util12
1 files changed, 12 insertions, 0 deletions
diff --git a/scripts/oe-pkgdata-util b/scripts/oe-pkgdata-util
index e34fcbe079..01fccd2db0 100755
--- a/scripts/oe-pkgdata-util
+++ b/scripts/oe-pkgdata-util
@@ -37,6 +37,14 @@ def glob(args, usage):
37 pkglist_file = args[1] 37 pkglist_file = args[1]
38 globs = args[2].split() 38 globs = args[2].split()
39 39
40 if not os.path.exists(pkgdata_dir):
41 print('ERROR: Unable to find pkgdata directory %s' % pkgdata_dir)
42 sys.exit(1)
43
44 if not os.path.exists(pkglist_file):
45 print('ERROR: Unable to find package list file %s' % pkglist_file)
46 sys.exit(1)
47
40 skipregex = re.compile("-locale-|^locale-base-|-dev$|-doc$|-dbg$|-staticdev$|^kernel-module-") 48 skipregex = re.compile("-locale-|^locale-base-|-dev$|-doc$|-dbg$|-staticdev$|^kernel-module-")
41 49
42 mappedpkgs = set() 50 mappedpkgs = set()
@@ -148,6 +156,10 @@ def read_value(args, usage):
148 var = args[1] 156 var = args[1]
149 packages = args[2].split() 157 packages = args[2].split()
150 158
159 if not os.path.exists(pkgdata_dir):
160 print('ERROR: Unable to find pkgdata directory %s' % pkgdata_dir)
161 sys.exit(1)
162
151 def readvar(pkgdata_file, var): 163 def readvar(pkgdata_file, var):
152 val = "" 164 val = ""
153 with open(pkgdata_file, 'r') as f: 165 with open(pkgdata_file, 'r') as f: