Merge pull request #334973 from SomeoneSerge/fix/structuredAttrs/xxxArray

stdenv: concatTo: fallback for non-__structuredAttrs derivations
This commit is contained in:
Philip Taron 2024-08-17 17:33:53 -07:00 committed by GitHub
commit 4ef32bd71b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 2 deletions

View File

@ -400,8 +400,15 @@ concatTo() {
-a*)
targetref+=( "${nameref[@]}" ) ;;
*)
# shellcheck disable=SC2206
targetref+=( ${nameref-} ) ;;
if [[ "$name" = *"Array" ]]; then
nixErrorLog "concatTo(): $name is not declared as array, treating as a singleton. This will become an error in future"
# Reproduces https://github.com/NixOS/nixpkgs/pull/318614/files#diff-7c7ca80928136cfc73a02d5b28350bd900e331d6d304857053ffc9f7beaad576L359
targetref+=( ${nameref+"${nameref[@]}"} )
else
# shellcheck disable=SC2206
targetref+=( ${nameref-} )
fi
;;
esac
fi
done

View File

@ -18,6 +18,8 @@ stdenv.mkDerivation (finalAttrs: {
# e.g. links to man pages, value constraints etc.
version = "1.9.15p5";
__structuredAttrs = true;
src = fetchurl {
url = "https://www.sudo.ws/dist/sudo-${finalAttrs.version}.tar.gz";
hash = "sha256-VY0QuaGZH7O5+n+nsH7EQFt677WzywsIcdvIHjqI5Vg=";