Richard W.M. Jones wrote: > Even with the -m and/or -s option which are supposely designed to make > parted machine-readable, it still mixes error messages and warnings on > stdout. In practice this makes it not machine-readable at all. > > Example: > > $ truncate -s 1M /tmp/test1.img > $ parted -m -- /tmp/test1.img unit b print > WARNING: You are not superuser. Watch out for permissions. > Error: /tmp/test1.img: unrecognised disk label > BYT; > /tmp/test1.img:1048576B:file:512:512:unknown:; > > The "WARNING:..." and "Error:..." lines go to stdout. > > These patches fix most of the problems, sending errors and warnings to > stderr where they belong. Parsing can now be attempted more sanely: > > $ ~/d/parted/parted/parted -m -- /tmp/test1.img unit b print 2>/dev/null > BYT; > /tmp/test1.img:1048576B:file:512:512:unknown:;
Thanks for the patches, and especially for taking the time to adapt the tests to the new behavior. I've applied them. _______________________________________________ parted-devel mailing list parted-devel@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/parted-devel