#!/bin/bash
# creates up-to-date vim patches tarball

wget ftp://ftp.vim.org/pub/vim/patches/7.3/MD5SUMS
LAST=$(tail -n 1 MD5SUMS | cut -f 3 -d " " | cut -f 3 -d .)

mkdir patches
cd patches

PATCHES=$(eval echo {001..$LAST})

for i in $PATCHES; do
  wget ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.$i
done

cd ..

tar cvf vim-7.3-patches-001-$LAST.tar patches
bzip2 vim-7.3-patches-001-$LAST.tar

rm -r patches
