add --no-install option to build command (fail instead). complements
#2346. this is only for CLI and for decent users ;). Now we can build two (or more) packages parallel :).
This commit is contained in:
+8
-2
@@ -407,7 +407,7 @@ class Builder:
|
|||||||
os.chdir(curDir)
|
os.chdir(curDir)
|
||||||
|
|
||||||
def check_build_dependencies(self):
|
def check_build_dependencies(self):
|
||||||
"""fail if dependencies not satisfied"""
|
"""check and try to install build dependencies, otherwise fail."""
|
||||||
|
|
||||||
build_deps = self.spec.source.buildDependencies
|
build_deps = self.spec.source.buildDependencies
|
||||||
|
|
||||||
@@ -436,7 +436,13 @@ class Builder:
|
|||||||
if dep_unsatis:
|
if dep_unsatis:
|
||||||
ctx.ui.info(_("Unsatisfied Build Dependencies:") + ' '
|
ctx.ui.info(_("Unsatisfied Build Dependencies:") + ' '
|
||||||
+ util.strlist([str(x) for x in dep_unsatis]) )
|
+ util.strlist([str(x) for x in dep_unsatis]) )
|
||||||
|
|
||||||
|
def fail():
|
||||||
|
raise Error(_('Cannot build package due to unsatisfied build dependencies'))
|
||||||
|
|
||||||
|
if ctx.config.get_option('no_install'):
|
||||||
|
fail()
|
||||||
|
|
||||||
if not ctx.config.get_option('ignore_dependency'):
|
if not ctx.config.get_option('ignore_dependency'):
|
||||||
for dep in dep_unsatis:
|
for dep in dep_unsatis:
|
||||||
if not dependency.repo_satisfies_dep(dep):
|
if not dependency.repo_satisfies_dep(dep):
|
||||||
@@ -446,7 +452,7 @@ class Builder:
|
|||||||
ctx.ui.info(_('Installing build dependencies.'))
|
ctx.ui.info(_('Installing build dependencies.'))
|
||||||
operations.install([dep.package for dep in dep_unsatis])
|
operations.install([dep.package for dep in dep_unsatis])
|
||||||
else:
|
else:
|
||||||
raise Error(_('Cannot build package due to unsatisfied build dependencies'))
|
fail()
|
||||||
else:
|
else:
|
||||||
ctx.ui.warning(_('Ignoring build dependencies.'))
|
ctx.ui.warning(_('Ignoring build dependencies.'))
|
||||||
|
|
||||||
|
|||||||
+11
-4
@@ -364,6 +364,8 @@ unpack, setup, build, install, package
|
|||||||
default=True, help=_("automatically create a static package with ar files"))
|
default=True, help=_("automatically create a static package with ar files"))
|
||||||
self.parser.add_option("-g", "--create-debug", action="store_true",
|
self.parser.add_option("-g", "--create-debug", action="store_true",
|
||||||
default=True, help=_("automatically create a debug package with debug files"))
|
default=True, help=_("automatically create a debug package with debug files"))
|
||||||
|
self.parser.add_option("", "--no-install", action="store_true",
|
||||||
|
default=False, help=_("don't install build dependencies, fail if a build dependency is present"))
|
||||||
|
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
@@ -371,12 +373,17 @@ unpack, setup, build, install, package
|
|||||||
self.help()
|
self.help()
|
||||||
return
|
return
|
||||||
|
|
||||||
|
# We cant use ctx.get_option as we didn't init PiSi
|
||||||
if ctx.get_option('until'):
|
# currently...
|
||||||
if ctx.get_option('until') in Build.steps:
|
if self.options.until:
|
||||||
|
if not self.options.until in Build.steps:
|
||||||
raise Error(_('Step must be one of %s ') % pisi.util.strlist(Build.steps))
|
raise Error(_('Step must be one of %s ') % pisi.util.strlist(Build.steps))
|
||||||
|
|
||||||
self.init()
|
if self.options.no_install:
|
||||||
|
self.init(database=True, write=False)
|
||||||
|
else:
|
||||||
|
self.init()
|
||||||
|
|
||||||
if ctx.get_option('output_dir'):
|
if ctx.get_option('output_dir'):
|
||||||
ctx.ui.info(_('Output directory: %s') % ctx.config.options.output_dir)
|
ctx.ui.info(_('Output directory: %s') % ctx.config.options.output_dir)
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user