3
0
Fork 0
forked from mirrors/nixpkgs

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.
This commit is contained in:
Benno Fünfstück 2017-04-23 19:22:06 +02:00
parent 3dc0792ec6
commit 19d3cf81d3

View file

@ -148,7 +148,7 @@ EOF
cd "$out/git/checkouts/$name/$branch" cd "$out/git/checkouts/$name/$branch"
rev="$(git rev-parse HEAD)" rev="$(git rev-parse HEAD)"
revs="$revs $rev" revs="$rev $revs"
done < <(find . -type d -name .git -print) done < <(find . -type d -name .git -print)
echo "List of revs to keep for git db $name: $revs" echo "List of revs to keep for git db $name: $revs"
@ -179,7 +179,7 @@ EOF
done done
# Create ad-hoc branches for the revs we need # 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" echo "Creating git branch b_$rev $rev"
git branch b_$rev $rev git branch b_$rev $rev
done done