From 19d3cf81d3436a6600f261579b55b9132a6ca8fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benno=20F=C3=BCnfst=C3=BCck?= Date: Sun, 23 Apr 2017 19:22:06 +0200 Subject: [PATCH] rust: fix fetch-cargo-deps for git dependencies We need to make sure that `$revs` ends with a space, since files must always end with newlines. The previous code ignored the last entry in `$revs`, because read already returns non-zero exit code for the last entry, as it does not end with a space. --- pkgs/build-support/rust/fetch-cargo-deps | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/build-support/rust/fetch-cargo-deps b/pkgs/build-support/rust/fetch-cargo-deps index 76661a4f9ec..3c7e034364f 100755 --- a/pkgs/build-support/rust/fetch-cargo-deps +++ b/pkgs/build-support/rust/fetch-cargo-deps @@ -148,7 +148,7 @@ EOF cd "$out/git/checkouts/$name/$branch" rev="$(git rev-parse HEAD)" - revs="$revs $rev" + revs="$rev $revs" done < <(find . -type d -name .git -print) echo "List of revs to keep for git db $name: $revs" @@ -179,7 +179,7 @@ EOF done # Create ad-hoc branches for the revs we need - echo "$revs" | tr " " "\n" | while read -d " " rev; do + echo "$revs" | while read -d " " rev; do echo "Creating git branch b_$rev $rev" git branch b_$rev $rev done