[parted-devel] Printing partition type in --machine output

Alberto Planas Dominguez aplanas at suse.com
Tue Nov 20 09:11:32 GMT 2018


On Monday, November 19, 2018 6:11:30 PM CET Phillip Susi wrote:
> On 11/16/2018 1:39 PM, Brian C. Lane wrote:
> > I wouldn't assume that, it all depends on how it's used and we have no
> > way to catalog that.
> 
> How it is *designed* to be used I think is what matters here.  It was
> intended to be both simple for machine parsing and extensible in a
> machine friendly way.  IIRC, it is just an array of fields separated by
> a colon, ripe for parsing with awk.  After parsing any existing fields
> any new, unrecognized fields should be ignored, which is why we can add
> new ones.

Oh, is this expectation documented, or is implicit? If is the first case of 
course I will change the code.

But I need to confess that very few parsers are aware of this expectation, and 
will break wherever we insert the new field.

As a note, I chose this position to be consistent with the non-machine output. 
In a first moment I submitted the patch for fix this inconsistency, as the 
parser that I was updating was expecting a similar order that the user 
friendly output.

-- 
SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Dilip Upmanyu, Graham 
Norton, HRB 21284 (AG Nürnberg)
Maxfeldstraße 5, 90409 Nürnberg, Germany





More information about the parted-devel mailing list