Fix copy-tarballs.pl
This commit is contained in:
parent
fbd7d43c39
commit
11cf7d6e1f
|
@ -1,5 +1,5 @@
|
||||||
#! /usr/bin/env nix-shell
|
#! /usr/bin/env nix-shell
|
||||||
#! nix-shell -i perl -p perl perlPackages.NetAmazonS3 perlPackages.FileSlurp nixUnstable nixUnstable.perl-bindings
|
#! nix-shell -i perl -p perl perlPackages.NetAmazonS3 perlPackages.FileSlurp perlPackages.JSON perlPackages.LWPProtocolHttps nixUnstable nixUnstable.perl-bindings
|
||||||
|
|
||||||
# This command uploads tarballs to tarballs.nixos.org, the
|
# This command uploads tarballs to tarballs.nixos.org, the
|
||||||
# content-addressed cache used by fetchurl as a fallback for when
|
# content-addressed cache used by fetchurl as a fallback for when
|
||||||
|
@ -101,8 +101,8 @@ sub uploadFile {
|
||||||
my ($name, $dest) = @_;
|
my ($name, $dest) = @_;
|
||||||
#print STDERR "linking $name to $dest...\n";
|
#print STDERR "linking $name to $dest...\n";
|
||||||
$bucket->add_key($name, "", {
|
$bucket->add_key($name, "", {
|
||||||
'x-amz-website-redirect-location' => "/" . $dest,
|
'x-amz-website-redirect-location' => "/" . $dest,
|
||||||
'x-amz-acl' => "public-read"
|
'x-amz-acl' => "public-read"
|
||||||
})
|
})
|
||||||
or die "failed to create redirect from $name to $dest\n";
|
or die "failed to create redirect from $name to $dest\n";
|
||||||
$cache{$name} = 1;
|
$cache{$name} = 1;
|
||||||
|
@ -116,8 +116,8 @@ sub uploadFile {
|
||||||
# Upload the file as sha512/<hash-in-base-16>.
|
# Upload the file as sha512/<hash-in-base-16>.
|
||||||
print STDERR "uploading $fn to $mainKey...\n";
|
print STDERR "uploading $fn to $mainKey...\n";
|
||||||
$bucket->add_key_filename($mainKey, $fn, {
|
$bucket->add_key_filename($mainKey, $fn, {
|
||||||
'x-amz-meta-original-name' => $name,
|
'x-amz-meta-original-name' => $name,
|
||||||
'x-amz-acl' => "public-read"
|
'x-amz-acl' => "public-read"
|
||||||
})
|
})
|
||||||
or die "failed to upload $fn to $mainKey\n";
|
or die "failed to upload $fn to $mainKey\n";
|
||||||
$cache{$mainKey} = 1;
|
$cache{$mainKey} = 1;
|
||||||
|
|
|
@ -31,7 +31,7 @@ let
|
||||||
if !canEval x then []
|
if !canEval x then []
|
||||||
else if isDerivation x then optional (canEval x.drvPath) x
|
else if isDerivation x then optional (canEval x.drvPath) x
|
||||||
else if isList x then concatLists (map derivationsIn' x)
|
else if isList x then concatLists (map derivationsIn' x)
|
||||||
else if isAttrs x then concatLists (mapAttrsToList (n: v: derivationsIn' v) x)
|
else if isAttrs x then concatLists (mapAttrsToList (n: v: addErrorContext "while finding tarballs in '${n}':" (derivationsIn' v)) x)
|
||||||
else [ ];
|
else [ ];
|
||||||
|
|
||||||
keyDrv = drv: if canEval drv.drvPath then { key = drv.drvPath; value = drv; } else { };
|
keyDrv = drv: if canEval drv.drvPath then { key = drv.drvPath; value = drv; } else { };
|
||||||
|
|
Loading…
Reference in New Issue