diff --git a/pkgmk.conf b/pkgmk.conf index b29e3ad..5762735 100644 --- a/pkgmk.conf +++ b/pkgmk.conf @@ -22,6 +22,7 @@ case ${PKGMK_ARCH} in ;; esac +# PKGMK_FULL_SOURCE_MIRRORS=() # PKGMK_SOURCE_MIRRORS=() # PKGMK_SOURCE_DIR="$PWD" # PKGMK_PACKAGE_DIR="$PWD" diff --git a/pkgmk.conf.5.in b/pkgmk.conf.5.in index 0af5900..dfadd9d 100644 --- a/pkgmk.conf.5.in +++ b/pkgmk.conf.5.in @@ -24,8 +24,15 @@ Set make options. .br Default: none .TP +\fBPKGMK_FULL_SOURCE_MIRRORS=('STRING')\fP +Set mirrors to check and download source archives from. +Those mirrors should accept full url's. +.br +Default: none +.TP \fBPKGMK_SOURCE_MIRRORS=('STRING')\fP Set mirrors to check and download source archives from. +Those mirrors should accept filenames only. .br Default: none .TP diff --git a/pkgmk.in b/pkgmk.in index 6789eae..13996ef 100755 --- a/pkgmk.in +++ b/pkgmk.in @@ -138,10 +138,9 @@ download_file() { error=1 - BASENAME=`get_basename $1` - for REPO in ${PKGMK_SOURCE_MIRRORS[@]}; do + for REPO in ${PKGMK_FULL_SOURCE_MIRRORS[@]}; do REPO="`echo $REPO | sed 's|/$||'`" - $PKGMK_DOWNLOAD_PROG $DOWNLOAD_OPTS $RESUME_OPTS $REPO/$BASENAME + $PKGMK_DOWNLOAD_PROG $DOWNLOAD_OPTS $RESUME_OPTS $REPO/$1 error=$? if [ $error == 0 ]; then break @@ -149,6 +148,18 @@ download_file() { done if [ $error != 0 ]; then + BASENAME=`get_basename $1` + for REPO in ${PKGMK_SOURCE_MIRRORS[@]}; do + REPO="`echo $REPO | sed 's|/$||'`" + $PKGMK_DOWNLOAD_PROG $DOWNLOAD_OPTS $RESUME_OPTS $REPO/$BASENAME + error=$? + if [ $error == 0 ]; then + break + fi + done + fi + + if [ $error != 0 ]; then while true; do $PKGMK_DOWNLOAD_PROG $DOWNLOAD_OPTS $RESUME_OPTS $1 error=$?