Make negative narinfo responses much smaller

[?]
Apr 23, 2013, 1:33 PM
HAI5TY47TDWH3KGW6JPMZ3AB4EHJUFLUK7KZCLBOX6INVDQGG56QC

Dependencies

  • [2] UD2WKDUV Use queryPathFromHashPart to look up binary cache requests efficiently
  • [3] XE6HD7BP Provide the nix-cache-info file required by the binary cache substituter
  • [4] LSZLZHJY Allow users to edit their own settings
  • [5] MVB7RRLT * Move NARs from the NixChannel controller to the Root controller and
  • [6] SZYDW2DG hydra: added some user admin
  • [7] AFEKITYD Fix some warnings about undefined values
  • [8] IDT3SO3P Generate *.narinfo files on the fly to support the binary cache substituter
  • [*] J5UVLXOK * Start of a basic Catalyst web interface.

Change contents

  • replacement in src/lib/Hydra/Controller/Root.pm at line 218
    [3.684][3.0:42]()
    sub hashToPath {
    my ($c, $hash) = @_;
    [3.684]
    [3.42]
    sub narinfo :LocalRegex('^([a-z0-9]+).narinfo$') :Args(0) {
    my ($self, $c) = @_;
    my $hash = $c->req->captures->[0];
  • edit in src/lib/Hydra/Controller/Root.pm at line 224
    [2.45][2.45:146](),[2.146][3.468:470](),[3.468][3.468:470]()
    notFound($c, "Store path with hash ‘$hash’ does not exist.") unless $path;
    return $path;
    }
  • replacement in src/lib/Hydra/Controller/Root.pm at line 225
    [3.471][3.471:532](),[3.532][3.193:218](),[3.193][3.193:218](),[3.218][3.533:624]()
    sub narinfo :LocalRegex('^([a-z0-9]+).narinfo$') :Args(0) {
    my ($self, $c) = @_;
    my $hash = $c->req->captures->[0];
    $c->stash->{storePath} = hashToPath($c, $hash);
    [3.471]
    [3.624]
    if (!$path) {
    $c->response->content_type('text/plain');
    $c->stash->{'plain'}->{'data'} = "does not exist\n";
    $c->forward('Hydra::View::Plain');
    }
    $c->stash->{storePath} = $path;