From 5e367f14304e252c92bb2f5c4dda444a684f15f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fatih=20A=C5=9F=C4=B1c=C4=B1?= Date: Fri, 25 Mar 2011 13:31:45 +0000 Subject: [PATCH] build,specfile: Implement support for build flags Currently, it supports two flags: noDebug, noDelta. The usage is simple: ... noDebug noDelta ... 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. --- pisi/operations/build.py | 9 ++++++++- pisi/specfile.py | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/pisi/operations/build.py b/pisi/operations/build.py index 6e06f436..6c9003d2 100644 --- a/pisi/operations/build.py +++ b/pisi/operations/build.py @@ -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() diff --git a/pisi/specfile.py b/pisi/specfile.py index 2d5761b5..d1d2443a 100644 --- a/pisi/specfile.py +++ b/pisi/specfile.py @@ -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"]