buildifier++
This commit is contained in:
parent
7114396590
commit
6a765787a5
13
rules.bzl
13
rules.bzl
@ -61,8 +61,7 @@ def _lxcconfig_impl(ctx):
|
|||||||
runfiles = ctx.runfiles(files = ctx.files.src),
|
runfiles = ctx.runfiles(files = ctx.files.src),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def lxcbundle(name, src, version = ""):
|
||||||
def lxcbundle(name, src):
|
|
||||||
rootfsname = name + "/_/rootfs"
|
rootfsname = name + "/_/rootfs"
|
||||||
rootfs(name = rootfsname, src = src, out = rootfsname + ".tar")
|
rootfs(name = rootfsname, src = src, out = rootfsname + ".tar")
|
||||||
lxcconfig(name, src = src, out = name + "/_/meta.tar.xz")
|
lxcconfig(name, src = src, out = name + "/_/meta.tar.xz")
|
||||||
@ -70,15 +69,20 @@ def lxcbundle(name, src):
|
|||||||
name = name + "-rootfs",
|
name = name + "-rootfs",
|
||||||
srcs = [rootfsname],
|
srcs = [rootfsname],
|
||||||
outs = [rootfsname + ".tar.xz"],
|
outs = [rootfsname + ".tar.xz"],
|
||||||
cmd = "xz -f $< > $@",
|
cmd = "xz -T0 -f $< > $@",
|
||||||
message = "xz",
|
message = "XZ",
|
||||||
)
|
)
|
||||||
|
if version:
|
||||||
|
outname = "{}_{}.tar".format(name, version)
|
||||||
|
else:
|
||||||
|
outname = "{}.tar".format(name)
|
||||||
pkg_tar(
|
pkg_tar(
|
||||||
name = name,
|
name = name,
|
||||||
srcs = [
|
srcs = [
|
||||||
name + "-rootfs",
|
name + "-rootfs",
|
||||||
name + "-meta",
|
name + "-meta",
|
||||||
],
|
],
|
||||||
|
out = outname,
|
||||||
)
|
)
|
||||||
|
|
||||||
_lxcconfig = rule(
|
_lxcconfig = rule(
|
||||||
@ -90,7 +94,6 @@ _lxcconfig = rule(
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def lxcconfig(name, src, out = None):
|
def lxcconfig(name, src, out = None):
|
||||||
_lxcconfig(name = name + "/_/config", src = src)
|
_lxcconfig(name = name + "/_/config", src = src)
|
||||||
pkg_tar(
|
pkg_tar(
|
||||||
|
Loading…
Reference in New Issue
Block a user