3 # Download patches from debian project
4 # Usage $0 debian-patches.txt debian-patches.nix
5 # An example input and output files can be found in tools/graphics/plotutils
7 DEB_URL
=https
://sources.debian.org
/data
/main
9 mapfile
-t deb_patches
< $1
12 deb_prefix
="${deb_patches[0]:0:1}"
13 prefix
="${DEB_URL}/${deb_prefix}/${deb_patches[0]}/debian/patches"
15 if [[ -n "$2" ]]; then
20 # Generated by $(basename $0) from $(basename $1)
26 for ((i
=1;i
< ${#deb_patches[@]}; ++i
)); do
27 url
="${prefix}/${deb_patches[$i]}"
28 sha256
=$
(nix-prefetch-url
$url)
30 echo " url = \"\${prefix}/${deb_patches[$i]}\";"
31 echo " sha256 = \"$sha256\";"