mirror of
https://github.com/Dasharo/systemd.git
synced 2026-03-06 15:02:31 -08:00
repart: Remove unnecessary newlines from JSON output
Before
```
➜ systemd git:(dissect-have-blkid) SYSTEMD_LOG_LEVEL=err build/systemd-repart --definitions definitions/ --dry-run=yes --empty=create --size=100M --json=pretty abc
[
{
"type" : "root-x86-64",
"label" : "root-x86-64",
"uuid" : "2f7c902c-6b2a-4b47-a44b-dca765f38cd2",
"file" : "root.conf",
"node" : "abc1",
"offset" : 1048576,
"old_size" : 0,
"raw_size" : 103788544,
"old_padding" : 0,
"raw_padding" : 0,
"activity" : "create"
}
]
➜ systemd git:(dissect-have-blkid)
```
After:
```
➜ systemd git:(repart-newlines) SYSTEMD_LOG_LEVEL=err build/systemd-repart --definitions definitions/ --dry-run=yes --empty=create --size=100M --json=pretty abc
[
{
"type" : "root-x86-64",
"label" : "root-x86-64",
"uuid" : "2f7c902c-6b2a-4b47-a44b-dca765f38cd2",
"file" : "root.conf",
"node" : "abc1",
"offset" : 1048576,
"old_size" : 0,
"raw_size" : 103788544,
"old_padding" : 0,
"raw_padding" : 0,
"activity" : "create"
}
]
➜ systemd git:(repart-newlines)
```
This commit is contained in:
committed by
Lennart Poettering
parent
03f5e9b221
commit
06c5a3847b
@@ -3460,11 +3460,12 @@ static int context_write_partition_table(
|
||||
|
||||
(void) context_dump_partitions(context, node);
|
||||
|
||||
putc('\n', stdout);
|
||||
|
||||
if (arg_json_format_flags & JSON_FORMAT_OFF)
|
||||
if (arg_json_format_flags & JSON_FORMAT_OFF) {
|
||||
putc('\n', stdout);
|
||||
(void) context_dump_partition_bar(context, node);
|
||||
putc('\n', stdout);
|
||||
putc('\n', stdout);
|
||||
}
|
||||
|
||||
fflush(stdout);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user