summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnas Nashif <anas.nashif@intel.com>2012-05-06 13:58:18 +0100
committerAnas Nashif <anas.nashif@intel.com>2012-05-06 13:58:18 +0100
commit115cece465b47ee4b4f0d201e1147aa0265ac7ae (patch)
treea2e1742181d4551bc02d3961fd04510168f96922
parent9b15d6f9c6a636baedd7a078d4ab60ed1d733a3b (diff)
downloadkickstarter-115cece465b47ee4b4f0d201e1147aa0265ac7ae.tar.gz
kickstarter-115cece465b47ee4b4f0d201e1147aa0265ac7ae.tar.bz2
kickstarter-115cece465b47ee4b4f0d201e1147aa0265ac7ae.zip
fixed pathes
-rw-r--r--kswriter/KSWriter.py17
1 files changed, 9 insertions, 8 deletions
diff --git a/kswriter/KSWriter.py b/kswriter/KSWriter.py
index 7db3a62..69e228c 100644
--- a/kswriter/KSWriter.py
+++ b/kswriter/KSWriter.py
@@ -55,29 +55,30 @@ class KSWriter():
conf.update(lvald)
#print conf
postscript = ""
+ meta_root = os.path.dirname(self.image_filename)
for scr in conf['PostScripts']:
- if os.path.exists('./custom/scripts/%s.post' %scr):
- f = open('./custom/scripts/%s.post' %scr, 'r')
+ if os.path.exists('%s/custom/scripts/%s.post' %(meta_root, scr)):
+ f = open('%s/custom/scripts/%s.post' %(meta_root, scr), 'r')
postscript += f.read()
postscript += "\n"
f.close()
else:
- print './custom/scripts/%s.post not found, skipping.' %scr
+ print '%s/custom/scripts/%s.post not found, skipping.' %(meta_root,scr )
nochrootscript = ""
for scr in conf['NoChrootScripts']:
- if os.path.exists('./custom/scripts/%s.nochroot' %scr):
- f = open('./custom/scripts/%s.nochroot' %scr, 'r')
+ if os.path.exists('%s/custom/scripts/%s.nochroot' %(meta_root,scr)):
+ f = open('%s/custom/scripts/%s.nochroot' %(meta_root, scr ), 'r')
nochrootscript += f.read()
nochrootscript += "\n"
f.close()
else:
- print './custom/scripts/%s.nochroot not found, skipping.' %scr
+ print '%s/custom/scripts/%s.nochroot not found, skipping.' %(meta_root, scr )
ptab = ""
for g in [ plat, img ]:
if g.has_key("Part"):
- f = open("./custom/part/%s" %g['Part'] )
+ f = open("%s/custom/part/%s" %(meta_root, g['Part']) )
ptab = f.read()
f.close()
@@ -133,7 +134,7 @@ class KSWriter():
for path in self.image_meta['ExternalConfigs']:
external_config_dir = os.path.join(os.path.dirname(self.image_filename), path)
- for f in os.listdir(external_config_dir)):
+ for f in os.listdir(external_config_dir):
if f.endswith('.yaml'):
fp = file('%s/%s' %(external_config_dir, f), 'r')
local = yaml.load(fp)