From c845c0ccad9a835a69c63c2eadd71d7845dca111 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 13 Sep 2012 12:11:40 -0400 Subject: nix-channel: Add option to force fetching of manifests --- scripts/nix-channel.in | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'scripts') diff --git a/scripts/nix-channel.in b/scripts/nix-channel.in index 7e50dac1e3a9..61ac823eb1f6 100755 --- a/scripts/nix-channel.in +++ b/scripts/nix-channel.in @@ -6,6 +6,8 @@ use File::Path qw(mkpath); use Nix::Config; use Nix::Manifest; +Nix::Config::readConfig; + my $manifestDir = $Nix::Config::manifestDir; @@ -102,10 +104,15 @@ sub update { # Check if the channel advertises a binary cache. my $binaryCacheURL = `$Nix::Config::curl --silent '$url'/binary-cache-url`; my $extraAttrs = ""; + my $getManifest = ($Nix::Config::config{"force-manifest"} // "false") eq "true"; if ($? == 0 && $binaryCacheURL ne "") { $extraAttrs .= "binaryCacheURL = \"$binaryCacheURL\"; "; deleteOldManifests($origUrl, undef); } else { + $getManifest = 1; + } + + if ($getManifest) { # No binary cache, so pull the channel manifest. mkdir $manifestDir, 0755 unless -e $manifestDir; die "$0: you do not have write permission to `$manifestDir'!\n" unless -W $manifestDir; -- cgit 1.4.1