nix-instantiate can be used to replace nix-instantiate + nix-build
This commit is contained in:
parent
0ab366d1d6
commit
33bcb883bf
13
mirror.pl
13
mirror.pl
|
@ -14,20 +14,17 @@ my $return;
|
||||||
foreach my $val (@data) {
|
foreach my $val (@data) {
|
||||||
if ( ! -f "distfiles/$val->{name}" ) {
|
if ( ! -f "distfiles/$val->{name}" ) {
|
||||||
#print "Fetching $val->{name} from $val->{url} with patch=$val->{isPatch} $val->{type} $val->{hash}\n";
|
#print "Fetching $val->{name} from $val->{url} with patch=$val->{isPatch} $val->{type} $val->{hash}\n";
|
||||||
print Dumper $val;
|
#print Dumper $val;
|
||||||
if ($val->{isPatch} eq 1) {
|
if (defined $val->{isPatch} && $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}" '<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;
|
print $return;
|
||||||
} else {
|
} else {
|
||||||
# we known the checksum we expect
|
# we known the checksum we expect
|
||||||
if (defined $val->{type}) {
|
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}" '<nixpkgs>' -A fetchurl --argstr url "$val->{url}" --argstr "$val->{type}" "$val->{hash}"`;
|
||||||
$return = `nix-build -o "distfiles/$val->{name}" $return`;
|
|
||||||
print $return;
|
print $return;
|
||||||
} else {
|
} else {
|
||||||
$return = `nix-instantiate '<nixpkgs>' -A fetchurl --argstr url "$val->{url}" --argstr sha256 "$val->{hash}"`;
|
$return = `nix-build -o "distfiles/$val->{name}" '<nixpkgs>' -A fetchurl --argstr url "$val->{url}" --argstr sha256 "$val->{hash}"`;
|
||||||
$return = `nix-build -o "distfiles/$val->{name}" $return`;
|
|
||||||
print $return;
|
print $return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue