All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] wic/engine: include .wks.in in wic search and list
@ 2019-06-05 15:38 chee.yang.lee
  2019-06-05 18:56 ` Tom Rini
  0 siblings, 1 reply; 2+ messages in thread
From: chee.yang.lee @ 2019-06-05 15:38 UTC (permalink / raw)
  To: openembedded-core

From: Chee Yang Lee <chee.yang.lee@intel.com>

allow wic to list and search for kickstart file in .wks.in extension.
basename show by wic list images to fully exclude extension.

Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com>
---
 scripts/lib/wic/engine.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/scripts/lib/wic/engine.py b/scripts/lib/wic/engine.py
index 42e93c3..61939ad1 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):
             for fname in files:
                 if fname.endswith("~") or fname.endswith("#"):
                     continue
-                if fname.endswith(".wks") and wks_file + ".wks" == fname:
+                if ((fname.endswith(".wks") and wks_file + ".wks" == fname) or \
+                   (fname.endswith(".wks.in") and wks_file + ".wks.in" == fname)):
                     fullpath = os.path.join(canned_wks_dir, fname)
                     return fullpath
     return None
@@ -92,7 +93,7 @@ def list_canned_images(scripts_path):
             for fname in files:
                 if fname.endswith("~") or fname.endswith("#"):
                     continue
-                if fname.endswith(".wks"):
+                if fname.endswith(".wks") or fname.endswith(".wks.in"):
                     fullpath = os.path.join(canned_wks_dir, fname)
                     with open(fullpath) as wks:
                         for line in wks:
@@ -101,7 +102,7 @@ def list_canned_images(scripts_path):
                             if idx != -1:
                                 desc = line[idx + len("short-description:"):].strip()
                                 break
-                    basename = os.path.splitext(fname)[0]
+                    basename = fname.split('.')[0]
                     print("  %s\t\t%s" % (basename.ljust(30), desc))
 
 
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] wic/engine: include .wks.in in wic search and list
  2019-06-05 15:38 [PATCH] wic/engine: include .wks.in in wic search and list chee.yang.lee
@ 2019-06-05 18:56 ` Tom Rini
  0 siblings, 0 replies; 2+ messages in thread
From: Tom Rini @ 2019-06-05 18:56 UTC (permalink / raw)
  To: chee.yang.lee; +Cc: openembedded-core

[-- Attachment #1: Type: text/plain, Size: 386 bytes --]

On Wed, Jun 05, 2019 at 11:38:22PM +0800, chee.yang.lee@intel.com wrote:

> From: Chee Yang Lee <chee.yang.lee@intel.com>
> 
> allow wic to list and search for kickstart file in .wks.in extension.
> basename show by wic list images to fully exclude extension.
> 
> Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com>

Reviewed-by: Tom Rini <trini@konsulko.com>

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-06-05 18:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-05 15:38 [PATCH] wic/engine: include .wks.in in wic search and list chee.yang.lee
2019-06-05 18:56 ` Tom Rini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.