Open jgeraerts opened 8 years ago
Just added 6f680e5 with a test which shows that it works.
Which version of Augeas are you using?
It is 1.2.0 (standard trusty package). I did some extra tests and i think it is due to the '\r' in my file cause it was edited on windows.
# augtool -At "Properties incl /tmp/test.properties"
augtool> print /augeas/files/tmp/test.properties/error
/augeas/files/tmp/test.properties/error = "parse_failed"
/augeas/files/tmp/test.properties/error/pos = "132"
/augeas/files/tmp/test.properties/error/line = "5"
/augeas/files/tmp/test.properties/error/char = "0"
/augeas/files/tmp/test.properties/error/lens = "/usr/share/augeas/lenses/dist/properties.aug:50.25-.100:"
/augeas/files/tmp/test.properties/error/message = "Iterated lens matched less than it should"
The failing properties file is attached. I 'll try to upgrade to the master version and see if i can reproduce it with master.
the master branch exhibits the same issue
$ ./augtool -I ../lenses/ -At "Properties incl /tmp/test.properties"
augtool> print /augeas/
context files/ load/ root save span variables version/
augtool> print /augeas/files/tmp/test.properties/error/
/augeas/files/tmp/test.properties/error = "parse_failed"
/augeas/files/tmp/test.properties/error/pos = "133"
/augeas/files/tmp/test.properties/error/line = "5"
/augeas/files/tmp/test.properties/error/char = "1"
/augeas/files/tmp/test.properties/error/lens = "../lenses/properties.aug:50.25-.100:"
/augeas/files/tmp/test.properties/error/lens/last_matched = "../lenses/util.aug:139.6-.14:"
/augeas/files/tmp/test.properties/error/lens/next_not_matched = "../lenses/util.aug:22.27-.34:"
/augeas/files/tmp/test.properties/error/message = "Iterated lens matched less than it should"
OK, that's more likely. Let's add a test for that and fix it with Util.dos_eol
and friends
Would that support files with mixed-lineends as well? I've seen those in the wild too.
Yes
The properties lens fails on a property file containing a single # character.