* actions -> actions.py

* kod içerisinde sihirli sabitler kullanmak yerine context.Constants'ı güncelemek
gerekir.
* bir takım indent hatası giderildi
This commit is contained in:
Barış Metin
2005-06-16 18:11:12 +00:00
parent 0ee4b856dd
commit 0ca62028af
3 changed files with 17 additions and 12 deletions
+13 -12
View File
@@ -49,10 +49,11 @@ class PisiBuild:
self.applyPatches()
try:
self.actionScript = open(os.path.dirname(self.ctx.pspecfile ) + '/' + 'actions').read()
specdir = os.path.dirname(self.ctx.pspecfile)
self.actionScript = open("/".join([specdir,self.ctx.const.actions_file])).read()
except IOError, e:
ui.error ("Action Script: %s\n" % e)
return
ui.error ("Action Script: %s\n" % e)
return
# FIXME: It's wrong to assume that unpacked archive
# will create a name-version top-level directory.
@@ -62,10 +63,10 @@ class PisiBuild:
locals = globals = {}
try:
exec compile(self.actionScript , "error", "exec") in locals,globals
exec compile(self.actionScript , "error", "exec") in locals,globals
except SyntaxError, e:
ui.error ("Error : %s\n" % e)
return
ui.error ("Error : %s\n" % e)
return
self.configureSource(locals)
self.buildSource(locals)
@@ -107,18 +108,18 @@ class PisiBuild:
def configureSource(self, locals):
if 'src_setup' in locals:
ui.info("Configuring %s...\n" % self.spec.source.name)
locals['src_setup']()
ui.info("Configuring %s...\n" % self.spec.source.name)
locals['src_setup']()
def buildSource(self, locals):
if 'src_build' in locals:
ui.info("Building %s...\n" % self.spec.source.name)
locals['src_build']()
ui.info("Building %s...\n" % self.spec.source.name)
locals['src_build']()
def installSource(self, locals):
if 'src_install' in locals:
ui.info("Installing %s...\n" % self.spec.source.name)
locals['src_install']()
ui.info("Installing %s...\n" % self.spec.source.name)
locals['src_install']()
def buildPackages(self):
for package in self.spec.packages:
+4
View File
@@ -34,6 +34,10 @@ class Constants:
self.c.build_work_dir_suffix = "/work"
self.c.build_install_dir_suffix = "/install"
# file/directory names
self.c.actions_file = "actions.py"
self.c.files_dir = "files"
def __getattr__(self, attr):
return getattr(self.c, attr)