source: scripts/patch/vim-patch.sh@ b37f00b

clfs-2.1 clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since b37f00b was ff1e2f9, checked in by Jonathan Norman <jon@…>, 13 years ago

Updated Vim Branch Update to -3 and replaced vim-patch.sh with new shell script

  • Property mode set to 100644
File size: 2.0 KB
RevLine 
[ff1e2f9]1#!/bin/sh
2# Jonathan Norman
3
4# Vim branch update patch generator
[06dcdf6]5
6VERSION=$1
7
8# Check Input
9#
10if [ "${VERSION}" = "" ]; then
[ff1e2f9]11 echo "$0 [Vim_version]"
[9676bac]12 echo "This will Create a Patch for Vim Vim_Version"
13 exit 255
[06dcdf6]14fi
15
[ff1e2f9]16TMP=~/tmp/vim-${VERSION}
17PATCHDIR=${TMP}/patches
18PATCHURL=ftp://ftp.vim.org/pub/vim/patches
[06dcdf6]19SERIES=$(echo ${VERSION} | sed -e 's/\.//g')
[ff1e2f9]20CLFS_PATCHS=http://patches.cross-lfs.org/dev/
[06dcdf6]21
[ff1e2f9]22# Figure out patch number
23UPDATE_NUM=$(curl -ls http://patches.cross-lfs.org/dev/ | grep vim-${VERSION} | cut -d . -f 3 | cut -d - -f 3-)
24UPDATE_NUM=$(expr ${UPDATE_NUM} + 1)
[06dcdf6]25
[ff1e2f9]26# Download patches
27echo "Downloading patches for VIM ${VERSION}"
28PATCH_NUM=$(curl -s $PATCHURL/${VERSION}/ | grep " ${VERSION}." | cut -f 3- -d . | tail -n1)
29mkdir -p $PATCHDIR
30cd $PATCHDIR
31curl -O -# $PATCHURL/$VERSION/$VERSION.[001-$PATCH_NUM]
[c7ef534]32
[ff1e2f9]33echo "Downloading source for VIM $VERSION"
34cd $TMP
35curl -sO ftp://ftp.vim.org/pub/vim/unix/vim-${VERSION}.tar.bz2
36tar -xvf vim-${VERSION}.tar.bz2
37cp -R vim${SERIES} vim${SERIES}.orig
[06dcdf6]38
[ff1e2f9]39echo -n "Generating Patch..."
40cd vim${SERIES}/src
[06dcdf6]41
[ff1e2f9]42for PATCH in $(ls $PATCHDIR); do
43 patch -Np0 -i $PATCHDIR/$PATCH
44 # echo $PATCHDIR/$PATCH
[06dcdf6]45done
46
[ff1e2f9]47cd $TMP
[d8a9d8b]48
[ff1e2f9]49# Create patch
50echo "Submitted By: Jonathan Norman (jonathan at bluesquarelinux dot co dot uk)" > vim-${VERSION}-branch_update-$UPDATE_NUM.patch
51echo "Date: `date +%Y-%m-%d`" >> vim-${VERSION}-branch_update-$UPDATE_NUM.patch
52echo "Initial Package Version: ${VERSION}" >> vim-${VERSION}-branch_update-$UPDATE_NUM.patch
53echo "Origin: Upstream" >> vim-${VERSION}-branch_update-$UPDATE_NUM.patch
54echo "Upstream Status: Applied" >> vim-${VERSION}-branch_update-$UPDATE_NUM.patch
55echo "Description: Contains all upstream patches up to ${VERSION}.${UPDATE_NUM}" >> vim-${VERSION}-branch_update-$UPDATE_NUM.patch
56echo "" >> vim-${VERSION}-branch_update-$UPDATE_NUM.patch
57
58LC_ALL=C TZ=UTC0 diff -Naur vim${SERIES}.orig vim${SERIES} >> vim-${VERSION}-branch_update-$UPDATE_NUM.patch
59
60echo "Done"
61echo "Cleaning up"
62rm -rf vim${SERIES} vim${SERIES}.orig #vim-${VERSION}.tar.bz2
63
64echo "Created: vim-${VERSION}-branch_update-$UPDATE_NUM.patch"
Note: See TracBrowser for help on using the repository browser.