diff --git a/mpbb b/mpbb index 7dfeabc..1432eef 100755 --- a/mpbb +++ b/mpbb @@ -60,7 +60,7 @@ parseopt prefix:,work-dir: "$@" || exit option_failcache_dir=${option_work_dir}/failcache option_license_db_dir=${option_work_dir}/license_db option_mirrordb_url="" -option_mirrordb_credentials="" +option_mirrordb_credentials_file="" # Inform the user if old repositories are still present. if [[ -d ${option_work_dir}/tools/.svn ]]; then diff --git a/mpbb-install-port b/mpbb-install-port index bcf5f8e..b5c5d06 100644 --- a/mpbb-install-port +++ b/mpbb-install-port @@ -75,7 +75,7 @@ install-port() { if [ -n "$option_mirrordb_url" ]; then echo "Waiting for '$port' to be mirrored." if "${option_prefix}/bin/port-tclsh" "${thisdir}/tools/wait-for-mirror.tcl" \ - "$option_mirrordb_url" "$option_mirrordb_credentials" "$port"; then + "$option_mirrordb_url" "$option_mirrordb_credentials_file" "$port"; then echo "Mirroring of '$port' done. Retrying fetch." if ! "${option_prefix}/bin/port" -d fetch "$@"; then echo "Second fetch of '$port' failed." diff --git a/tools/wait-for-mirror.tcl b/tools/wait-for-mirror.tcl index 148d491..8edc247 100755 --- a/tools/wait-for-mirror.tcl +++ b/tools/wait-for-mirror.tcl @@ -5,10 +5,18 @@ # periodically until it has been, or timeout is reached. if {$argc != 3} { - error "Usage: wait-for-mirror.tcl mirrorcache_baseurl mirrorcache_credentials portname" + error "Usage: wait-for-mirror.tcl mirrorcache_baseurl mirrorcache_credentials_file portname" } -lassign $argv mirrorcache_baseurl mirrorcache_credentials portname +lassign $argv mirrorcache_baseurl mirrorcache_credentials_file portname +try { + set fd [open $mirrorcache_credentials_file r] + set mirrorcache_credentials [gets $fd] + close $fd +} on error {eMessage} { + puts stderr "Failed to load credentials file '$mirrorcache_credentials_file': $eMessage" + exit 1 +} package require macports source [file join [file dirname [info script]] mirrordb.tcl]