1 # the external logic for pulling in patches
4 _patchdir
=${srcdir}/patches
5 cd ${srcdir}/${_versiondir}
6 if [ -d ${_patchdir} ]; then
8 echo -e "\tremove patches from old build"
10 mkdir
${_patchdir} && cd ${_patchdir}
11 _rpath
=ftp://ftp.vim.org
/pub
/vim
/patches
/${_srcver}
13 # change IFS to loop line-by-line
17 echo -e "\tfetching checksumfile for patches"
18 wget
${_rpath}/MD5SUMS
>/dev
/null
2>&1
21 for _line
in $
(/bin
/cat MD5SUMS
); do
22 _file
=$
(echo $_line | cut
-d ' ' -f3)
23 [ ${_file##*.} == "gz" ] && continue
24 _downloads
=$
((${_downloads} + 1))
25 _md5
=$
(echo $_line | cut
-d ' ' -f1)
26 if [ -f ${SRCDEST}/vim-${_srcver}/${_file} ]; then
27 echo -e "\thaving patch file:${_file}"
28 cp ${SRCDEST}/vim-${_srcver}/${_file} .
/
30 echo -n -e "\t... fetching patch file: ${_file} ..."
31 wget
${_rpath}/${_file} >/dev
/null
2>&1
32 if [ -w ${SRCDEST} ]; then
33 if [ ! -d ${SRCDEST}/vim-
${_srcver} ]; then
34 mkdir
-p ${SRCDEST}/vim-
${_srcver}
36 cp ${_file} ${SRCDEST}/vim-${_srcver}/
41 if [ $
(echo "${_md5} ${_file}" |
md5sum --status -c -) ]; then
42 echo ${_file} md5sums
do not match
49 if [ ${_downloads} != ${_patchlevel} ]; then
51 echo -e "\t\tWARNING!"
52 echo "You are not building the latest available version! A newer patchlevel"
53 echo "seems to be available. Please edit the PKGBUILD and add the latest"
54 echo "${_downloads} as pkgrel number!"
60 cd ${srcdir}/${_versiondir}
61 for _patchnum
in $
(/usr
/bin
/seq 1 ${_patchlevel}); do
62 _patch
=${_srcver}.$
(printf "%03d" ${_patchnum})
63 patch -Np0 -i ${_patchdir}/${_patch} ||
return 1