forked from the-distro/channel-scripts
Add an empty file at the release prefix for nix-channel compatibility
nix-channel expects the prefix to exist (not return a 404).
This commit is contained in:
parent
d3d33d5b25
commit
fcf5a77736
1 changed files with 9 additions and 2 deletions
|
@ -161,10 +161,17 @@ if ($bucket->head_key("$releasePrefix/github-link")) {
|
||||||
$bucket->add_key_filename(
|
$bucket->add_key_filename(
|
||||||
$key, $fn,
|
$key, $fn,
|
||||||
{ content_type => $fn =~ /.sha256|src-url|binary-cache-url|git-revision/ ? "text/plain" : "application/octet-stream" })
|
{ content_type => $fn =~ /.sha256|src-url|binary-cache-url|git-revision/ ? "text/plain" : "application/octet-stream" })
|
||||||
or die $bucket->err . $bucket->errstr;
|
or die $bucket->err . ": " . $bucket->errstr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Add dummy files at $releasePrefix to prevent nix-channel from barfing.
|
||||||
|
for my $key ($releasePrefix, "$releasePrefix/") {
|
||||||
|
$bucket->add_key("$key", "nix-channel compatibility placeholder",
|
||||||
|
{ content_type => "text/plain" })
|
||||||
|
or die $bucket->err . ": " . $bucket->errstr;
|
||||||
|
}
|
||||||
|
|
||||||
# Make "github-link" a redirect to the GitHub history of this
|
# Make "github-link" a redirect to the GitHub history of this
|
||||||
# release.
|
# release.
|
||||||
my $link = "https://github.com/NixOS/nixpkgs-channels/commits/$rev";
|
my $link = "https://github.com/NixOS/nixpkgs-channels/commits/$rev";
|
||||||
|
@ -173,7 +180,7 @@ if ($bucket->head_key("$releasePrefix/github-link")) {
|
||||||
{ 'x-amz-website-redirect-location' => $link,
|
{ 'x-amz-website-redirect-location' => $link,
|
||||||
content_type => "text/plain"
|
content_type => "text/plain"
|
||||||
})
|
})
|
||||||
or die $bucket->err . $bucket->errstr;
|
or die $bucket->err . ": " . $bucket->errstr;
|
||||||
|
|
||||||
File::Path::remove_tree($tmpDir);
|
File::Path::remove_tree($tmpDir);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue