I'd like to create a port of xsv [1], however there is a small problem
with cargo.mk at the moment. xsv depends on the csv 1.0.0-beta4 crate
i.e.
CARGO_CRATES= csv-1.0.0-beta4
When setting up MASTER_SITES, cargo.mk is a little too eager in
splitting the crate name and version in two at the moment. This means
that the wrong URL is being used e.g.
.../csv-1.0.0/beta4/download/...
instead of the correct one
../csv/1.0.0-beta4/download/...
Currently we use the following modifiers in generating the download
URL which appears to be too simplistic
${_crate:C/-?[^-]*$}/${_crate:C/^.*-}
After reading [2] I'm assuming that Cargo guarantees that the version
starts with a number. Crate names need to be a valid Rust identifier
(for extern crate declarations to work, so names can't start with a
-), so I hope changing that to
${_crate:C/-[0-9].*$//}/${_crate:C/^.*-([0-9].*)/\1/}
will solve this.
[1] https://github.com/BurntSushi/xsv
[2] http://doc.crates.io/manifest.html#the-version-field