use nix-build to really download the files
This commit is contained in:
parent
c1ad18399e
commit
bf5b27e9c0
26
mirror.pl
26
mirror.pl
|
@ -12,12 +12,26 @@ my @data = @{$text[0]};
|
|||
my $return;
|
||||
|
||||
foreach my $val (@data) {
|
||||
print "Fetching $val->{name} from $val->{url} with $val->{hash}\n";
|
||||
if ($val->{isPatch}) {
|
||||
$return = `nix-instantiate '<nixpkgs>' -A fetchpatch --argstr url "$val->{url}" --argstr name "$val->{name}" --argstr sha256 "$val->{hash}"`;
|
||||
print $return;
|
||||
if ( ! -f "distfiles/$val->{name}" ) {
|
||||
#print "Fetching $val->{name} from $val->{url} with patch=$val->{isPatch} $val->{type} $val->{hash}\n";
|
||||
print Dumper $val;
|
||||
if ($val->{isPatch} eq 1) {
|
||||
$return = `nix-instantiate '<nixpkgs>' -A fetchpatch --argstr url "$val->{url}" --argstr name "$val->{name}" --argstr sha256 "$val->{hash}"`;
|
||||
$return = `nix-build -o "distfiles/$val->{name}" $return`;
|
||||
print $return;
|
||||
} else {
|
||||
# we known the checksum we expect
|
||||
if (defined $val->{type}) {
|
||||
$return = `nix-instantiate '<nixpkgs>' -A fetchurl --argstr url "$val->{url}" --argstr "$val->{type}" "$val->{hash}"`;
|
||||
$return = `nix-build -o "distfiles/$val->{name}" $return`;
|
||||
print $return;
|
||||
} else {
|
||||
$return = `nix-instantiate '<nixpkgs>' -A fetchurl --argstr url "$val->{url}" --argstr sha256 "$val->{hash}"`;
|
||||
$return = `nix-build -o "distfiles/$val->{name}" $return`;
|
||||
print $return;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$return = `nix-instantiate '<nixpkgs>' -A fetchurl --argstr url "$val->{url}" --argstr sha256 "$val->{hash}"`;
|
||||
print $return;
|
||||
print "Skipping $val->{name}, already in store\n";
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue