     v2_path = Path.join([output_dir, "lib", "#{app}-#{v2}", "ebin"]) |> String.to_charlist
     v2_path_consolidated = Path.join([output_dir, "lib", "#{app}-#{v2}", "consolidated"]) |> String.to_charlist
     get_added_relup_code_paths(apps, output_dir, [v2_path_consolidated, v2_path|paths])
+  end
+  defp get_removed_relup_code_paths([], _output_dir, paths), do: paths
+  defp get_removed_relup_code_paths([{app, v1}|apps], output_dir, paths) do
+    v1_path = Path.join([output_dir, "lib", "#{app}-#{v1}", "ebin"]) |> String.to_charlist
+    v1_path_consolidated = Path.join([output_dir, "lib", "#{app}-#{v1}", "consolidated"]) |> String.to_charlist
+    get_removed_relup_code_paths(apps, output_dir, [v1_path_consolidated, v1_path | paths])
   end
 
   # Generates the nodetool utility

    Enum.reject(v2_apps, fn a ->
      elem(a, 0) in changed_apps
    end)
  end

  # Generate .appup files for a list of {app, v1, v2}


  # Get a list of code paths containing only those paths which have beams
  # from the two versions in the release being upgraded
  defp get_relup_code_paths(added, changed, removed, output_dir) do
    added_paths   = get_added_relup_code_paths(added, output_dir, [])
    changed_paths = get_changed_relup_code_paths(changed, output_dir, [], [])
    removed_paths = get_removed_relup_code_paths(removed, output_dir, [])
    added_paths ++ changed_paths ++ removed_paths
  end
  defp get_changed_relup_code_paths([], _output_dir, v1_paths, v2_paths) do
    v2_paths ++ v1_paths
