Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 8793 Details for
Bug 16315
mirrorselect should use netselect to suggest the fastest servers
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Suggestion for "-p" mode
foo (text/plain), 2.22 KB, created by
David Held
on 2003-02-27 18:23:12 UTC
(
hide
)
Description:
Suggestion for "-p" mode
Filename:
MIME Type:
Creator:
David Held
Created:
2003-02-27 18:23:12 UTC
Size:
2.22 KB
patch
obsolete
>--- /root/mirrorselect.old 2003-02-27 18:07:41.000000000 -0500 >+++ /usr/sbin/mirrorselect 2003-02-27 18:17:44.000000000 -0500 >@@ -29,8 +29,20 @@ > ' > fi > >+while getopts ":ahips:" opt >+do >+ case $opt in >+ a ) echo "Using automatic mode."; MODE=auto;; >+ i ) echo "Using interactive mode."; MODE=user;; >+ p ) echo "Not changing config files."; NOUPDATE=1;; >+ s ) echo "Selecting $OPTARG servers."; SERVERS=$OPTARG;; >+ h ) ;; >+ * ) echo "Unimplemented option chosen.";; >+ esac >+done >+ > # if auto mode is set run netselect >-if [ "${1}" = "-a" ] ; then >+if [ "${MODE}" = "auto" ] ; then > echo "Fetching server list from web" > # nastiness, but it should work for now > MIRROR_LIST=$((echo -e "GET /main/en/mirrors.xml HTTP/0.9\r\n\r\n" 1>&3 & cat 0<&3) 3<> /dev/tcp/gentoo.org/80 | \ >@@ -42,15 +54,6 @@ > CHECKLIST="${CHECKLIST} `echo $i | grep -v "("`" > done > >- if [ "`echo ${2} | grep -e "^-s[01234567890]"`" ] ; then >- SERVERS="${2}" >- else >- if [ "${2}" ] ; then >- echo "${2} is an invalid option" >- exit >- fi >- fi >- > #pick the mirror from list > echo "Running netselect on serverlist, this may take a moment" > CHOSEN=`netselect $SERVERS ${CHECKLIST} | awk -F" " '{ print $2 }'` >@@ -59,7 +62,7 @@ > MIRRORS="${MIRRORS} $i" > done > >-elif [ "${1}" = "-i" ] ; then >+elif [ "${MODE}" = "user" ] ; then > # not auto mode, we'll run dialog based selection tool > # change "mirror (loc)" to "mirror(loc)" for bash loop below > MIRROR_LOCS=`echo $MIRROR_LIST | sed -e "s/ (/(/g"` >@@ -94,6 +97,7 @@ > > else > echo "mirrorselect usage (updated):" >+echo "-p : output the selected mirrors to stdout instead of making changes" > echo "-i : interactive mode, dialog based and static mirrorlist" > echo "-a (-s<num>) : auto mode, will retrieve live mirror list from web," > echo " run netselect and choose the server(s) with best response times." >@@ -121,6 +125,10 @@ > > echo "Selected: $MIRRORS" > >+if [ -n "$NOUPDATE" ] ; then >+ exit 0 >+fi >+ > # adjust settings in make.conf, all in one command to avoid complaints of make.conf being moved > mv /etc/make.conf /etc/make.conf.old && cat /etc/make.conf.old | egrep -e "^[^#]*GENTOO_MIRRORS=[^ \t\n]" -v > /etc/make.conf && \ > echo "GENTOO_MIRRORS=\"$MIRRORS\"" >> /etc/make.conf
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 16315
: 8793 |
18588