comment.
This commit is contained in:
@@ -28,6 +28,7 @@ class PisiBuild:
|
|||||||
self.sourceArchive = SourceArchive(self.ctx)
|
self.sourceArchive = SourceArchive(self.ctx)
|
||||||
|
|
||||||
def build(self):
|
def build(self):
|
||||||
|
"""Build the package in one shot."""
|
||||||
ui.info("Building PISI source package: %s\n" % self.spec.source.name)
|
ui.info("Building PISI source package: %s\n" % self.spec.source.name)
|
||||||
|
|
||||||
ui.info("Fetching source from: %s\n" % self.spec.source.archiveUri)
|
ui.info("Fetching source from: %s\n" % self.spec.source.archiveUri)
|
||||||
@@ -80,6 +81,8 @@ class PisiBuild:
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
def goToWorkDir(self, globals):
|
def goToWorkDir(self, globals):
|
||||||
|
"""Changes the current working directory to package_work_dir() for
|
||||||
|
actions.py to do its work."""
|
||||||
path = globals['WorkDir']
|
path = globals['WorkDir']
|
||||||
if path:
|
if path:
|
||||||
path = self.ctx.pkg_work_dir() + "/" + path
|
path = self.ctx.pkg_work_dir() + "/" + path
|
||||||
@@ -94,24 +97,43 @@ class PisiBuild:
|
|||||||
sys.exit()
|
sys.exit()
|
||||||
|
|
||||||
def configureSource(self, locals):
|
def configureSource(self, locals):
|
||||||
|
"""Calls the corresponding function in actions.py. This time its
|
||||||
|
const.setup_func which sets up the source tree for building.
|
||||||
|
|
||||||
|
setup_func is optional in actions.py. If its present it will
|
||||||
|
be called, if not nothing will be done."""
|
||||||
func = const.setup_func
|
func = const.setup_func
|
||||||
if func in locals:
|
if func in locals:
|
||||||
ui.info("Configuring %s...\n" % self.spec.source.name)
|
ui.info("Configuring %s...\n" % self.spec.source.name)
|
||||||
locals[func]()
|
locals[func]()
|
||||||
|
|
||||||
def buildSource(self, locals):
|
def buildSource(self, locals):
|
||||||
|
"""Calls the corresponding function in actions.py. This time its
|
||||||
|
const.build_func which builds the source.
|
||||||
|
|
||||||
|
build_func is optional in actions.py. If its present it will
|
||||||
|
be called, if not nothing will be done."""
|
||||||
func = const.build_func
|
func = const.build_func
|
||||||
if func in locals:
|
if func in locals:
|
||||||
ui.info("Building %s...\n" % self.spec.source.name)
|
ui.info("Building %s...\n" % self.spec.source.name)
|
||||||
locals[func]()
|
locals[func]()
|
||||||
|
|
||||||
def installSource(self, locals):
|
def installSource(self, locals):
|
||||||
|
"""Calls the corresponding function in actions.py. This time its
|
||||||
|
const.install_func which will install the build source.
|
||||||
|
|
||||||
|
install_func is _mandatory_ in actions.py. If its present it will
|
||||||
|
be called, if not package building process will _fail_."""
|
||||||
func = const.install_func
|
func = const.install_func
|
||||||
if func in locals:
|
if func in locals:
|
||||||
ui.info("Installing %s...\n" % self.spec.source.name)
|
ui.info("Installing %s...\n" % self.spec.source.name)
|
||||||
locals[func]()
|
locals[func]()
|
||||||
|
|
||||||
def genMetaDataXml(self, package):
|
def genMetaDataXml(self, package):
|
||||||
|
"""Generate the metadata.xml file for build source.
|
||||||
|
|
||||||
|
metadata.xml is composed of the information from specfile plus
|
||||||
|
some additional information."""
|
||||||
metadata = MetaData()
|
metadata = MetaData()
|
||||||
metadata.fromSpec(self.spec.source, package)
|
metadata.fromSpec(self.spec.source, package)
|
||||||
metadata.package.distribution = const.distribution
|
metadata.package.distribution = const.distribution
|
||||||
@@ -153,6 +175,8 @@ class PisiBuild:
|
|||||||
files.write(os.path.join(self.ctx.pkg_dir(), const.files_xml))
|
files.write(os.path.join(self.ctx.pkg_dir(), const.files_xml))
|
||||||
|
|
||||||
def buildPackages(self):
|
def buildPackages(self):
|
||||||
|
"""Build each package defined in PSPEC file. After this process there
|
||||||
|
will be .pisi files hanging around, AS INTENDED ;)"""
|
||||||
for package in self.spec.packages:
|
for package in self.spec.packages:
|
||||||
ui.info("** Building package %s\n" % package.name);
|
ui.info("** Building package %s\n" % package.name);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user