4 # CARGO='../fucking-cargo/fucking-cargo cargo' make && make check CARGO='../fucking-cargo/fucking-cargo cargo'
7 # Why do we need this ?
9 # https://stackoverflow.com/questions/33025887/how-to-use-a-local-unpublished-crate
10 # https://github.com/rust-lang/cargo/issues/1481
13 lock=${PWD%/*}/.fuck.lock
14 if [ "x$FUCKING_CARGO" != "x$lock" ]; then
16 exec with-lock-ex -w "$lock" "$0" "$@"
23 /^ *\[dependencies\]/,/^ \[/{
27 while read <&204 what where; do
28 if [ "x$what" = x- ]; then continue; fi
29 qwhere="${where//\//\\/}"
31 s/^'$what' *= *\(\".*\"\) *$/'$what' = { version = \1 }/;
32 s/^'$what' *= *{/'$what' = { path = "..\/'"${qwhere}"'", /;
33 /^'$what' *=/ s/version *= *\"[^"]*\"//;
34 /^'$what' *=/ s/, *\([,}]\)/\1/;
41 while read <&204 what where; do
44 sed <$wf >$wf.fucking~ "$sed"
48 while read <&204 what where; do
50 if ! test -e $wf.unfucked~; then
57 while read <&203 what where; do
59 if test -e $wf.unfucked~; then
62 mv -f $wf.unfucked~ $wf
70 while read <&204 what where; do
72 printf >&2 ' %s' "$what"
73 if cmp -s $wf.fucked~ $wf.fucking~; then
77 mv -f $wf.fucking~ $wf