mirror of
https://github.com/NixOS/nix.git
synced 2025-11-15 06:52:43 +01:00
Merge branch '1.11-maintenance' of git://github.com/cyraxjoe/nix into 1.11-maintenance
This commit is contained in:
commit
3e574c3691
2 changed files with 9 additions and 5 deletions
|
|
@ -32,6 +32,9 @@ mkpath(dirname $profile, 0, 0755);
|
||||||
|
|
||||||
my %channels;
|
my %channels;
|
||||||
|
|
||||||
|
my $netrcFile = $Nix::Config::config{"netrc-file"} //
|
||||||
|
"$Nix::Config::confDir/netrc";
|
||||||
|
|
||||||
|
|
||||||
# Reads the list of channels.
|
# Reads the list of channels.
|
||||||
sub readChannels {
|
sub readChannels {
|
||||||
|
|
@ -104,7 +107,7 @@ sub update {
|
||||||
# definition from a consistent location if the redirect changes mid-download.
|
# definition from a consistent location if the redirect changes mid-download.
|
||||||
my $tmpdir = tempdir( CLEANUP => 1 );
|
my $tmpdir = tempdir( CLEANUP => 1 );
|
||||||
my $filename;
|
my $filename;
|
||||||
($url, $filename) = `cd $tmpdir && $Nix::Config::curl $Nix::Config::curlCaFlag --silent --write-out '%{url_effective}\n%{filename_effective}' -L '$url' -O`;
|
($url, $filename) = `cd $tmpdir && $Nix::Config::curl $Nix::Config::curlCaFlag --netrc-file $netrcFile --netrc-optional --silent --write-out '%{url_effective}\n%{filename_effective}' -L '$url' -O`;
|
||||||
chomp $url;
|
chomp $url;
|
||||||
die "$0: unable to check ‘$url’\n" if $? != 0;
|
die "$0: unable to check ‘$url’\n" if $? != 0;
|
||||||
|
|
||||||
|
|
@ -131,7 +134,7 @@ sub update {
|
||||||
my $extraAttrs = "";
|
my $extraAttrs = "";
|
||||||
if ($ret != 0) {
|
if ($ret != 0) {
|
||||||
# Check if the channel advertises a binary cache.
|
# Check if the channel advertises a binary cache.
|
||||||
my $binaryCacheURL = `$Nix::Config::curl $Nix::Config::curlCaFlag --silent '$url'/binary-cache-url`;
|
my $binaryCacheURL = `$Nix::Config::curl $Nix::Config::curlCaFlag --netrc-file $netrcFile --netrc-optional --silent '$url'/binary-cache-url`;
|
||||||
my $getManifest = ($Nix::Config::config{"force-manifest"} // "false") eq "true";
|
my $getManifest = ($Nix::Config::config{"force-manifest"} // "false") eq "true";
|
||||||
if ($? == 0 && $binaryCacheURL ne "") {
|
if ($? == 0 && $binaryCacheURL ne "") {
|
||||||
$extraAttrs .= "binaryCacheURL = \"$binaryCacheURL\"; ";
|
$extraAttrs .= "binaryCacheURL = \"$binaryCacheURL\"; ";
|
||||||
|
|
@ -151,7 +154,7 @@ sub update {
|
||||||
|
|
||||||
# Download the channel tarball.
|
# Download the channel tarball.
|
||||||
my $fullURL = "$url/nixexprs.tar.xz";
|
my $fullURL = "$url/nixexprs.tar.xz";
|
||||||
system("$Nix::Config::curl $Nix::Config::curlCaFlag --fail --silent --head '$fullURL' > /dev/null") == 0 or
|
system("$Nix::Config::curl $Nix::Config::curlCaFlag --netrc-file $netrcFile --netrc-optional --fail --silent --head '$fullURL' > /dev/null") == 0 or
|
||||||
$fullURL = "$url/nixexprs.tar.bz2";
|
$fullURL = "$url/nixexprs.tar.bz2";
|
||||||
print STDERR "downloading Nix expressions from ‘$fullURL’...\n";
|
print STDERR "downloading Nix expressions from ‘$fullURL’...\n";
|
||||||
(my $hash, $path) = `PRINT_PATH=1 QUIET=1 $Nix::Config::binDir/nix-prefetch-url '$fullURL'`;
|
(my $hash, $path) = `PRINT_PATH=1 QUIET=1 $Nix::Config::binDir/nix-prefetch-url '$fullURL'`;
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,8 @@ use Nix::Manifest;
|
||||||
binmode STDERR, ":encoding(utf8)";
|
binmode STDERR, ":encoding(utf8)";
|
||||||
|
|
||||||
my $manifestDir = $Nix::Config::manifestDir;
|
my $manifestDir = $Nix::Config::manifestDir;
|
||||||
|
my $netrcFile = $Nix::Config::config{"netrc-file"} //
|
||||||
|
"$Nix::Config::confDir/netrc";
|
||||||
|
|
||||||
# Prevent access problems in shared-stored installations.
|
# Prevent access problems in shared-stored installations.
|
||||||
umask 0022;
|
umask 0022;
|
||||||
|
|
@ -51,7 +52,7 @@ sub processURL {
|
||||||
my $origUrl = $ENV{'NIX_ORIG_URL'} || $url;
|
my $origUrl = $ENV{'NIX_ORIG_URL'} || $url;
|
||||||
|
|
||||||
# First see if a bzipped manifest is available.
|
# First see if a bzipped manifest is available.
|
||||||
if (system("$Nix::Config::curl $Nix::Config::curlCaFlag --fail --silent --location --head '$url'.bz2 > /dev/null") == 0) {
|
if (system("$Nix::Config::curl $Nix::Config::curlCaFlag --netrc-file $netrcFile --netrc-optional --fail --silent --location --head '$url'.bz2 > /dev/null") == 0) {
|
||||||
print "fetching list of Nix archives at ‘$url.bz2’...\n";
|
print "fetching list of Nix archives at ‘$url.bz2’...\n";
|
||||||
$manifest = downloadFile "$url.bz2";
|
$manifest = downloadFile "$url.bz2";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue