[pacman-dev] [PATCH] rankmirrors: Add a --repo option to target a specific repo

Daenyth Blank daenyth+arch at gmail.com
Fri May 7 16:42:34 CEST 2010


On Fri, May 7, 2010 at 10:17, Loui Chang <louipc.ist at gmail.com> wrote:
> I think your email client is causing a problem. It's attaching patches
> as application/octet-stream base64 encoded.
Just using gmail... Dunno what's wrong.

> But the patch seems to work fine for me.
> Here I re-attach inline as text/plain.
>
>
> >From 3aa3f9ce824bb0797ffe13d2b2e6eb82049b19a1 Mon Sep 17 00:00:00 2001
> From: Daenyth <Daenyth+Arch at gmail.com>
> Date: Sat, 20 Mar 2010 15:03:45 -0400
> Subject: [PATCH] rankmirrors: Add a --repo option to target a specific repo
>
> @@ -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
I think this is wrong now that I look at it. Should be [[ !
$TARGETREPO ]]. I'll fix and re-send later today.

> +               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


More information about the pacman-dev mailing list