commit 29be95a3d38848315783fa632e4abbe04910d697 parent e8b5f7f93bd77d63e2bdadca79b233135474b383 Author: Cem Keylan <cem@ckyln.com> Date: Sat, 4 Apr 2020 19:56:55 +0300 kiss-cargo-urlgen: fix a bug that could lead to wrong url generation Diffstat:
M | contrib/kiss-cargo-urlgen | | | 8 | ++++++-- |
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/contrib/kiss-cargo-urlgen b/contrib/kiss-cargo-urlgen @@ -1,11 +1,15 @@ #!/bin/sh [ "$1" ] || { - printf 'usage: kiss-carg-urlgen [crate-ver] [crate-ver]\n' + printf 'usage: kiss-carg-urlgen [crate+ver] [crate+ver]\n' exit 1 } +# We convert the name-version seperator from '+' to '-' to +# avoid issues that may arise from version numbers that include +# a '-'. + for crate in "$@"; do printf 'https://static.crates.io/crates/%s/%s.crate vendor\n' \ - "${crate%-*}" "$crate" + "${crate%+*}" "$(echo "$crate" | sed 's/+/-/')" done