1 # the external logic for pulling in patches
4 _patchdir
=${srcdir}/patches
5 _rpath
=ftp://ftp.vim.org
/pub
/vim
/patches
/${_srcver}
7 cd ${srcdir}/${_vimfolder}
8 if [ -d ${_patchdir} ]; then
10 echo -e "\tremove patches from old build"
16 # change IFS to loop line-by-line
20 echo -e "\tfetching checksumfile for patches"
21 wget
${_rpath}/MD5SUMS
>/dev
/null
2>&1
23 _patchtotal
=$
(cat MD5SUMS |
sed -e /.
*.gz
/d |
wc -l)
25 if [ -e "${srcdir}/ignore_patches.list" ]; then
26 echo -e "\tignoring specified patches"
27 for _line
in $
(/bin
/cat ${srcdir}/ignore_patches.list
); do
28 sed -i /${_line}/d MD5SUMS
33 for _line
in $
(/bin
/cat MD5SUMS
); do
34 downloads
=$
((${downloads} + 1))
35 _md5
=$
(echo $_line | cut
-d ' ' -f1)
36 _file
=$
(echo $_line | cut
-d ' ' -f3)
37 if [ -f ${SRCDEST}/vim-${_srcver}/${_file} ]; then
38 echo -e "\thaving patch file:${_file}"
39 cp ${SRCDEST}/vim-${_srcver}/${_file} .
/
41 echo -n -e "\t... fetching patch file: ${_file} ..."
42 wget
${_rpath}/${_file} >/dev
/null
2>&1
43 if [ -w ${SRCDEST} ]; then
44 if [ ! -d ${SRCDEST}/vim-
${_srcver} ]; then
45 mkdir
-p ${SRCDEST}/vim-
${_srcver}
47 cp ${_file} ${SRCDEST}/vim-${_srcver}/
52 if [ $
(echo "${_md5} ${_file}" |
md5sum --status -c -) ]; then
53 echo ${_file} md5sums
do not match
60 if [ ${_patchtotal} != ${_patchlevel} ]; then
61 echo -e "Number of patches (${_patchtotal}) does not match the patchlevel (${_patchlevel})!\nEdit the PKGBUILD accordingly!"
64 echo -e "Number of patches (${_patchtotal}) matches the patchlevel (${_patchlevel}), build starting..."
68 cd ${srcdir}/${_vimfolder}
69 for _patch
in $
(/bin
/ls ${_patchdir}); do
70 patch -Np0 -i ${_patchdir}/${_patch} ||
return 1