diff options
author | Anas Nashif <nashif@linux.intel.com> | 2011-05-06 15:52:39 -0400 |
---|---|---|
committer | Anas Nashif <nashif@linux.intel.com> | 2011-05-06 15:52:39 -0400 |
commit | 85173883b3ad780f97dc0158281166c3e012cfcf (patch) | |
tree | b004d78a02e5842b1186c80b37b6d13c361c0240 | |
parent | 14f726c5ffa789c953f9f160c6e854ac253e49c7 (diff) | |
download | kickstarter-85173883b3ad780f97dc0158281166c3e012cfcf.tar.gz kickstarter-85173883b3ad780f97dc0158281166c3e012cfcf.tar.bz2 kickstarter-85173883b3ad780f97dc0158281166c3e012cfcf.zip |
check for scripts before reading them
-rwxr-xr-x | tools/kickstarter | 22 |
1 files 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 ]: |