#! /bin/sh

URL_BASE_PR="https://github.com/sagemath/sage/pull/"
URL_BASE_COMPARE="https://github.com/sagemath/sage/compare/10.0..."

case "$1" in
	-n)  DO=echo ;;
esac

# get_pr <PR number> <description> [ext]
get_pr() {
	pr=$1
	desc=$(echo "$2" | sed -e 's/ /_/g')
	ext=${3-diff}
	$DO wget "$URL_BASE_PR$pr.$ext" -O "$pr-$desc.patch"
}

# run from patches dir
cd $(dirname "$0")

# merged in 10.0.beta0
get_pr 35584 "networkx 3.1"

# merged in 10.0.beta1
get_pr 35612 "linbox 1.7.0"
get_pr 35635 "sympy 1.12"
get_pr 35619 "maxima 5.46.0"

# positive review
get_pr 35707 "maxima 5.47.0"
get_pr 35831 "setuptools 68.0.0"

# needs review
get_pr 35825 "singular 4.3.2p2"
get_pr 35826 "numpy 1.25.0"
