cpt-extra

Extra utilities for cpt
git clone git://git.carbslinux.org/cpt-extra
Log | Files | Refs | README | LICENSE

cpt-cargo-urlgen (582B)


      1 #!/bin/sh
      2 # Create static cargo sources for Rust packages
      3 
      4 # Copyright (C) 2020 - Dylan Araps.
      5 # Copyright (C) 2020 - Cem Keylan.
      6 # Distributed under the terms of the MIT License
      7 
      8 case "$1" in ''|--help|-h) printf '\033[1;33m-> \033[m%s\n' "usage: ${0##*/} [crate+ver] [crate+ver]"; exit 0 ; esac
      9 
     10 # We convert the name-version seperator from '+' to '-' to
     11 # avoid issues that may arise from version numbers that include
     12 # a '-'.
     13 
     14 for crate in "$@"; do
     15     printf 'https://static.crates.io/crates/%s/%s.crate vendor\n' \
     16         "${crate%+*}" "$(echo "$crate" | sed 's/+/-/')"
     17 done