Allow downloading file by filename

[?]
Jul 31, 2015, 3:50 PM
3TZGWQHOP4PQ5YSHETBXAHVQP5QNSPG7QREZCGQ4GF55DZSSHKZAC

Dependencies

  • [2] LZVO64YG Merge in the first bits of the API work
  • [3] MAOFG2TD * Allow omitting the product number if there is only one product in a
  • [4] LBNVQXUB * Build the /build stuff in a separate controller.
  • [5] 5NO7NCKT * Refactoring.
  • [6] NUIKDEHL * A quick hack to list the contents of various types of files (RPM,
  • [7] D3DIBMOK * For products that are directories (like manuals), allow a default
  • [8] XJFHFZCA * Provide some redirects to build products by type so that we can for

Change contents

  • replacement in src/lib/Hydra/Controller/Build.pm at line 200
    [3.188][3.0:44](),[2.4891][3.0:44](),[3.2343][3.0:44]()
    my ($self, $c, $productnr, @path) = @_;
    [2.4891]
    [3.0]
    my ($self, $c, $productRef, @path) = @_;
  • replacement in src/lib/Hydra/Controller/Build.pm at line 202
    [3.1][3.1:44]()
    $productnr = 1 if !defined $productnr;
    [3.1]
    [3.2398]
    $productRef = 1 if !defined $productRef;
  • replacement in src/lib/Hydra/Controller/Build.pm at line 204
    [3.2399][3.2399:2485](),[3.2485][3.45:129]()
    my $product = $c->stash->{build}->buildproducts->find({productnr => $productnr});
    notFound($c, "Build doesn't have a product #$productnr.") if !defined $product;
    [3.2399]
    [3.2572]
    my $product;
    if ($productRef =~ /^[0-9]+$/) {
    $product = $c->stash->{build}->buildproducts->find({productnr => $productRef});
    } else {
    $product = $c->stash->{build}->buildproducts->find({name => $productRef});
    @path = ($productRef, @path);
    }
    notFound($c, "Build doesn't have a product $productRef.") if !defined $product;