Skip to content

Commit ee931df

Browse files
committed
Bump version to 1.25.0
2 parents 93cb710 + 456cc59 commit ee931df

File tree

6 files changed

+45
-9
lines changed

6 files changed

+45
-9
lines changed

CHANGELOG

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
CHANGELOG
22
`````````
33

4+
Version 1.25.0 -- 2022-05-18
5+
----------------------------
6+
- Fix litani run.json and litani outcome-table.json man pages
7+
8+
- Keep litani.7 at the first index in report
9+
10+
11+
- Accept lists of input/output files embedded in JSON files
12+
13+
414
Version 1.24.0 -- 2022-04-14
515
----------------------------
616
- Do not create HTML docs of Litani man pages if a flag is specified

doc/configure

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ def man_to_html(man_name, man_out, builds):
134134
def convert_man_dir_to_man(
135135
src_dir, dst_dir, rule, html_mans, builds, gen_html, extra_inputs=None):
136136
for man in (src_dir).iterdir():
137-
man_name = str(man.name).split(".", 1)[0]
137+
man_name = man.stem
138138
if man.suffix == ".scdoc":
139139
with open(man) as fp:
140140
line = fp.readline().rstrip()
@@ -206,6 +206,10 @@ def main():
206206

207207
add_litani_7(builds, html_mans, args.gen_html)
208208

209+
for h in html_mans:
210+
if "litani.7" in h.name:
211+
html_mans.insert(0, html_mans.pop(html_mans.index(h)))
212+
209213
if args.gen_html:
210214
builds.append({
211215
"inputs": html_mans + [

doc/src/man/litani-add-job.scdoc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ configure times.
7171

7272
*--inputs* _F_ [_F_ ...]
7373
A list of inputs that this job depends on. Litani interprets each _F_ as a file:
74+
- If _F_ starts with @, then treat the remainder of the file name as JSON
75+
file containing a list of files, which in turn are to be handled as
76+
specified in the following items.
7477
- If every _F_ exists and has an older timestamp than all of this job's
7578
outputs, then Litani will not run this job.
7679
- If some of the _F_ are newer than any of this job's outputs, then those
@@ -81,7 +84,8 @@ configure times.
8184
out-of-date files, then the build will fail.
8285

8386
*--outputs* _F_ [_F_ ...]
84-
A list of outputs that this job emits. Litani interprets each _F_ as a file,
87+
A list of outputs that this job emits. Litani interprets each _F_ as a file
88+
(or a JSON file if prefixed with @, as described for *--inputs* above),
8589
and expects that the command will write a file with that name upon completion.
8690
If a job _J_ has _F_ as an output, but does not actually write a file called
8791
_F_, then _J_ will run unconditionally because _F_ will always be considered

lib/graph.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,12 +177,12 @@ def build(self):
177177
args["command"])
178178
self.nodes.add(cmd_node)
179179

180-
for inputt in args.get("inputs") or []:
180+
for inputt in lib.litani.expand_args(args.get("inputs")):
181181
in_node = lib.graph.DependencyNode(inputt)
182182
self.nodes.add(in_node)
183183
self.edges.add(lib.graph.Edge(src=in_node, dst=cmd_node))
184184

185-
for output in args.get("outputs") or []:
185+
for output in lib.litani.expand_args(args.get("outputs")):
186186
out_node = lib.graph.DependencyNode(output)
187187
self.nodes.add(out_node)
188188
self.edges.add(lib.graph.Edge(src=cmd_node, dst=out_node))
@@ -265,12 +265,12 @@ def __str__(self):
265265
args["pipeline_name"], args["description"], args["command"])
266266
nodes.add(cmd_node)
267267
if args["outputs"]:
268-
for output in args["outputs"]:
268+
for output in lib.litani.expand_args(args["outputs"]):
269269
out_node = DependencyNode(output)
270270
nodes.add(out_node)
271271
edges.add(Edge(src=cmd_node, dst=out_node))
272272
if args["inputs"]:
273-
for inputt in args["inputs"]:
273+
for inputt in lib.litani.expand_args(args["inputs"]):
274274
in_node = DependencyNode(inputt)
275275
nodes.add(in_node)
276276
edges.add(Edge(src=in_node, dst=cmd_node))

lib/litani.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
TIME_FORMAT_W = "%Y-%m-%dT%H:%M:%SZ"
3434
TIME_FORMAT_MS = "%Y-%m-%dT%H:%M:%S.%fZ"
3535
VERSION_MAJOR = 1
36-
VERSION_MINOR = 24
36+
VERSION_MINOR = 25
3737
VERSION_PATCH = 0
3838
RC = False
3939

@@ -269,3 +269,21 @@ def unlink_expired():
269269
# No need to release lock after deletion
270270
else:
271271
lock_dir.release()
272+
273+
274+
def expand_args(files):
275+
"""Produce a list of files by expanding any "@"-prefixed file names to their
276+
JSON-list contents.
277+
"""
278+
if not files:
279+
return []
280+
281+
result = []
282+
for f in files:
283+
if f.startswith("@"):
284+
with open(f[1:]) as json_file:
285+
result.extend(json.load(json_file))
286+
else:
287+
result.append(f)
288+
289+
return result

litani

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -444,8 +444,8 @@ def fill_out_ninja(cache, rules, builds, pools):
444444
pools[name] = depth
445445

446446
for entry in cache["jobs"]:
447-
outs = entry["outputs"] or []
448-
ins = entry["inputs"] or []
447+
outs = lib.litani.expand_args(entry["outputs"])
448+
ins = lib.litani.expand_args(entry["inputs"])
449449

450450
if "description" in entry:
451451
description = entry["description"]

0 commit comments

Comments
 (0)