[6907] in Release_7.7_team

home help back first fref pref prev next nref lref last post

Re: Lucid update

daemon@ATHENA.MIT.EDU (Geoffrey Thomas)
Tue Aug 24 23:37:04 2010

Date: Tue, 24 Aug 2010 23:36:57 -0400 (EDT)
From: Geoffrey Thomas <geofft@MIT.EDU>
To: Jonathan Reed <jdreed@mit.edu>
cc: release-team@mit.edu
In-Reply-To: <alpine.DEB.1.10.1008242328010.26451@dr-wily.mit.edu>
Message-ID: <alpine.DEB.1.10.1008242333210.19881@dr-wily.mit.edu>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed

On Tue, 24 Aug 2010, Geoffrey Thomas wrote:

> On Sat, 21 Aug 2010, Jonathan Reed wrote:
>
>> Alternatively, do APT and friends play nice with HTTP 301?  We could set up 
>> http://debathena.mit.edu/ubuntu and http://debathena.mit.edu/debian to 
>> redirect to the mirrors of our choice.  If debathena.mit.edu is down, 
>> installs are pretty much useless anyway.
>
> From apt/methods/http.cc:
>
>   /* We have a reply we dont handle. This should indicate a perm server
>      failure */
>   if (Srv->Result < 200 || Srv->Result >= 300)
>   {
>      _error->Error("%u %s",Srv->Result,Srv->Code);
>      if (Srv->HaveContent == true)
>         return 4;
>      return 3;
>   }

My bad, I was looking at Lenny (apt 0.7.20.2+lenny2); apparently Ubuntu 
patched this in 0.7.20.2ubuntu1, so it is in Jaunty. (For completeness, 
yes, it's also in Lucid's version.)

    /* Redirect
     *
     * Note that it is only OK for us to treat all redirection the same
     * because we *always* use GET, not other HTTP methods.  There are
     * three redirection codes for which it is not appropriate that we
     * redirect.  Pass on those codes so the error handling kicks in.
     */
    if (AllowRedirect
        && (Srv->Result > 300 && Srv->Result < 400)
        && (Srv->Result != 300       // Multiple Choices
            && Srv->Result != 304    // Not Modified
            && Srv->Result != 306))  // (Not part of HTTP/1.1, reserved)
    {
       if (!Srv->Location.empty())
       {
          NextURI = Srv->Location;
          return 6;
       }
       /* else pass through for error message */
    }

So, we can in fact do this for cluster machines. You need to set 
Acquire::http::AllowRedirect, though, but we were talking about setting 
Acquire::Retries anyway, so we already wanted to put an apt.conf.d file in 
the installer and on cluster machines.

-- 
Geoffrey Thomas
geofft@mit.edu

home help back first fref pref prev next nref lref last post