[arch-commits] CVS update of arch/build/editors/gvim (fetch_patches.sh)

Tobias Kieslich tobias at archlinux.org
Mon Jun 25 19:45:45 UTC 2007


    Date: Monday, June 25, 2007 @ 15:45:45
  Author: tobias
    Path: /home/cvs-arch/arch/build/editors/gvim

Modified: fetch_patches.sh (1.1 -> 1.2)

fix the fetch_patches.sh since it had all the logic for the runtime update in it


------------------+
 fetch_patches.sh |  119 -----------------------------------------------------
 1 file changed, 119 deletions(-)


Index: arch/build/editors/gvim/fetch_patches.sh
diff -u arch/build/editors/gvim/fetch_patches.sh:1.1 arch/build/editors/gvim/fetch_patches.sh:1.2
--- arch/build/editors/gvim/fetch_patches.sh:1.1	Mon Jun 25 01:58:00 2007
+++ arch/build/editors/gvim/fetch_patches.sh	Mon Jun 25 15:45:44 2007
@@ -1,5 +1,4 @@
 # the external logic for pulling in patches
-
 get_patches() {
   if [ -d ${_patchdir} ]; then
     rm -rf ${_patchdir}
@@ -41,121 +40,3 @@
   IFS=$_OLDIFS
   rm MD5SUMS
 }
-
-# the purpose of this magic is to pull in the latest runtime files for vim
-# we start withe theruntime provoded by the tarballs and compare MD5s against
-# the latest runtime
-# if this fails we look in the local source cache if they have been fetched
-# for an earlier build and compare those MD5 files
-# if this fails, we fetch the stuff from online and store it in the local src
-# cache.
-# The local cache has to be set (makepkg.conf) AND it has to be writable
-
-update_runtime() {
-  _OLDDIR=$(pwd) #get absolute path
-  _errors=0
-  _ftp="ftp://ftp.vim.org/pub/vim/runtime"
-
-  # we're gonna be sneaky and grok the A-A-P recipe for the files we need
-  _recipe="getunix.aap"
-  _srccache="${SRCDEST}/vim-${_srcver}/"
-
-  echo "getting runtime recipe"
-  cd ${startdir}/src
-  [ -f "${_recipe}" ] && rm "${_recipe}"
-  wget "${_ftp}/${_recipe}" >/dev/null 2>&1
-
-  cd "${_runtimedir}"
-  _runtimedir=$(pwd) #get absolute path
-
-  # change IFS to loop line-by-line
-  _OLDIFS=$IFS
-  IFS="
-"
-  echo "begin fetching updated runtime files..."
-  for _file in $(grep "file = " "${startdir}/src/${_recipe}"); do
-    _file=$(echo ${_file} | sed "s|.*file = \(.*\)|\1|")
-    _md5=$(grep -A2 "file = ${_file} *$" "${startdir}/src/${_recipe}" | \
-          grep "get_md5" | \
-          sed 's|@if get_md5(file) != "\(.*\)":|\1|g')
-    _dir=$(dirname "${_file}")
-
-    mkdir -p "${_dir}"
-
-    echo -e "\t${_file}"
-    _havefile=0
-    # if we have the file and the MD5sum fails, we technically don't have the file
-    if [ -f ${_file} ]; then
-      echo "${_md5}  ${_file}" | md5sum -c - >/dev/null 2>&1
-      # MD5 fails ? ... we don't have the file
-      if [ ${?} -ne 0 ]; then
-        rm ${_file}
-      else
-        _havefile=1
-      fi
-    fi
-    # look files that were not copied from the unzipped sources
-    _cachefile=${startdir}/src/vim$(echo ${_srcver} | sed "s/\.//")/runtime/${_file}
-    if [ ${_havefile} -ne 1 -a -f ${_cachefile} ]; then
-      echo "${_md5}  ${_cachefile}" | md5sum -c - >/dev/null 2>&1
-      # MD5 fails ? ... we lookup if we downloaded another version earlier
-      if [ ${?} -ne 0 ]; then
-        _cachefile=${_srccache}/${_file}
-        if [ -f ${_cachefile} ]; then
-          echo "${_md5}  ${_cachefile}" | md5sum -c - >/dev/null 2>&1
-          if [ ${?} -ne 0 ]; then
-            rm ${_cachefile}
-          else
-            cp ${_cachefile} ${_dir}
-            _havefile=1
-          fi
-        fi
-      else
-        cp ${_cachefile} ${_dir}
-        _havefile=1
-      fi
-    fi
-    # look up the local $SRCDEST
-    _cachefile=${_srccache}/${_file}
-    if [ ${_havefile} -ne 1 -a -f ${_cachefile} ]; then
-      echo "${_md5}  ${_cachefile}" | md5sum -c - >/dev/null 2>&1
-      # MD5 fails ? ... we don't have the file
-      if [ ${?} -ne 0 ]; then
-        rm ${_cachefile}
-      else
-        cp ${_cachefile} ${_dir}
-        _havefile=1
-      fi
-    fi
-    # so we finally have to fetch it and store it to $SRCDEST (cache)
-    if [ ${_havefile} -ne 1 ]; then
-      echo -e "\tdownloading ${_file} ..."
-      cd "${_dir}"
-      wget "${_ftp}/${_file}" >/dev/null 2>&1
-      cd "${_runtimedir}"
-      # store freshly downloaded file in SRCDEST
-      mkdir -p ${_srccache}/${_dir}
-      cp ${_file} ${_srccache}/${_dir}
-    fi
-
-   # check the MD5 sum finally
-    echo "${_md5}  ${_file}" | md5sum -c - >/dev/null 2>&1
-    if [ $? -ne 0 ]; then
-      echo "!!!! md5sum check for ${_file} failed !!!!"
-      errors=$((${_errors} + 1))
-    fi
-  done
-  IFS=${_OLDIFS}
-
-  echo "vim runtime got updated"
-
-  if [ ${_errors} -gt 0 ]; then
-    echo "${_errors} failed MD5 checks while updating runtime files -> build can't be completed"
-    return 1
-  else
-    echo -e "\tpacthing filetype.vim for better handling of pacman related files ..."
-    #sed -i "s/rpmsave/pacsave/;s/rpmnew/pacnew/;s/ebuild /ebuild,PKGBUILD* /" filetype.vim
-    sed -i "s/rpmsave/pacsave/;s/rpmnew/pacnew/;s/,\*\.ebuild/\0,PKGBUILD*/" filetype.vim
-  fi
-  cd "${_OLDDIR}"
-}




More information about the arch-commits mailing list