diff --git a/mirror-nixos-branch.pl b/mirror-nixos-branch.pl index d966f6f..6afeed3 100755 --- a/mirror-nixos-branch.pl +++ b/mirror-nixos-branch.pl @@ -161,10 +161,17 @@ if ($bucket->head_key("$releasePrefix/github-link")) { $bucket->add_key_filename( $key, $fn, { 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 # release. 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, content_type => "text/plain" }) - or die $bucket->err . $bucket->errstr; + or die $bucket->err . ": " . $bucket->errstr; File::Path::remove_tree($tmpDir); }