Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • scripts/patch/vim-patch.sh

    rd8a9d8b r54f612f  
    1616# Get the # of Patches
    1717#
    18 cd ~/tmp
     18cd /usr/src
    1919wget ftp://ftp.vim.org/pub/vim/patches/${VERSION}/ --no-remove-listing
    2020FILES=$(cat index.html | grep "${VERSION}" | cut -f6 -d. | cut -f1 -d'"' | sed '/^$/d' | tail -n 1)
     
    3333# Set Patch Number
    3434#
    35 cd ~/tmp
     35cd /usr/src
    3636wget http://svn.cross-lfs.org/svn/repos/cross-lfs/trunk/patches/ --no-remove-listing
    3737PATCH_NUM=$(cat index.html | grep vim | grep "${VERSION}" | grep branch_update | cut -f2 -d'"' | cut -f1 -d'"'| cut -f4 -d- | cut -f1 -d. | tail -n 1)
     
    4444tar xvf vim-${VERSION}.tar.bz2
    4545cp -ar vim${SERIES} vim${SERIES}.orig
     46cd vim${SERIES}
     47CURRENTDIR=$(pwd -P)
    4648
    4749# Download and Apply Patches
    4850#
    49 install -d ~/tmp/vim-${VERSION}-patches
    50 cd ~/tmp/vim${SERIES}
    51 CURRENTDIR=$(pwd -P)
    5251PATCHURL=ftp://ftp.vim.org/pub/vim/patches/${VERSION}
     52mkdir /tmp/vim-${VERSION}
    5353COUNT=1
    5454while [ ${COUNT} -le ${FILES} ]; do
    55   cd ~/tmp/vim${SERIES}
     55  cd /tmp/vim-${VERSION}           
    5656  DLCOUNT="${COUNT}"
    5757  SKIPME=no
     
    7171  if [ "${SKIPME}" != "yes" ]; then
    7272    if ! [ -e ${VERSION}.${DLCOUNT} ]; then
    73       cd ~/tmp/vim-${VERSION}-patches
    7473      wget --quiet $PATCHURL/${VERSION}.${DLCOUNT}
    7574    fi
    7675    cd $CURRENTDIR
    77     patch --dry-run -s -f -Np0 -i ~/tmp/vim-${VERSION}-patches/${VERSION}.${DLCOUNT}
     76    patch --dry-run -s -f -Np0 -i /tmp/vim-${VERSION}/${VERSION}.${DLCOUNT}
    7877    if [ "$?" = "0" ]; then
    7978      echo "Patch ${VERSION}.${DLCOUNT} applied"
    80       patch -s -Np0 -i ~/tmp/vim-${VERSION}-patches/${VERSION}.${DLCOUNT}
     79      patch -s -Np0 -i /tmp/vim-${VERSION}/${VERSION}.${DLCOUNT}
    8180    else
    8281      echo "Patch ${VERSION}.${DLCOUNT} not applied"
     82      rm -f /tmp/vim-${VERSION}/${VERSION}.${DLCOUNT}
    8383      SKIPPED="${SKIPPED} ${DLCOUNT}"
    8484    fi
     
    9090#
    9191for dir in $(find * -type d); do
    92   cd ~/tmp/vim${SERIES}
     92  cd /usr/src/vim${SERIES}
    9393  for file in $(find . -name '*~'); do
    9494    rm -f ${file}
     
    9898  done
    9999done
    100 cd ~/tmp/vim${SERIES}
     100cd /usr/src/vim${SERIES}
    101101rm -f *~ *.orig
    102102
    103103# Create Patch
    104104#
    105 cd ~/tmp
    106 echo "Submitted By: Jim Gifford (jim at cross-lfs dot org)" > ~/patches/vim-${VERSION}-branch_update-${PATCH_NUM}.patch
    107 echo "Date: `date +%m-%d-%Y`" >> ~/patches/vim-${VERSION}-branch_update-${PATCH_NUM}.patch
    108 echo "Initial Package Version: ${VERSION}" >> ~/patches/vim-${VERSION}-branch_update-${PATCH_NUM}.patch
    109 echo "Origin: Upstream" >> ~/patches/vim-${VERSION}-branch_update-${PATCH_NUM}.patch
    110 echo "Upstream Status: Applied" >> ~/patches/vim-${VERSION}-branch_update-${PATCH_NUM}.patch
    111 echo "Description: Contains all upstream patches up to ${VERSION}.${FILES}" >> ~/patches/vim-${VERSION}-branch_update-${PATCH_NUM}.patch
     105cd /usr/src
     106echo "Submitted By: Jim Gifford (jim at cross-lfs dot org)" > vim-${VERSION}-branch_update-${PATCH_NUM}.patch
     107echo "Date: `date +%m-%d-%Y`" >> vim-${VERSION}-branch_update-${PATCH_NUM}.patch
     108echo "Initial Package Version: ${VERSION}" >> vim-${VERSION}-branch_update-${PATCH_NUM}.patch
     109echo "Origin: Upstream" >> vim-${VERSION}-branch_update-${PATCH_NUM}.patch
     110echo "Upstream Status: Applied" >> vim-${VERSION}-branch_update-${PATCH_NUM}.patch
     111echo "Description: Contains all upstream patches up to ${VERSION}.${FILES}" >> vim-${VERSION}-branch_update-${PATCH_NUM}.patch
    112112if [ -n "${SKIPPED}" ]; then
    113   echo "             The following patches were skipped" >> ~/patches/vim-${VERSION}-branch_update-${PATCH_NUM}.patch
    114   echo "            ${SKIPPED}" >> ~/patches/vim-${VERSION}-branch_update-${PATCH_NUM}.patch
     113  echo "             The following patches were skipped" >> vim-${VERSION}-branch_update-${PATCH_NUM}.patch
     114  echo "            ${SKIPPED}" >> vim-${VERSION}-branch_update-${PATCH_NUM}.patch
    115115fi
    116 echo "" >> ~/patches/vim-${VERSION}-branch_update-${PATCH_NUM}.patch
    117 diff -Naur vim${SERIES}.orig vim${SERIES} >> ~/patches/vim-${VERSION}-branch_update-${PATCH_NUM}.patch
    118 echo "Created ~/patches/vim-${VERSION}-branch_update-${PATCH_NUM}.patch."
    119 
    120 # Cleanup Directory
    121 #
    122 rm -rf vim${SERIES} vim${SERIES}.orig
     116echo "" >> vim-${VERSION}-branch_update-${PATCH_NUM}.patch
     117diff -Naur vim${SERIES}.orig vim${SERIES} >> vim-${VERSION}-branch_update-${PATCH_NUM}.patch
     118echo "Created /usr/src/vim-${VERSION}-branch_update-${PATCH_NUM}.patch."
Note: See TracChangeset for help on using the changeset viewer.