Hi, I've just had a semi-serious problem related to blkid's "-o value"
format.
When I first discovered that output format, I assumed that it would be a
stable script-friendly output format intended for people who don't want
to parse the name/value pairs. The fields appeared to be
LABEL
UUID
TYPE
and I wrote a script assuming the third one was TYPE.
However, suddenly the output has changed to be
LABEL
UUID
SEC_TYPE <-- "ext2"
TYPE <-- "ext3"
which caused my script to mount a ext3 partition as ext2, killing the
journal.
Looking at the code, it appears that it iterates over some list coming
from libblkid and prints a line with the value only if the value
exists. So it appears that there was never any intention of it being a
stable output.
I would request that either the order of fields become stable by
printing empty lines for missing fields (and documented), or the "-o
value" be done away with, since I can't see any reason anyone would want
random output in a script-friendly format, and the fact that it exists
is likely to lead people astray.
Thoughts? Comments?
-Mike Conrad
--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html