chiark
/
gitweb
/
~ianmdlvl
/
nailing-cargo.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9c05df9
)
better parsing, can cope with { } things
author
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Thu, 28 Feb 2019 16:02:20 +0000
(16:02 +0000)
committer
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Thu, 28 Feb 2019 16:02:20 +0000
(16:02 +0000)
fucking-cargo
patch
|
blob
|
history
diff --git
a/fucking-cargo
b/fucking-cargo
index 1a92c373ac6d483e7aa4586a6899ffaf401401b3..2250cd952368eb35fb26456fe66361a9c8b0842a 100755
(executable)
--- 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+='}
'