[pacman-dev] Fwd: [PATCH] rankmirrors: Add a --repo option to target a specific repo
--- scripts/rankmirrors.sh.in | 19 ++++++++++++++----- 1 files changed, 14 insertions(+), 5 deletions(-) diff --git a/scripts/rankmirrors.sh.in b/scripts/rankmirrors.sh.in index d5cbadd..9b4e973 100644 --- a/scripts/rankmirrors.sh.in +++ b/scripts/rankmirrors.sh.in @@ -35,6 +35,7 @@ usage() { echo " -t, --times only output mirrors and their response times" echo " -u, --url test a specific url" echo " -v, --verbose be verbose in ouptut" + echo " -r, --repo specify a specific repo name instead of guessing" exit 0 } @@ -69,13 +70,18 @@ ARCH="$(uname -m)" getfetchurl() { local strippedurl="${1%/}" - local replacedurl="${strippedurl//'$repo'/core}" - replacedurl="${replacedurl//'$arch'/$ARCH}" + local replacedurl="${replacedurl//'$arch'/$ARCH}" + if [[ ! $TARGETREPO ]]; then + replacedurl="${strippedurl//'$repo'/core}" + local tmp="${replacedurl%/*}" + tmp="${tmp%/*}" - local tmp="${replacedurl%/*}" - tmp="${tmp%/*}" + local reponame="${tmp##*/}" + else + replacedurl="${strippedurl//'$repo'/$TARGETREPO}" + local reponame="$TARGETREPO" + fi - local reponame="${tmp##*/}" if [[ -z $reponame || $reponame = $replacedurl ]]; then echo "fail" else @@ -119,6 +125,7 @@ while [[ $1 ]]; do times) TIMESONLY=1 ; shift ;; verbose) VERBOSE=1 ; shift ;; url) CHECKURL=1; [[ $2 ]] || err "Must specify url."; URL="$2"; shift 2;; + repo) [[ $2 ]] || err "Must specify repo name."; TARGETREPO="$2"; shift 2;; *) err "\`$1' is an invalid argument." esac elif [[ ${1:0:1} = - ]]; then @@ -136,6 +143,7 @@ while [[ $1 ]]; do t) TIMESONLY=1 ;; v) VERBOSE=1 ;; u) CHECKURL=1; [[ $2 ]] || err "Must specify url."; URL="$2"; snum=2;; + r) [[ $2 ]] || err "Must specify repo name."; TARGETREPO="$2"; snum=2;; n) [[ $2 ]] || err "Must specify number." ; NUM="$2" ; snum=2;; *) err "\`-$1' is an invald argument." ;; esac @@ -182,6 +190,7 @@ for line in "${linearray[@]}"; do # Getting values and times and such server="${line#*= }" + server="${server%%#*}" url="$(getfetchurl "$server")" [[ $url = fail ]] && err "url \`$URL' is malformed." time=$(gettime "$url") -- 1.7.1
On Thu, May 13, 2010 at 6:24 PM, Daenyth Blank <daenyth+arch@gmail.com> wrote:
--- scripts/rankmirrors.sh.in | 19 ++++++++++++++----- 1 files changed, 14 insertions(+), 5 deletions(-)
This is still busted, unfortunately. :/ 1. No Signed-off-by line. 2. Still base64 encoded. 3. Tabs got converted into spaces making this unapplyable even after I run it through `openssl enc -d -base64` in a vim filter. -Dan
On Fri, May 14, 2010 at 16:13, Dan McGee <dpmcgee@gmail.com> wrote:
On Thu, May 13, 2010 at 6:24 PM, Daenyth Blank <daenyth+arch@gmail.com> wrote:
--- scripts/rankmirrors.sh.in | 19 ++++++++++++++----- 1 files changed, 14 insertions(+), 5 deletions(-)
This is still busted, unfortunately. :/
1. No Signed-off-by line. 2. Still base64 encoded. 3. Tabs got converted into spaces making this unapplyable even after I run it through `openssl enc -d -base64` in a vim filter.
-Dan
Sorry, forgot about those issues.. Attached here with proper signoff line. I think gmail is what's causing the encoding issues and tab/space conversions... I'll make sure to send as an attachment from now on.
On Sat, May 15, 2010 at 2:44 PM, Daenyth Blank <daenyth+arch@gmail.com> wrote:
Sorry, forgot about those issues.. Attached here with proper signoff line. I think gmail is what's causing the encoding issues and tab/space conversions... I'll make sure to send as an attachment from now on.
Did you follow http://wiki.archlinux.org/index.php/Super_Quick_Git_Guide#Sending_patches ?
On Sat, May 15, 2010 at 08:48, Xavier Chantry <chantry.xavier@gmail.com> wrote:
Did you follow http://wiki.archlinux.org/index.php/Super_Quick_Git_Guide#Sending_patches ?
I'm using send-email, but routing it through gmail rather than a local smtp server. The problem is that it can't send with the +arch that I'm subscribed as, so I've been forwarding the copy that gets sent to my address (mailman drops the other since it lacks the +arch). Not sure of the best way to handle it. Could resubscribe under my regular name, but I'd rather not just for that... I'll try to figure something out.
On Sat, May 15, 2010 at 2:57 PM, Daenyth Blank <daenyth+arch@gmail.com> wrote:
On Sat, May 15, 2010 at 08:48, Xavier Chantry <chantry.xavier@gmail.com> wrote:
Did you follow http://wiki.archlinux.org/index.php/Super_Quick_Git_Guide#Sending_patches ?
I'm using send-email, but routing it through gmail rather than a local smtp server. The problem is that it can't send with the +arch that I'm subscribed as, so I've been forwarding the copy that gets sent to my address (mailman drops the other since it lacks the +arch). Not sure of the best way to handle it. Could resubscribe under my regular name, but I'd rather not just for that... I'll try to figure something out.
If you mean that you tried git smtp client directly, then try to debug /usr/lib/git-core/git-send-email to see what happens with the + :) Did you try to quote / escape it differently ? Otherwise, try msmtp, it's quite simple to setup, just follow the wiki.
On Sat, May 15, 2010 at 09:17, Xavier Chantry <chantry.xavier@gmail.com> wrote:
If you mean that you tried git smtp client directly, then try to debug /usr/lib/git-core/git-send-email to see what happens with the + :) Did you try to quote / escape it differently ?
Otherwise, try msmtp, it's quite simple to setup, just follow the wiki.
I looked at the code already, and I think it's the gmail server that's stripping it and sending it without. I think that you can only use the "send as" option from the web interface... If I'm wrong, someone please correct me. I'd rather not use msmtp since I don't want to keep my password in plaintext on the system.
On Sat 15 May 2010 09:28 -0400, Daenyth Blank wrote:
On Sat, May 15, 2010 at 09:17, Xavier Chantry <chantry.xavier@gmail.com> wrote:
If you mean that you tried git smtp client directly, then try to debug /usr/lib/git-core/git-send-email to see what happens with the + :) Did you try to quote / escape it differently ?
Otherwise, try msmtp, it's quite simple to setup, just follow the wiki.
I looked at the code already, and I think it's the gmail server that's stripping it and sending it without. I think that you can only use the "send as" option from the web interface... If I'm wrong, someone please correct me. I'd rather not use msmtp since I don't want to keep my password in plaintext on the system.
Hah. You're making things too hard on yourself. You're going to need to yield somewhere to get your patches in. You could always erase the password after you've sent the patch.
On Sat, May 15, 2010 at 3:28 PM, Daenyth Blank <daenyth+arch@gmail.com> wrote:
On Sat, May 15, 2010 at 09:17, Xavier Chantry <chantry.xavier@gmail.com> wrote:
If you mean that you tried git smtp client directly, then try to debug /usr/lib/git-core/git-send-email to see what happens with the + :) Did you try to quote / escape it differently ?
Otherwise, try msmtp, it's quite simple to setup, just follow the wiki.
I looked at the code already, and I think it's the gmail server that's stripping it and sending it without. I think that you can only use the "send as" option from the web interface... If I'm wrong, someone please correct me. I'd rather not use msmtp since I don't want to keep my password in plaintext on the system.
I don't get it, from the point of view of smtp, there is just a user and password, so just use the +arch one as user. About the password, where do you want to store it ? If you don't want to store it, you don't have to.
From man msmtp :
auth [(on|off|method)] This command enables or disables SMTP authentication. You should not need to set the method yourself; with the argument on, msmtp will choose the best one available for you (see below). You probably need to set a username (with user) and password (with password). If no password is set but one is needed during authentication, msmtp will try to find it in ~/.netrc. If that fails, it will try to find it in SYSCONFDIR/netrc (use --version to find out what SYSCONFDIR is on your platform). If that fails, it will try to get it from a system specific keychain (if avail‐ able). If that fails but a controlling terminal is available, msmtp will prompt you for it. Currently supported keychains are the GNOME keychain and the Mac OS X keychain. See the EXAMPLES section below. Can you show us how exactly you configured git smtp client and/or other smtp clients you tried ?
On Sat, May 15, 2010 at 09:43, Xavier Chantry <chantry.xavier@gmail.com> wrote:
I don't get it, from the point of view of smtp, there is just a user and password, so just use the +arch one as user. I've tried that in my .gitconofig, and it still sends as daenyth@
About the password, where do you want to store it ? If you don't want to store it, you don't have to. Wow, I didn't realize that, Last time I set up msmtp the wiki said you had to store the password in the config file. I'll look into this again.
Can you show us how exactly you configured git smtp client and/or other smtp clients you tried ?
.gitcoonfig: [sendemail] smtpencryption = tls smtpserver = smtp.gmail.com smtpuser = Daenyth+Arch@gmail.com smtpserverport = 587 chainreplyto = false Sending email works, it's sending from the +arch bit that fails. On Sat, May 15, 2010 at 09:31, Loui Chang <louipc.ist@gmail.com> wrote:
You must be doing something wrong. I don't think `git send-email` sends attachments. I use esmtp to send mail from my gmail address and I have no problems there. It doesn't send attachments, I'm doing that by hand at the moment since forwarding the copy send-email gives me ruins the whitespace/encoding.
On Sat, May 15, 2010 at 09:40, Loui Chang <louipc.ist@gmail.com> wrote:
Hah. You're making things too hard on yourself. You're going to need to yield somewhere to get your patches in. Looking like that's the case. :P
On Sat, May 15, 2010 at 09:43, Xavier Chantry <chantry.xavier@gmail.com> wrote:
Can you show us how exactly you configured git smtp client and/or other smtp clients you tried ?
Just tried using msmtp, it also did not send with the +arch intact, even when setting "from" and "user" to include it. account gmail host smtp.gmail.com port 587 protocol smtp auth on from Daenyth@gmail.com user Daenyth@gmail.com tls on tls_starttls on tls_trust_file /usr/share/ca-certificates/mozilla/Equifax_Secure_CA.crt account gmail+arch :gmail from Daenyth+Arch@gmail.com user Daenyth+Arch@gmail.com daenyth@Muspelheimr ~ $ echo "testing msmtp via gmail" | msmtp -a gmail+arch daenyth+arch@gmail.com password for Daenyth+Arch@gmail.com at smtp.gmail.com: -- Date: Sat, 15 May 2010 07:00:25 -0700 (PDT) From: daenyth@gmail.com testing msmtp via gmail
On Sat, May 15, 2010 at 4:05 PM, Daenyth Blank <daenyth+arch@gmail.com> wrote:
On Sat, May 15, 2010 at 09:43, Xavier Chantry <chantry.xavier@gmail.com> wrote:
Can you show us how exactly you configured git smtp client and/or other smtp clients you tried ?
Just tried using msmtp, it also did not send with the +arch intact, even when setting "from" and "user" to include it.
account gmail host smtp.gmail.com port 587 protocol smtp auth on from Daenyth@gmail.com user Daenyth@gmail.com tls on tls_starttls on tls_trust_file /usr/share/ca-certificates/mozilla/Equifax_Secure_CA.crt
account gmail+arch :gmail from Daenyth+Arch@gmail.com user Daenyth+Arch@gmail.com
daenyth@Muspelheimr ~ $ echo "testing msmtp via gmail" | msmtp -a gmail+arch daenyth+arch@gmail.com password for Daenyth+Arch@gmail.com at smtp.gmail.com:
-- Date: Sat, 15 May 2010 07:00:25 -0700 (PDT) From: daenyth@gmail.com testing msmtp via gmail
Uh, I didn't even know about about that gmail special feature "plus addressing". You didn't mention that, I thought you created another full account. I learned it there : http://www.php.net/manual/fr/ref.mail.php#70912 I suppose gmail accounts cannot have + then ? So yeah it seems it's gmail smtp server that accepts name+foo address, but it drops the +foo part. And gmail web interface must do something special to talk to smtp server then. But you don't need a different address to filter messages from a mailing list. Or maybe you have other special needs.
On Sat, May 15, 2010 at 10:22, Xavier Chantry <chantry.xavier@gmail.com> wrote:
So yeah it seems it's gmail smtp server that accepts name+foo address, but it drops the +foo part. And gmail web interface must do something special to talk to smtp server then. This appears to be the case
But you don't need a different address to filter messages from a mailing list. Or maybe you have other special needs. I use it for organization, but I think if I make a second subscription to mailman without it, and set that to just never email me (so I don't get duplicates) I should be able to send it normally. I'll try that.
On Sat, May 15, 2010 at 10:26, Daenyth Blank <daenyth+arch@gmail.com> wrote:
On Sat, May 15, 2010 at 10:22, Xavier Chantry <chantry.xavier@gmail.com> wrote:
But you don't need a different address to filter messages from a mailing list. Or maybe you have other special needs. I use it for organization, but I think if I make a second subscription to mailman without it, and set that to just never email me (so I don't get duplicates) I should be able to send it normally. I'll try that.
This seems to have done the trick.
On Sat, May 15, 2010 at 4:22 PM, Xavier Chantry <chantry.xavier@gmail.com> wrote:
Uh, I didn't even know about about that gmail special feature "plus addressing". You didn't mention that, I thought you created another full account. I learned it there : http://www.php.net/manual/fr/ref.mail.php#70912 I suppose gmail accounts cannot have + then ?
So yeah it seems it's gmail smtp server that accepts name+foo address, but it drops the +foo part. And gmail web interface must do something special to talk to smtp server then.
But you don't need a different address to filter messages from a mailing list. Or maybe you have other special needs.
Just a correction from Dan, since no one did before : it's not a gmail special feature at all as the guy said in the above link, it's actually a standard that some providers and mail servers follow, and others violate. http://en.wikipedia.org/wiki/E-mail_address#Sub-addressing http://tools.ietf.org/html/rfc5233
On Sat 15 May 2010 08:57 -0400, Daenyth Blank wrote:
On Sat, May 15, 2010 at 08:48, Xavier Chantry <chantry.xavier@gmail.com> wrote:
Did you follow http://wiki.archlinux.org/index.php/Super_Quick_Git_Guide#Sending_patches ?
I'm using send-email, but routing it through gmail rather than a local smtp server. The problem is that it can't send with the +arch that I'm subscribed as, so I've been forwarding the copy that gets sent to my address (mailman drops the other since it lacks the +arch). Not sure of the best way to handle it. Could resubscribe under my regular name, but I'd rather not just for that... I'll try to figure something out.
You must be doing something wrong. I don't think `git send-email` sends attachments. I use esmtp to send mail from my gmail address and I have no problems there.
On Sat, May 15, 2010 at 7:44 AM, Daenyth Blank <daenyth+arch@gmail.com> wrote:
On Fri, May 14, 2010 at 16:13, Dan McGee <dpmcgee@gmail.com> wrote:
On Thu, May 13, 2010 at 6:24 PM, Daenyth Blank <daenyth+arch@gmail.com> wrote:
--- scripts/rankmirrors.sh.in | 19 ++++++++++++++----- 1 files changed, 14 insertions(+), 5 deletions(-)
This is still busted, unfortunately. :/
1. No Signed-off-by line. 2. Still base64 encoded. 3. Tabs got converted into spaces making this unapplyable even after I run it through `openssl enc -d -base64` in a vim filter.
-Dan
Sorry, forgot about those issues.. Attached here with proper signoff line. I think gmail is what's causing the encoding issues and tab/space conversions... I'll make sure to send as an attachment from now on.
Applied, thanks.
participants (4)
-
Daenyth Blank
-
Dan McGee
-
Loui Chang
-
Xavier Chantry