       end
     name = name <> "_ARTIFACT"
     dir = System.get_env(name)
-    
+
     dir != nil and
     File.dir?(dir)
   end

      false
    else
      exists = Artifact.exists?(pkg, toolchain)
      |> IO.inspect

      checksum = match_checksum?(pkg, toolchain)
      |> IO.inspect

      !(exists and checksum)
    end
  end

  defp match_env?(pkg, toolchain) do
    name =
      case pkg.type do
        :toolchain -> "NERVES_TOOLCHAIN"

      |> File.read
    case artifact_checksum do
      {:ok, checksum} ->
        checksum == Package.checksum(pkg)
      _ ->
        false
    end
  end

