From 301ac8a07cb1c043cea61eb58ea2bae42a2cbcc2 Mon Sep 17 00:00:00 2001 From: Petr Rockai Date: Fri, 28 Feb 2014 23:56:04 +0100 Subject: [PATCH] NIX: Cope with existence of multiple primary.xml files. This can happen temporarily while a mirror is syncing (parsing repomd.xml would be a better fix, but slightly tricky since it's xml). --- nix/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nix/default.nix b/nix/default.nix index 75c727763..140ae7fe7 100644 --- a/nix/default.nix +++ b/nix/default.nix @@ -75,11 +75,11 @@ let unifiedSystemDir = true; }; rawhide = version: arch: repodata: import (pkgs.runCommand "rawhide-${version}-${arch}.nix" {} '' - sha=$(grep primary.xml ${repodata} | sed -re 's:.* ([0-9a-f]+)-primary.*:\1:') + sha=$(grep primary.xml ${repodata} | sed -re 's:.* ([0-9a-f]+)-primary.*:\1:' | head -n 1) echo '{fedora}: fedora { version = "${version}"; sha = "'$sha'"; arch = "${arch}"; }' > $out '') { inherit fedora; }; update = version: arch: repodata: orig: orig // (import (pkgs.runCommand "updates-fedora.nix" {} '' - sha=$(grep primary.xml ${repodata} | sed -re 's:.* ([0-9a-f]+)-primary.*:\1:') + sha=$(grep primary.xml ${repodata} | sed -re 's:.* ([0-9a-f]+)-primary.*:\1:' | head -n 1) echo fedora ${version} updates sha: $sha (echo 'fetchurl: orig: { packagesLists = [ orig.packagesList (' echo "fetchurl { "