Unverified Commit 9f05e44d authored by Yureka's avatar Yureka Committed by GitHub
Browse files

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...
parent 2272f206
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -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