]> code.ossystems Code Review - openembedded-core.git/commitdiff
wic: fix path parsing, use last occurrence
authorGeorge McCollister <george.mccollister@gmail.com>
Thu, 10 Sep 2015 17:30:52 +0000 (12:30 -0500)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 18 Sep 2015 18:21:46 +0000 (19:21 +0100)
If the path contains 'scripts' more than once the first occurrence will be
incorrectly used. Use rfind instead of find to find the last occurrence.

Signed-off-by: George McCollister <george.mccollister@gmail.com>
scripts/lib/wic/plugin.py

index 41a80175ca0231f5384200ea434e712e5a49a23d..3acd5b480edc4c28789ae4773041e9a331412d49 100644 (file)
@@ -42,7 +42,7 @@ class PluginMgr(object):
 
     def __init__(self):
         wic_path = os.path.dirname(__file__)
-        eos = wic_path.find('scripts') + len('scripts')
+        eos = wic_path.rfind('scripts') + len('scripts')
         scripts_path = wic_path[:eos]
         self.scripts_path = scripts_path
         self.plugin_dir = scripts_path + PLUGIN_DIR