From 85173883b3ad780f97dc0158281166c3e012cfcf Mon Sep 17 00:00:00 2001 From: Anas Nashif Date: Fri, 6 May 2011 15:52:39 -0400 Subject: [PATCH] check for scripts before reading them --- tools/kickstarter | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/tools/kickstarter b/tools/kickstarter index da49735..188adc6 100755 --- a/tools/kickstarter +++ b/tools/kickstarter @@ -76,17 +76,23 @@ class KSWriter(): #print conf postscript = "" for scr in conf['PostScripts']: - f = open('./custom/scripts/%s.post' %scr, 'r') - postscript += f.read() - postscript += "\n" - f.close() + if os.path.exists('./custom/scripts/%s.post' %scr): + f = open('./custom/scripts/%s.post' %scr, 'r') + postscript += f.read() + postscript += "\n" + f.close() + else: + print './custom/scripts/%s.post not found, skipping.' %scr nochrootscript = "" for scr in conf['NoChrootScripts']: - f = open('./custom/scripts/%s.nochroot' %scr, 'r') - nochrootscript += f.read() - nochrootscript += "\n" - f.close() + if os.path.exists('./custom/scripts/%s.nochroot' %scr): + f = open('./custom/scripts/%s.nochroot' %scr, 'r') + nochrootscript += f.read() + nochrootscript += "\n" + f.close() + else: + print './custom/scripts/%s.nochroot not found, skipping.' %scr ptab = "" for g in [ plat, img ]: -- 2.7.4