From: Ian Jackson Date: Thu, 28 Feb 2019 16:02:20 +0000 (+0000) Subject: better parsing, can cope with { } things X-Git-Tag: nailing-cargo/1.0.0~251 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=891855452a18472f103421787e8c5893dd89bffe;p=nailing-cargo.git better parsing, can cope with { } things --- diff --git a/fucking-cargo b/fucking-cargo index 1a92c37..2250cd9 100755 --- a/fucking-cargo +++ b/fucking-cargo @@ -27,8 +27,12 @@ exec 204<../Fuck while read <&204 what where; do if [ "x$what" = x- ]; then continue; fi qwhere="${where//\//\\/}" - sed+=' s/^'$what' *=.*/'$what' = { path = "..\/'"${qwhere}"'" }/; -' + sed+=' + s/^'$what' *= *\(\".*\"\) *$/'$what' = { version = \1 }/; + s/^'$what' *= *{/'$what' = { path = "..\/'"${qwhere}"'", /; + /^'$what' *=/ s/version *= *\"[^"]*\"//; + /^'$what' *=/ s/, *\([,}]\)/\1/; + ' done sed+='} '