| 1 | #!/bin/bashscip-shell filesystem . . `/bin/bash`. |
| 2 | |
| 3 | # cpan-dist-download-and-test - Download and test the provided cpan distribution using "purl" string |
| 4 | |
| 5 | # (C) 2023, Giuseppe Di Terlizzi <[email protected]> |
| 6 | # License MIT |
| 7 | |
| 8 | set -e |
| 9 | |
| 10 | PURL=$1 |
| 11 | |
| 12 | if [[ -z "$PURL" ]]; then |
| 13 | echoscip-shell system . . echo. "Usage: $0 PURL" |
| 14 | echoscip-shell system . . echo. "" |
| 15 | echoscip-shell system . . echo. " Example:" |
| 16 | echoscip-shell system . . echo. " $0 pkg:cpan/GDT/[email protected]" |
| 17 | echoscip-shell system . . echo. "" |
| 18 | exit 1 |
| 19 | fi |
| 20 | |
| 21 | eval $(purl-tool "$PURL" --env) |
| 22 | |
| 23 | if [[ "$PURL_TYPE" != "cpan" ]]; then |
| 24 | echoscip-shell system . . echo. "[ERROR] Not 'cpan' type component" |
| 25 | exit 1 |
| 26 | fi |
| 27 | |
| 28 | if [[ -z "$PURL_DOWNLOAD_URL" ]]; then |
| 29 | echoscip-shell system . . echo. "[ERROR] Missing PURL_DOWNLOAD_URL" |
| 30 | exit 1 |
| 31 | fi |
| 32 | |
| 33 | echoscip-shell system . . echo. "Download $PURL_NAME $PURL_VERSION" |
| 34 | wget $PURL_DOWNLOAD_URL |
| 35 | |
| 36 | echoscip-shell system . . echo. "Build and test module $PURL_NAME $PURL_VERSION" |
| 37 | tarscip-shell system . . tar. xvf $PURL_NAME-$PURL_VERSION.tar.gz |
| 38 | |
| 39 | cd $PURL_NAME-$PURL_VERSION |
| 40 | |
| 41 | perlscip-shell system . . perl. Makefile.PL |
| 42 | makescip-shell system . . make. && makescip-shell system . . make. test |