buildRubyGem: don't use the bash 'type' variable name (#211899)

https://github.com/NixOS/nixpkgs/issues/211671

There is also a fix with an stdenv rebuild in staging, but we don't want to wait so long...
This commit is contained in:
Yureka 2023-01-21 16:43:07 +01:00 committed by GitHub
parent 2272f206cd
commit 9f05e44db6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -86,7 +86,7 @@ stdenv.mkDerivation ((builtins.removeAttrs attrs ["source"]) // {
inherit ruby;
inherit dontBuild;
inherit dontStrip;
inherit type;
gemType = type;
nativeBuildInputs = [
ruby makeWrapper
@ -143,7 +143,7 @@ stdenv.mkDerivation ((builtins.removeAttrs attrs ["source"]) // {
buildPhase = attrs.buildPhase or ''
runHook preBuild
if [[ "$type" == "gem" ]]; then
if [[ "$gemType" == "gem" ]]; then
if [[ -z "$gemspec" ]]; then
gemspec="$(find . -name '*.gemspec')"
echo "found the following gemspecs:"
@ -158,7 +158,7 @@ stdenv.mkDerivation ((builtins.removeAttrs attrs ["source"]) // {
gempkg=$(echo "$output" | grep -oP 'File: \K(.*)')
echo "gem package built: $gempkg"
elif [[ "$type" == "git" ]]; then
elif [[ "$gemType" == "git" ]]; then
git init
# remove variations to improve the likelihood of a bit-reproducible output
rm -rf .git/logs/ .git/hooks/ .git/index .git/FETCH_HEAD .git/ORIG_HEAD .git/refs/remotes/origin/HEAD .git/config