mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-13 13:40:28 +03:00
Merge remote-tracking branch 'origin/master' into staging-next
This commit is contained in:
commit
d0bfb3ccbb
224 changed files with 16163 additions and 16589 deletions
22
maintainers/scripts/haskell/maintained-broken-pkgs.nix
Normal file
22
maintainers/scripts/haskell/maintained-broken-pkgs.nix
Normal file
|
@ -0,0 +1,22 @@
|
|||
let
|
||||
nixpkgs = import ../../..;
|
||||
inherit (nixpkgs {}) haskellPackages lib;
|
||||
maintainedPkgs = lib.filterAttrs (
|
||||
_: v: builtins.length (v.meta.maintainers or []) > 0
|
||||
) haskellPackages;
|
||||
brokenPkgs = lib.filterAttrs (_: v: v.meta.broken) maintainedPkgs;
|
||||
transitiveBrokenPkgs = lib.filterAttrs
|
||||
(_: v: !(builtins.tryEval (v.outPath or null)).success && !v.meta.broken)
|
||||
maintainedPkgs;
|
||||
infoList = pkgs: lib.concatStringsSep "\n" (lib.mapAttrsToList (name: drv: "${name} ${(builtins.elemAt drv.meta.maintainers 0).github}") pkgs);
|
||||
in {
|
||||
report = ''
|
||||
BROKEN:
|
||||
${infoList brokenPkgs}
|
||||
|
||||
TRANSITIVE BROKEN:
|
||||
${infoList transitiveBrokenPkgs}
|
||||
'';
|
||||
transitiveErrors =
|
||||
builtins.attrValues transitiveBrokenPkgs;
|
||||
}
|
|
@ -1,26 +1,38 @@
|
|||
#! /usr/bin/env nix-shell
|
||||
#! nix-shell -i bash -p nix curl jq nix-prefetch-github git gnused gnugrep -I nixpkgs=.
|
||||
# shellcheck shell=bash
|
||||
|
||||
set -eu -o pipefail
|
||||
|
||||
tmpfile=$(mktemp "update-stackage.XXXXXXX")
|
||||
# shellcheck disable=SC2064
|
||||
# Stackage solver to use, LTS or Nightly
|
||||
# (should be capitalized like the display name)
|
||||
SOLVER=LTS
|
||||
TMP_TEMPLATE=update-stackage.XXXXXXX
|
||||
readonly SOLVER
|
||||
readonly TMP_TEMPLATE
|
||||
|
||||
toLower() {
|
||||
printf "%s" "$1" | tr '[:upper:]' '[:lower:]'
|
||||
}
|
||||
|
||||
tmpfile=$(mktemp "$TMP_TEMPLATE")
|
||||
tmpfile_new=$(mktemp "$TMP_TEMPLATE")
|
||||
|
||||
stackage_config="pkgs/development/haskell-modules/configuration-hackage2nix/stackage.yaml"
|
||||
|
||||
trap "rm ${tmpfile} ${tmpfile}.new" 0
|
||||
touch "$tmpfile" "$tmpfile.new" # Creating files here so that trap creates no errors.
|
||||
trap 'rm "${tmpfile}" "${tmpfile_new}"' 0
|
||||
touch "$tmpfile" "$tmpfile_new" # Creating files here so that trap creates no errors.
|
||||
|
||||
curl -L -s "https://stackage.org/lts/cabal.config" >"$tmpfile"
|
||||
old_version=$(grep "# Stackage" $stackage_config | sed -E 's/.*([0-9]{2}\.[0-9]+)/\1/')
|
||||
version=$(sed -rn "s/^--.*http:..(www.)?stackage.org.snapshot.lts-//p" "$tmpfile")
|
||||
curl -L -s "https://stackage.org/$(toLower "$SOLVER")/cabal.config" >"$tmpfile"
|
||||
old_version=$(grep '^# Stackage' $stackage_config | sed -e 's/.\+ \([A-Za-z]\+ [0-9.-]\+\)$/\1/g')
|
||||
version="$SOLVER $(sed -rn "s/^--.*http:..(www.)?stackage.org.snapshot.$(toLower "$SOLVER")-//p" "$tmpfile")"
|
||||
|
||||
if [[ "$old_version" == "$version" ]]; then
|
||||
echo "No new stackage version"
|
||||
exit 0 # Nothing to do
|
||||
fi
|
||||
|
||||
echo "Updating Stackage LTS from $old_version to $version."
|
||||
echo "Updating Stackage from $old_version to $version."
|
||||
|
||||
# Create a simple yaml version of the file.
|
||||
sed -r \
|
||||
|
@ -30,10 +42,10 @@ sed -r \
|
|||
-e 's|,$||' \
|
||||
-e '/installed$/d' \
|
||||
-e '/^$/d' \
|
||||
< "${tmpfile}" | sort --ignore-case >"${tmpfile}.new"
|
||||
< "${tmpfile}" | sort --ignore-case >"${tmpfile_new}"
|
||||
|
||||
cat > $stackage_config << EOF
|
||||
# Stackage LTS $version
|
||||
# Stackage $version
|
||||
# This file is auto-generated by
|
||||
# maintainers/scripts/haskell/update-stackage.sh
|
||||
default-package-overrides:
|
||||
|
@ -45,12 +57,13 @@ sed -r \
|
|||
-e '/ distribution-nixpkgs /d' \
|
||||
-e '/ jailbreak-cabal /d' \
|
||||
-e '/ language-nix /d' \
|
||||
< "${tmpfile}.new" >> $stackage_config
|
||||
-e '/ cabal-install /d' \
|
||||
< "${tmpfile_new}" >> $stackage_config
|
||||
|
||||
if [[ "${1:-}" == "--do-commit" ]]; then
|
||||
git add $stackage_config
|
||||
git commit -F - << EOF
|
||||
haskellPackages: stackage-lts $old_version -> $version
|
||||
haskellPackages: stackage $old_version -> $version
|
||||
|
||||
This commit has been generated by maintainers/scripts/haskell/update-stackage.sh
|
||||
EOF
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue