Explorar el Código

support/download: accept manifest path as a post-process option

Now we have the post-process options, we can use them to pass the
manifest path instead of passing it through an environment variable.

For now, we support both. The environment variable approach will be
removed again later.

Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Signed-off-by: Arnout Vandecappelle <arnout@mind.be>
Yann E. MORIN hace 1 año
padre
commit
03327ba224
Se han modificado 1 ficheros con 4 adiciones y 2 borrados
  1. 4 2
      support/download/cargo-post-process

+ 4 - 2
support/download/cargo-post-process

@@ -5,10 +5,12 @@ set -e
 # shellcheck source=helpers source-path=SCRIPTDIR
 . "${0%/*}/helpers"
 
-while getopts "n:o:" OPT; do
+manifest="${BR_CARGO_MANIFEST_PATH-Cargo.toml}"
+while getopts "n:o:m:" OPT; do
     case "${OPT}" in
     o)  output="${OPTARG}";;
     n)  base_name="${OPTARG}";;
+    m)  manifest="${OPTARG}";;
     :)  error "option '%s' expects a mandatory argument\n" "${OPTARG}";;
     \?) error "unknown option '%s'\n" "${OPTARG}";;
     esac
@@ -29,7 +31,7 @@ mkdir -p .cargo/
 mkdir -p "${CARGO_HOME}"
 flock "${CARGO_HOME}"/.br-lock \
 cargo vendor \
-    --manifest-path "${BR_CARGO_MANIFEST_PATH-Cargo.toml}" \
+    --manifest-path "${manifest}" \
     --locked VENDOR \
     > .cargo/config