diff options
| author | Cecil Hugh Watson <knoppmyth@gmail.com> | 2008-12-11 01:37:12 (GMT) |
|---|---|---|
| committer | Cecil Hugh Watson <knoppmyth@gmail.com> | 2008-12-11 01:37:12 (GMT) |
| commit | 54e39512d743caf5afe2f587536135c450ea4fcf (patch) | |
| tree | 22e7ba4ba242782064d36d7a3828b01800436d38 /abs/extra-testing/gvim/fetch_patches.sh | |
| parent | 8417e5e3b118ed9e12563a3d4fceeb38b9e73d4f (diff) | |
| parent | 42129857874c470c65d3b1dcb4bf42945a98dcfa (diff) | |
| download | linhes_pkgbuild-54e39512d743caf5afe2f587536135c450ea4fcf.zip linhes_pkgbuild-54e39512d743caf5afe2f587536135c450ea4fcf.tar.gz linhes_pkgbuild-54e39512d743caf5afe2f587536135c450ea4fcf.tar.bz2 | |
Merge branch 'HEAD' of ssh://cesman@knoppmyth.net/mount/repository/LinHES-PKGBUILD
Conflicts:
abs/core-testing/LinHES-config/LinHES-release
Diffstat (limited to 'abs/extra-testing/gvim/fetch_patches.sh')
| -rw-r--r-- | abs/extra-testing/gvim/fetch_patches.sh | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/abs/extra-testing/gvim/fetch_patches.sh b/abs/extra-testing/gvim/fetch_patches.sh new file mode 100644 index 0000000..03e16e2 --- /dev/null +++ b/abs/extra-testing/gvim/fetch_patches.sh @@ -0,0 +1,60 @@ +# the external logic for pulling in patches + +get_patches() { + _patchdir=${startdir}/src/patches + cd ${startdir}/src/vim$(echo ${_srcver} | sed "s/\.//") + if [ -d ${_patchdir} ]; then + rm -rf ${_patchdir} + echo -e "\tremove patches from old build" + fi + mkdir ${_patchdir} && cd ${_patchdir} + _rpath=ftp://ftp.vim.org/pub/vim/patches/${_srcver} + + # change IFS to loop line-by-line + _OLDIFS=$IFS + IFS=" +" + echo -e "\tfetching checksumfile for patches" + wget ${_rpath}/MD5SUMS >/dev/null 2>&1 + + downloads=0 + for _line in $(/bin/cat MD5SUMS); do + downloads=$((${downloads} + 1)) + _md5=$(echo $_line | cut -d ' ' -f1) + _file=$(echo $_line | cut -d ' ' -f3) + if [ -f ${SRCDEST}/vim-${_srcver}/${_file} ]; then + echo -e "\thaving patch file:${_file}" + cp ${SRCDEST}/vim-${_srcver}/${_file} ./ + else + echo -n -e "\t... fetching patch file: ${_file} ..." + wget ${_rpath}/${_file} >/dev/null 2>&1 + if [ -w ${SRCDEST} ]; then + if [ ! -d ${SRCDEST}/vim-${_srcver} ]; then + mkdir -p ${SRCDEST}/vim-${_srcver} + fi + cp ${_file} ${SRCDEST}/vim-${_srcver}/ + echo " done!" + fi + fi + + if [ $(echo "${_md5} ${_file}" | md5sum --status -c -) ]; then + echo ${_file} md5sums do not match + return 1 + fi + done + + ######## + + if [ ${downloads} != ${_patchlevel} ]; then + echo -e "Number of patches does not match the patchlevel!\nEdit the PKGBUILD accordingly!" + return 1 + fi + IFS=$_OLDIFS + rm MD5SUMS + cd ${startdir}/src/vim$(echo ${_srcver} | sed "s/\.//") + for _patch in $(/bin/ls ${_patchdir}); do + patch -Np0 -i ${_patchdir}/${_patch} || return 1 + done + rm -rf ${_patchdir} + return 0 +} |
