summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnas Nashif <nashif@linux.intel.com>2011-05-06 15:52:39 -0400
committerAnas Nashif <nashif@linux.intel.com>2011-05-06 15:52:39 -0400
commit85173883b3ad780f97dc0158281166c3e012cfcf (patch)
treeb004d78a02e5842b1186c80b37b6d13c361c0240
parent14f726c5ffa789c953f9f160c6e854ac253e49c7 (diff)
downloadkickstarter-85173883b3ad780f97dc0158281166c3e012cfcf.tar.gz
kickstarter-85173883b3ad780f97dc0158281166c3e012cfcf.tar.bz2
kickstarter-85173883b3ad780f97dc0158281166c3e012cfcf.zip
check for scripts before reading them
-rwxr-xr-xtools/kickstarter22
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 ]: