1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

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).
This commit is contained in:
Petr Rockai 2014-02-28 23:56:04 +01:00
parent daa897fe90
commit 301ac8a07c

View File

@ -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 { "