mirror of
https://github.com/macports/mpbb.git
synced 2026-07-12 18:18:44 -07:00
wait-for-mirror: read credentials from a file
This commit is contained in:
@@ -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
|
||||
|
||||
+1
-1
@@ -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."
|
||||
|
||||
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user