build,specfile: Implement support for build flags
Currently, it supports two flags: noDebug, noDelta.
The usage is simple:
<Package>
...
<BuildFlags>
<Flag>noDebug</Flag>
<Flag>noDelta</Flag>
</BuildFlags>
...
</Package>
noDebug flag is used to disable building of a debug package for this
package tag.
noDelta flag is used to disable building of delta packages
automatically. It doesn't change the behaviour of "pisi delta" command.
This commit is contained in:
@@ -1001,6 +1001,9 @@ class Builder:
|
||||
if ctx.config.values.build.generatedebug:
|
||||
debug_packages = []
|
||||
for package in self.spec.packages:
|
||||
if "noDebug" in package.buildFlags:
|
||||
continue
|
||||
|
||||
obj = self.generate_debug_package_object(package)
|
||||
if obj:
|
||||
debug_packages.append(obj)
|
||||
@@ -1126,7 +1129,11 @@ class Builder:
|
||||
# FIXME Remove this hack
|
||||
pkg.metadata.package.debug_package = package.debug_package
|
||||
|
||||
delta_packages = self.build_delta_packages(pkg)
|
||||
if "noDelta" not in package.buildFlags:
|
||||
delta_packages = self.build_delta_packages(pkg)
|
||||
else:
|
||||
delta_packages = []
|
||||
|
||||
self.delta_map[name] = delta_packages
|
||||
|
||||
pkg.close()
|
||||
|
||||
@@ -232,6 +232,7 @@ class Package:
|
||||
t_PartOf = [autoxml.String, autoxml.optional]
|
||||
t_License = [ [autoxml.String], autoxml.optional]
|
||||
t_Icon = [ autoxml.String, autoxml.optional]
|
||||
t_BuildFlags = [[autoxml.String], autoxml.optional, "BuildFlags/Flag"]
|
||||
t_BuildType = [ autoxml.String, autoxml.optional ]
|
||||
t_BuildDependencies = [[pisi.dependency.Dependency], autoxml.optional]
|
||||
t_PackageDependencies = [ [pisi.dependency.Dependency], autoxml.optional, "RuntimeDependencies/Dependency"]
|
||||
|
||||
Reference in New Issue
Block a user