[parted-devel] [PATCH] escape colon in machine output

Brian C. Lane bcl at redhat.com
Wed Aug 11 00:12:50 BST 2021


On Thu, Jul 29, 2021 at 10:22:35AM +0000, Arvin Schnell wrote:
> 
> Hi,
> 
> in the machine readable output of parted the fields are separated
> by colons. Several fields them self can contain colons, the
> device path, the device model and the partition name. The
> attached patch (already submitted 2017-11-07 in a bit different
> form) protects colons and backslashes using backslashes.

Thanks, I've pushed this to master.

> 
> In general supporting a standard format like JSON might also be
> interesting since it would allow to add new fields without
> risking to break existing parsers. E.g. in 2018 adding the
> partition type was suggested. I also have a patch to display
> max_primary_partition_count (which is not always 128 for GPT).
> If there is interest I could work on that.

I'd be fine with adding a --json option as long as it doesn't depend on
any new libraries, since it should be easy to generate json output with
printf.

Brian

-- 
Brian C. Lane (PST8PDT) - weldr.io - lorax - parted - pykickstart




More information about the parted-devel mailing list