summaryrefslogtreecommitdiffstats
path: root/scripts/lib
diff options
context:
space:
mode:
authorChee Yang Lee <chee.yang.lee@intel.com>2019-06-05 23:38:22 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-06-07 09:11:49 +0100
commitcc083399ce3378148d7e1d08a4df52b14e79903e (patch)
treeddfd3b367a3fef7504115da43a3a0d8811ba0dd7 /scripts/lib
parent9f348884ab7f25307cfecba65fe8a2b3c307e7af (diff)
downloadpoky-cc083399ce3378148d7e1d08a4df52b14e79903e.tar.gz
wic/engine: include .wks.in in wic search and list
allow wic to list and search for kickstart file in .wks.in extension. basename show by wic list images to fully exclude extension. (From OE-Core rev: 2c0a292a790ad069648e37b1b29fcea656fcf3e4) Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib')
-rw-r--r--scripts/lib/wic/engine.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/scripts/lib/wic/engine.py b/scripts/lib/wic/engine.py
index 42e93c3eb8..61939ad194 100644
--- a/scripts/lib/wic/engine.py
+++ b/scripts/lib/wic/engine.py
@@ -75,7 +75,8 @@ def find_canned_image(scripts_path, wks_file):
75 for fname in files: 75 for fname in files:
76 if fname.endswith("~") or fname.endswith("#"): 76 if fname.endswith("~") or fname.endswith("#"):
77 continue 77 continue
78 if fname.endswith(".wks") and wks_file + ".wks" == fname: 78 if ((fname.endswith(".wks") and wks_file + ".wks" == fname) or \
79 (fname.endswith(".wks.in") and wks_file + ".wks.in" == fname)):
79 fullpath = os.path.join(canned_wks_dir, fname) 80 fullpath = os.path.join(canned_wks_dir, fname)
80 return fullpath 81 return fullpath
81 return None 82 return None
@@ -92,7 +93,7 @@ def list_canned_images(scripts_path):
92 for fname in files: 93 for fname in files:
93 if fname.endswith("~") or fname.endswith("#"): 94 if fname.endswith("~") or fname.endswith("#"):
94 continue 95 continue
95 if fname.endswith(".wks"): 96 if fname.endswith(".wks") or fname.endswith(".wks.in"):
96 fullpath = os.path.join(canned_wks_dir, fname) 97 fullpath = os.path.join(canned_wks_dir, fname)
97 with open(fullpath) as wks: 98 with open(fullpath) as wks:
98 for line in wks: 99 for line in wks:
@@ -101,7 +102,7 @@ def list_canned_images(scripts_path):
101 if idx != -1: 102 if idx != -1:
102 desc = line[idx + len("short-description:"):].strip() 103 desc = line[idx + len("short-description:"):].strip()
103 break 104 break
104 basename = os.path.splitext(fname)[0] 105 basename = fname.split('.')[0]
105 print(" %s\t\t%s" % (basename.ljust(30), desc)) 106 print(" %s\t\t%s" % (basename.ljust(30), desc))
106 107
107 108