Skip to content

Commit fedbc8e

Browse files
authored
Merge pull request #97 from input-output-hk/update-stackage-fixes
update-stackage: update submodules on fresh checkout
2 parents 2615bd7 + 2a88d56 commit fedbc8e

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

scripts/update-stackage.nix

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,30 +15,25 @@ import ./update-external.nix args {
1515
git clone [email protected]:input-output-hk/stackage.nix.git
1616
cd stackage.nix
1717
git submodule update --init
18+
git submodule foreach git pull origin master
1819
fi
1920
2021
echo "Running lts-to-nix for all snapshots..."
2122
22-
# update them all in parallel...
23-
N=$(getconf _NPROCESSORS_ONLN)
2423
for lts in {lts-haskell,stackage-nightly}/*.yaml
2524
do
26-
lts-to-nix $lts > $(basename ''${lts%.yaml}.nix) &
27-
while [[ $(jobs -r -p | wc -l) -gt $N ]]; do
28-
# can't use `wait -n` on older bash versions.
29-
# e.g. what ships with macOS High Sierra
30-
sleep 1;
31-
done
25+
if [[ ! -f $(basename ''${lts%.yaml}.nix) ]]; then
26+
lts-to-nix $lts > $(basename ''${lts%.yaml}.nix)
27+
fi
3228
done
33-
wait
34-
29+
3530
# update nightlies
3631
echo "{" > nightlies.nix;
3732
for a in nightly-*.nix; do echo " \"''${a%%.nix}\" = import ./$a;" >> nightlies.nix; done;
3833
echo "}" >> nightlies.nix
3934
# update lts
4035
echo "{" > ltss.nix;
41-
for a in lts-*.nix; do echo " \"''${a%%.nix}\" = import ./$a;" >> ltss.nix; done;
36+
for a in $(ls lts-*.nix | sort -Vtx -k 1,1); do echo " \"''${a%%.nix}\" = import ./$a;" >> ltss.nix; done;
4237
echo "}" >> ltss.nix
4338
'';
4439
}

0 commit comments

Comments
 (0)