Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add architecture_file parameter to pkg_deb #390

Merged
merged 1 commit into from
Jul 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions pkg/pkg.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -271,9 +271,18 @@ def _pkg_deb_impl(ctx):
"--changes=" + changes_file.path,
"--data=" + ctx.file.data.path,
"--package=" + ctx.attr.package,
"--architecture=" + ctx.attr.architecture,
"--maintainer=" + ctx.attr.maintainer,
]

# Version and description can be specified by a file or inlined
if ctx.attr.architecture_file:
if ctx.attr.architecture != "all":
fail("Both architecture and architecture_file attributes were specified")
args += ["--architecture=@" + ctx.file.architecture_file.path]
files += [ctx.file.architecture_file]
else:
args += ["--architecture=" + ctx.attr.architecture]

if ctx.attr.preinst:
args += ["--preinst=@" + ctx.file.preinst.path]
files += [ctx.file.preinst]
Expand Down Expand Up @@ -493,7 +502,15 @@ pkg_deb_impl = rule(
doc = "Package name",
mandatory = True,
),
"architecture": attr.string(default = "all"),
"architecture_file": attr.label(
doc = """File that contains the package architecture.
Must not be used with architecture.""",
allow_single_file = True,
),
"architecture": attr.string(
default = "all",
doc = """Package architecture. Must not be used with architecture_file.""",
),
"distribution": attr.string(default = "unstable"),
"urgency": attr.string(default = "medium"),
"maintainer": attr.string(mandatory = True),
Expand Down
2 changes: 1 addition & 1 deletion pkg/private/make_deb.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ def main():
description=helpers.GetFlagValue(options.description),
maintainer=helpers.GetFlagValue(options.maintainer),
section=options.section,
architecture=options.architecture,
architecture=helpers.GetFlagValue(options.architecture),
depends=GetFlagValues(options.depends),
suggests=options.suggests,
enhances=options.enhances,
Expand Down